24 #ifndef _TPIE_BLOCKS_BLOCK_COLLECTION_CACHE_H
25 #define _TPIE_BLOCKS_BLOCK_COLLECTION_CACHE_H
30 #include <tpie/blocks/block.h>
31 #include <tpie/blocks/block_collection.h>
45 struct position_comparator {
47 return a.position < b.position;
51 typedef std::list<block_handle> block_list_t;
53 struct block_information_t {
54 block_information_t() {}
56 block_information_t(
block * pointer, block_list_t::iterator iterator,
bool dirty)
63 block_list_t::iterator iterator;
67 typedef std::map<block_handle, block_information_t, position_comparator> block_map_t;
76 block_collection_cache(std::string fileName, memory_size_type blockSize, memory_size_type maxSize,
bool writeable);
100 void used(block_information_t& item);
119 block_list_t m_blockList;
120 block_map_t m_blockMap;
121 memory_size_type m_curSize;
122 memory_size_type m_maxSize;
123 memory_size_type m_blockSize;
130 #endif // _TPIE_BLOCKS_BLOCK_COLLECTION_CACHE_H
Defines the tp_assert macro.
A class to manage writing and reading of block to disk.
tpie_init and tpie_finish.
A class to manage writing and reading of block to disk.
Declare default file accessor.
void free_block(block_handle handle)
frees a block
block_collection_cache(std::string fileName, memory_size_type blockSize, memory_size_type maxSize, bool writeable)
Create a block collection.
block_handle get_free_block()
Allocates a new block.
void write_block(block_handle handle)
Writes the content of a block to disk.
block * read_block(block_handle handle)
Reads the content of a block from disk.