00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ArrayOfTaggedObjects_h
00027 #define ArrayOfTaggedObjects_h
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #include <TaggedObjectStorage.h>
00048 #include <ArrayOfTaggedObjectsIter.h>
00049
00064 class ArrayOfTaggedObjects : public TaggedObjectStorage
00065 {
00066 public:
00080 ArrayOfTaggedObjects(int size);
00081
00086 ~ArrayOfTaggedObjects();
00087
00088
00090 int setSize(int newSize);
00096 bool addComponent(TaggedObject *newComponent);
00097
00099 TaggedObject *removeComponent(int tag);
00103 int getNumComponents(void) const;
00104
00105
00120 TaggedObject *getComponentPtr(int tag);
00121
00128 TaggedObjectIter &getComponents();
00129
00130
00132 ArrayOfTaggedObjectsIter getIter();
00133
00134
00136 virtual TaggedObjectStorage *getEmptyCopy(void);
00138 virtual void clearAll(bool invokeDestructor = true);
00139
00141 void Print(ostream &s, int flag =0);
00143 friend #include <ArrayOfTaggedObjectsIter.h>
00144
00145 protected:
00146
00147 private:
00148 int numComponents;
00149 int sizeComponentArray;
00150 int positionLastEntry;
00151 int positionLastNoFitEntry;
00152 bool fitFlag;
00153 TaggedObject **theComponents;
00154 ArrayOfTaggedObjectsIter myIter;
00155 };
00156
00157 #endif
00158
00159