cutbuffer.h

Go to the documentation of this file.
00001 
00039 #ifndef ABA_CUTBUFFER_H
00040 #define ABA_CUTBUFFER_H
00041 
00042 #include "abacus/array.h"
00043 
00044 class ABA_MASTER;
00045 template<class BaseType, class CoType> class ABA_POOLSLOT;
00046 template<class BaseType, class CoType> class ABA_POOLSLOTREF;
00047 
00048   template<class BaseType, class CoType>
00049   class ABA_CUTBUFFER : public ABA_ABACUSROOT  { 
00050     friend class ABA_SUB;
00051     public: 
00052 
00059       ABA_CUTBUFFER(ABA_MASTER *master, int size);
00060 
00069       ~ABA_CUTBUFFER();
00070 
00073       int size() const;
00074 
00077       int number() const;
00078     
00079 
00082       int space() const;
00083 
00102       int insert(ABA_POOLSLOT<BaseType, CoType> *slot, bool keepInPool);
00103 
00114       int insert(ABA_POOLSLOT<BaseType, CoType> *slot, bool keepInPool, 
00115                  double rank);
00116 
00121       void remove(ABA_BUFFER<int> &index);
00122 
00125       ABA_POOLSLOT<BaseType, CoType> *slot(int i);
00126 
00127     private: 
00128 
00138       void extract(int max, ABA_BUFFER<ABA_POOLSLOT<BaseType, CoType>*> &newSlots);
00139 
00145       void sort(int threshold);
00146 
00147 
00150       ABA_MASTER *master_;
00151 
00154       int     n_;
00155 
00158       ABA_ARRAY<ABA_POOLSLOTREF<BaseType, CoType>*> psRef_;
00159 
00164       ABA_ARRAY<bool>         keepInPool_;
00165 
00168       ABA_ARRAY<double>       rank_;
00169 
00173       bool                ranking_;
00174       ABA_CUTBUFFER(const ABA_CUTBUFFER<BaseType, CoType> &rhs);
00175       const ABA_CUTBUFFER<BaseType, CoType> 
00176             &operator=(const ABA_CUTBUFFER<BaseType, CoType> &rhs);
00177   };
00178 
00179 #include "abacus/cutbuffer.inc"
00180 
00181 #endif  // !ABA_CUTBUFFER_H
00182 

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