00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __BxUnionCases__
00018 #define __BxUnionCases__
00019
00020 #include "BxUnionCase.h"
00021
00040 class DECLSPEC BxUnionCases : public BxObject
00041 {
00042 private:
00043 BxUnionCase ** elements_;
00044 int capacity_;
00045 int elementCount_;
00046 int incrementSize_;
00047
00048 public:
00049 BxUnionCases();
00050 BxUnionCases(int,int);
00051 BxUnionCases(const BxUnionCases&);
00052 virtual ~BxUnionCases();
00053
00054 virtual char* className() const { return "BxUnionCases"; }
00055
00056 bool add(BxUnionCase*);
00057 BxUnionCase * remove(int index);
00058 void clear();
00059
00060 BxUnionCase * get(int index) const;
00061 BxUnionCase * get(const BxDataObject& discriminant) const;
00062 BxDataObject * getArm(int index) const;
00063 BxDataObject * getArm(const BxDataObject& discriminant) const;
00064 int count() const { return elementCount_; }
00065
00066 BxUnionCase * operator[](int index) const;
00067
00068 protected:
00069 bool expand();
00070 int findDiscriminantByValue(const BxDataObject& discriminant) const;
00071 };
00072
00073 #endif
00074