pool.h

Go to the documentation of this file.
00001 
00049 #ifndef ABA_POOL_H
00050 #define ABA_POOL_H
00051 
00052 #include "abacus/array.h"
00053 
00054 class ABA_MASTER;
00055 class ABA_SUB;
00056 template<class BaseType, class CoType> class ABA_ACTIVE;
00057 template<class BaseType, class CoType> class ABA_CUTBUFFER;
00058 template<class BaseType, class CoType> class ABA_POOLSLOT;
00059 
00060 #ifdef ABACUS_PARALLEL
00061 template <class Type> class ABA_IDMAP;
00062 #endif
00063 
00064   template<class BaseType, class CoType>
00065   class  ABA_POOL :  public ABA_ABACUSROOT  { 
00066     public: 
00067       enum RANKING {NO_RANK, RANK, ABS_RANK};
00068 
00069 
00074       ABA_POOL(ABA_MASTER *master);
00075 
00077       virtual ~ABA_POOL();
00078       virtual ABA_POOLSLOT<BaseType, CoType> *insert(BaseType *cv) = 0;
00079 
00085       void removeConVar(ABA_POOLSLOT<BaseType, CoType> *slot);
00086 
00089       int number() const;
00090       virtual int separate(double *z, 
00091                            ABA_ACTIVE<CoType, BaseType> *active, 
00092                            ABA_SUB *sub,
00093                            ABA_CUTBUFFER<BaseType, CoType> *cutBuffer,
00094                            double minAbsViolation = 0.001,
00095                            int ranking = 0) = 0;
00096 #ifdef ABACUS_PARALLEL
00097 
00103       ABA_POOLSLOT<BaseType, CoType> *findSlot(const ABA_ID &id) const;
00104 
00107       ABA_IDMAP<ABA_POOLSLOT<BaseType, CoType>   > *identificationMap() const;
00108 #endif
00109 
00110    protected: 
00111 
00125       virtual int softDeleteConVar(ABA_POOLSLOT<BaseType, CoType> *slot);
00126 
00133       virtual void hardDeleteConVar(ABA_POOLSLOT<BaseType, CoType> *slot);
00134       virtual ABA_POOLSLOT<BaseType, CoType> *getSlot() = 0;
00135       virtual void putSlot(ABA_POOLSLOT<BaseType, CoType> *slot) = 0;
00136       ABA_MASTER *master_;
00137       int number_;
00138 #ifdef ABACUS_PARALLEL
00139       ABA_IDMAP<ABA_POOLSLOT<BaseType, CoType>   > *identificationMap_;
00140       int index_;
00141 #endif
00142   };
00143 
00144 #include "abacus/pool.inc"
00145 
00146 #endif  // ABA_POOL_H
00147 

Generated on Tue Aug 14 18:09:54 2007 for ABACUS by  doxygen 1.5.1