BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / file_systems / ramfs / BlockReferenceManager.h
blobb574fa4749dbcbe5d8478c84a0db90d13e7958e0
1 // BlockReferenceManager.h
3 #ifndef BLOCK_REFERENCE_MANAGER_H
4 #define BLOCK_REFERENCE_MANAGER_H
6 #include <new>
7 #include "List.h"
9 class AllocationInfo;
10 class BlockReference;
12 class BlockReferenceManager {
13 public:
14 BlockReferenceManager();
15 ~BlockReferenceManager();
17 BlockReference *AllocateReference();
18 void FreeReference(BlockReference *reference);
20 // debugging only
21 bool CheckReference(BlockReference *reference);
22 void GetAllocationInfo(AllocationInfo &info);
24 private:
25 status_t _AddTable();
27 private:
28 class Table {
29 public:
30 Table() : fSize(0), fReferences(NULL) {}
31 Table(int) : fSize(0), fReferences(NULL) {}
32 ~Table();
34 status_t Init(int32 size);
36 BlockReference *GetReferences() { return fReferences; }
38 int32 GetSize() const { return fSize; }
40 private:
41 uint32 fSize;
42 BlockReference *fReferences;
45 List<Table> fTables;
46 BlockReference *fFreeList;
49 #endif // BLOCK_REFERENCE_MANAGER_H