|
cds
1.4.0
|
Dynamically allocated buffer. More...
#include <cds/opt/buffer.h>
Data Structures | |
| struct | rebind |
| Rebind buffer for other template parameters. More... | |
Public Types | |
| typedef T | value_type |
| Value type. | |
Public Member Functions | |
| dynamic_buffer (size_t nCapacity) | |
Allocates dynamic buffer of given nCapacity. More... | |
| ~dynamic_buffer () | |
| Destroys dynamically allocated buffer. | |
| value_type & | operator[] (size_t i) |
Get item i. | |
| const value_type & | operator[] (size_t i) const |
Get item i, const version. | |
| size_t | capacity () const noexcept() |
| Returns buffer capacity. | |
| void | zeroize () |
| Zeroize the buffer. | |
| value_type * | buffer () |
| Returns pointer to buffer array. | |
| value_type * | buffer () const |
| Returns pointer to buffer array (const version) | |
Dynamically allocated buffer.
One of available opt::buffer type-option.
This buffer maintains dynamically allocated array. Allocation is performed at construction time.
T - item type storing in the buffer Alloc - an allocator used for allocating internal buffer (std::allocator interface)
|
inline |
Allocates dynamic buffer of given nCapacity.
nCapacity must be power of two.