Quark  0.1
AllocationMap.h++
Go to the documentation of this file.
1 
2 #ifndef __libquark_util_AllocationMap_hxx
3 #define __libquark_util_AllocationMap_hxx
4 
5 #include <QtGlobal>
6 
7 namespace quark {
8 namespace util {
9 
16 {
17  public:
18 
20  AllocationMap(int size);
21 
24 
30  int reserve();
31 
37  void reserve(int index);
38 
46  void release(int index);
47 
55  bool isReserved(int index) const;
56 
58  void clear();
59 
61  inline int getSize() const
62  { return(_size); }
63 
64  private:
65 
66  int _size;
67  int _len;
68  quint32 *_map;
69  quint32 *_end;
70 };
71 
72 } // namespace util
73 } // namespace quark
74 
75 #endif // __libquark_util_AllocationMap_hxx
~AllocationMap()
Destructor.
void clear()
Clears the allocation map.
int getSize() const
Returns the size of the AllocationMap.
Definition: AllocationMap.h++:61
void release(int index)
Releases an index.
int reserve()
Reserves an index in the map.
An index allocation map.
Definition: AllocationMap.h++:15
Definition: BarChartView.h++:6
AllocationMap(int size)
Constructs a new AllocationMap of the specified size.
bool isReserved(int index) const
Tests if a given index is reserved.