|
STXXL
1.4-dev
|
Implements dynamically resizable buffered writing pool.
Definition at line 32 of file write_pool.h.
Inheritance diagram for stxxl::write_pool< BlockType >:
Collaboration diagram for stxxl::write_pool< BlockType >:Classes | |
| struct | busy_entry |
Public Types | |
| typedef block_type::bid_type | bid_type |
| typedef BlockType | block_type |
| typedef std::list< busy_entry > ::iterator | busy_blocks_iterator |
| typedef std::list< block_type * > ::iterator | free_blocks_iterator |
Public Member Functions | |
| write_pool (unsigned_type init_size=1) | |
| Constructs pool. More... | |
| ~write_pool () | |
| Waits for completion of all ongoing write requests and frees memory. More... | |
| void | add (block_type *&block) |
| block_type * | get () |
| request_ptr | get_request (bid_type bid) |
| bool | has_request (bid_type bid) |
| void | resize (unsigned_type new_size) |
| Resizes size of the pool. More... | |
| unsigned_type | size () const |
| Returns number of owned blocks. More... | |
| block_type * | steal () |
| Take out a block from the pool. More... | |
| block_type * | steal (bid_type bid) |
| std::pair< block_type *, request_ptr > | steal_request (bid_type bid) |
| void | swap (write_pool &obj) |
| request_ptr | write (block_type *&block, bid_type bid) |
| Passes a block to the pool for writing. More... | |
Protected Member Functions | |
| void | check_all_busy () |
Protected Attributes | |
| std::list< busy_entry > | busy_blocks |
| std::list< block_type * > | free_blocks |
Additional Inherited Members | |
Private Member Functions inherited from stxxl::noncopyable | |
| noncopyable () | |
| typedef block_type::bid_type stxxl::write_pool< BlockType >::bid_type |
Definition at line 36 of file write_pool.h.
| typedef BlockType stxxl::write_pool< BlockType >::block_type |
Definition at line 35 of file write_pool.h.
| typedef std::list<busy_entry>::iterator stxxl::write_pool< BlockType >::busy_blocks_iterator |
Definition at line 53 of file write_pool.h.
| typedef std::list<block_type*>::iterator stxxl::write_pool< BlockType >::free_blocks_iterator |
Definition at line 52 of file write_pool.h.
|
inlineexplicit |
Constructs pool.
| init_size | initial number of blocks in the pool |
Definition at line 64 of file write_pool.h.
References STXXL_VERBOSE_WPOOL.
|
inline |
Waits for completion of all ongoing write requests and frees memory.
Definition at line 80 of file write_pool.h.
References STXXL_VERBOSE_WPOOL.
|
inline |
Definition at line 245 of file write_pool.h.
References STXXL_VERBOSE_WPOOL.
Referenced by stxxl::prefetch_pool< BlockType >::hint(), and stxxl::prefetch_pool< BlockType >::read().
|
inlineprotected |
Definition at line 253 of file write_pool.h.
References STXXL_VERBOSE_WPOOL.
|
inline |
Definition at line 161 of file write_pool.h.
|
inline |
Definition at line 186 of file write_pool.h.
|
inline |
Definition at line 197 of file write_pool.h.
Referenced by stxxl::prefetch_pool< BlockType >::hint(), and stxxl::prefetch_pool< BlockType >::read().
|
inline |
Resizes size of the pool.
| new_size | new size of the pool after the call |
Definition at line 168 of file write_pool.h.
References STXXL_VERBOSE_WPOOL.
|
inline |
Returns number of owned blocks.
Definition at line 108 of file write_pool.h.
|
inline |
Take out a block from the pool.
Definition at line 139 of file write_pool.h.
References STXXL_ASSERT, STXXL_VERBOSE_WPOOL, and stxxl::wait_any().
|
inline |
Definition at line 207 of file write_pool.h.
|
inline |
Definition at line 224 of file write_pool.h.
References STXXL_VERBOSE_WPOOL.
Referenced by stxxl::prefetch_pool< BlockType >::hint(), and stxxl::prefetch_pool< BlockType >::read().
|
inline |
Definition at line 73 of file write_pool.h.
References stxxl::write_pool< BlockType >::busy_blocks, and stxxl::write_pool< BlockType >::free_blocks.
|
inline |
Passes a block to the pool for writing.
| block | block to write. Ownership of the block goes to the pool. block must be allocated dynamically with using new . |
| bid | location, where to write |
block must be allocated dynamically with using new . Definition at line 116 of file write_pool.h.
References STXXL_VERBOSE_WPOOL.
|
protected |
Definition at line 59 of file write_pool.h.
Referenced by stxxl::write_pool< BlockType >::swap().
|
protected |
Definition at line 57 of file write_pool.h.
Referenced by stxxl::write_pool< BlockType >::swap().