Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Common/KWCommon/vtkArrayMap.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Module:    $RCSfile: vtkArrayMap.h,v $
00004 
00005   Copyright (c) Kitware, Inc.
00006   All rights reserved.
00007   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00028 #include "vtkAbstractMap.h"
00029 
00030 #ifndef __vtkArrayMap_h
00031 #define __vtkArrayMap_h
00032 
00033 template<class DataType> class vtkVector;
00034 template<class KeyType, class DataType> class vtkArrayMapIterator;
00035 
00036 template<class KeyType, class DataType>
00037 class vtkArrayMap : public vtkAbstractMap<KeyType,DataType>
00038 {
00039   friend class vtkArrayMapIterator<KeyType,DataType>;
00040   virtual const char* GetClassNameInternal() const {return "vtkArrayMap";}
00041 public:
00042   typedef vtkAbstractMap<KeyType,DataType> Superclass;
00043   typedef vtkArrayMapIterator<KeyType,DataType> IteratorType;
00044 
00045   // Cannot use this macro because of the comma in the type name.
00046   // The CPP splits that in two and we ae in trouble.
00047   //vtkContainerTypeMacro((vtkArrayMap<KeyType,DataType>), vtkContainer);
00048 
00049   static vtkArrayMap<KeyType,DataType> *New(); 
00050 
00053   vtkArrayMapIterator<KeyType,DataType> *NewIterator();
00054 
00057   int SetItem(const KeyType& key, const DataType& data);
00058   
00061   int RemoveItem(const KeyType& key);
00062   
00064   void RemoveAllItems();
00065   
00068   int GetItem(const KeyType& key, DataType& data);
00069   
00073   vtkIdType GetNumberOfItems() const;
00074 
00077   int IsItemPresent(const KeyType& key);
00078 
00079   void DebugList();
00080 
00081 protected:
00082   vtkArrayMap() { this->Array = 0; }
00083   virtual ~vtkArrayMap();
00084 
00086 
00087   virtual vtkAbstractMapItem<KeyType,DataType> 
00088     *FindDataItem(const KeyType key);
00090 
00091   vtkVector< vtkAbstractMapItem<KeyType,DataType>* > *Array;
00092 
00093 private:
00094   vtkArrayMap(const vtkArrayMap<KeyType,DataType>&); // Not implemented
00095   void operator=(const vtkArrayMap<KeyType,DataType>&); // Not implemented
00096 };
00097 
00098 #ifdef VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION
00099 #include "vtkArrayMap.txx"
00100 #endif 
00101 
00102 #endif
00103 
00104 
00105 

Generated on Tue May 30 12:31:37 2006 for ParaView by doxygen 1.3.5