cds  1.4.0
Data Structures | Public Types | Public Member Functions
cds::opt::v::dynamic_buffer< T, Alloc > Class Template Reference

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_typeoperator[] (size_t i)
 Get item i.
 
const value_typeoperator[] (size_t i) const
 Get item i, const version.
 
size_t capacity () const noexcept()
 Returns buffer capacity.
 
void zeroize ()
 Zeroize the buffer.
 
value_typebuffer ()
 Returns pointer to buffer array.
 
value_typebuffer () const
 Returns pointer to buffer array (const version)
 

Detailed Description

template<typename T, class Alloc = CDS_DEFAULT_ALLOCATOR>
class cds::opt::v::dynamic_buffer< T, Alloc >

Dynamically allocated buffer.

One of available opt::buffer type-option.

This buffer maintains dynamically allocated array. Allocation is performed at construction time.

Template parameters:
  • T - item type storing in the buffer
  • Alloc - an allocator used for allocating internal buffer (std::allocator interface)

Constructor & Destructor Documentation

template<typename T , class Alloc = CDS_DEFAULT_ALLOCATOR>
cds::opt::v::dynamic_buffer< T, Alloc >::dynamic_buffer ( size_t  nCapacity)
inline

Allocates dynamic buffer of given nCapacity.

nCapacity must be power of two.


The documentation for this class was generated from the following file:

cds 1.4.0 Developed by Maxim Khiszinsky aka khizmax 2007 - 2012
Autogenerated Mon May 20 2013 00:38:01 by Doxygen 1.8.3.1