gatelib  2.1
g_cont_unspec.h
1 #pragma once
2 
3 #include "g_cont_HeapAbstract.h"
4 #include "g_cont_AllocationPolicyAbstract.h"
5 
6 #ifndef NULL
7 #define NULL 0
8 #endif
9 
10 #define DEFAULT_ALLOCATION_DELTA 8
11 
12 
13 namespace g
14 {
15 namespace cont
16 {
17 
18 class Unspec
19 {
20 protected:
21  Unspec ( AllocationPolicyAbstract* aAllocPolicyP ) { mAllocPolicyP = aAllocPolicyP; }
22 
23 public:
24  virtual ~Unspec ( ) {}
25 
26  virtual void setEmpty ( ) = 0;
27  virtual int getLbound ( ) const = 0;
28  virtual int getUbound ( ) const = 0;
29  size_t getSize ( ) const { return getUbound ( ) - getLbound ( ) + 1; }
30 
31  AllocationPolicyAbstract* getAllocPolicyP ( ) const { return mAllocPolicyP; }
32  HeapAbstract* getHeapP ( ) const { return mAllocPolicyP->getHeapP(); }
33 
34  bool isAnIndex ( int aIndex ) const { return ( aIndex >= getLbound ( ) && aIndex <= getUbound ( ) ); }
35 
36 protected:
37  AllocationPolicyAbstract* mAllocPolicyP;
38 };
39 
40 
41 }//namespace cont
42 }//namespace g
Definition: g_cont_AllocationPolicyAbstract.h:16
Definition: g.mthread.ThreadSimpleEvent.h:5
Definition: g_cont_HeapAbstract.h:20
Definition: g_cont_unspec.h:18