|
cds
1.4.0
|
Static buffer (opt::buffer option) 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 | |
| static_buffer () | |
| Construct static buffer. | |
| static_buffer (size_t nCapacity) | |
| Construct buffer of given capacity. More... | |
| value_type & | operator[] (size_t i) |
Get item i. | |
| const value_type & | operator[] (size_t i) const |
Get item i, const version. | |
| constexpr 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) | |
Static Public Attributes | |
| static const size_t | c_nCapacity = Capacity |
| Capacity. | |
Static buffer (opt::buffer option)
One of available type for opt::buffer type-option.
This buffer maintains static array. No dynamic memory allocation performed.
T - item type the buffer stores Capacity - the capacity of buffer. The value must be power of two.
|
inline |
Construct buffer of given capacity.
This ctor ignores nCapacity argument. The capacity of static buffer is defined by template argument Capacity