00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkIndexedContainerInterface.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:13 $ 00007 Version: $Revision: 1.23 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkIndexedContainerInterface_h 00018 #define __itkIndexedContainerInterface_h 00019 00020 #include "itkObject.h" 00021 00022 namespace itk 00023 { 00024 00053 template <typename TElementIdentifier, typename TElement> 00054 class IndexedContainerInterface: public Object 00055 { 00056 public: 00058 typedef IndexedContainerInterface Self; 00059 typedef Object Superclass; 00060 typedef SmartPointer<Self> Pointer; 00061 typedef SmartPointer<const Self> ConstPointer; 00062 00064 itkTypeMacro(IndexedContainerInterface, Object); 00065 00067 typedef TElementIdentifier ElementIdentifier; 00068 typedef TElement Element; 00069 00076 Element& ElementAt(ElementIdentifier); 00077 00084 Element& CreateElementAt(ElementIdentifier); 00085 00087 Element GetElement(ElementIdentifier) const ; 00088 00092 void SetElement(ElementIdentifier, Element); 00093 00097 void InsertElement(ElementIdentifier, Element); 00098 00101 bool IndexExists(ElementIdentifier) const ; 00102 00108 bool GetElementIfIndexExists(ElementIdentifier, Element*) const ; 00109 00114 void CreateIndex(ElementIdentifier); 00115 00122 void DeleteIndex(ElementIdentifier); 00123 00129 class Iterator {}; 00131 00137 class ConstIterator {}; 00139 00141 Iterator Begin(); 00142 00144 Iterator End(); 00145 00147 ConstIterator Begin() const ; 00148 00150 ConstIterator End() const ; 00151 00153 unsigned long Size(void) const ; 00154 00159 void Reserve(ElementIdentifier); 00160 00164 void Squeeze(void); 00165 00168 void Initialize(void); 00169 00170 }; 00171 00172 } // end namespace itk 00173 00174 #endif 00175