00001
00043 #ifndef ABA_NONDUPLPOOL_H
00044 #define ABA_NONDUPLPOOL_H
00045
00046 #include "abacus/global.h"
00047 #include "abacus/hash.h"
00048 #include "abacus/standardpool.h"
00049
00050
00051 template<class BaseType, class CoType>
00052 class ABA_NONDUPLPOOL : public ABA_STANDARDPOOL<BaseType, CoType> {
00053 public:
00054
00064 ABA_NONDUPLPOOL(ABA_MASTER *master, int size, bool autoRealloc = false);
00065
00066
00068 virtual ~ABA_NONDUPLPOOL();
00069
00082 virtual ABA_POOLSLOT<BaseType, CoType> *insert(BaseType *cv);
00083
00094 virtual ABA_POOLSLOT<BaseType, CoType> *present(BaseType *cv);
00095
00105 virtual void increase(int size);
00106
00121 void statistics(int &nDuplications, int &nCollisions) const;
00122 private:
00123
00134 virtual int softDeleteConVar(ABA_POOLSLOT<BaseType, CoType> *slot);
00135
00141 virtual void hardDeleteConVar(ABA_POOLSLOT<BaseType, CoType> *slot);
00142 ABA_HASH<unsigned, ABA_POOLSLOT<BaseType, CoType>*> hash_;
00143 int nDuplications_;
00144 ABA_NONDUPLPOOL(const ABA_NONDUPLPOOL &rhs);
00145 const ABA_NONDUPLPOOL &operator=(const ABA_NONDUPLPOOL &rhs);
00146 };
00147
00148 #include "abacus/nonduplpool.inc"
00149
00150 #endif // ABA_NONDUPLPOOL_H
00151
00152
00153
00154