Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::TDynamicBuffer< Alloc > Class Template Reference

Template for creating a dynamic buffer using an allocator. More...

#include <TDynamicBuffer.h>

Public Member Functions

 TDynamicBuffer ()
 Default constructor.
 
 TDynamicBuffer (const TDynamicBuffer &db)
 Copy constructor.
 
 TDynamicBuffer (size_t sz)
 Initializing constructor.
 
 ~TDynamicBuffer ()
 Destructor.
 
void reserve (size_t sz, bool shrink=false)
 Reserves the array but does leave the data in tact.
 
void resize (size_t sz, bool shrink=false)
 Resizes the array but does leave the data in tact.
 
void offset (size_t ofs)
 Sets an virtual offset to the buffer.
 
size_t offset () const
 Returns the current offset.
 
size_t size ()
 Returns the byte size of the buffer.
 
size_t size () const
 Returns the byte size of the buffer.
 
size_t reserved () const
 Gets the reserved size of this instance.
 
void * data ()
 Gets a void pointer to the start of the buffer.
 
const void * data () const
 
char * c_str ()
 Gets a character pointer to the start of the buffer.
 
const char * c_str () const
 Gets a const character pointer to the start of the buffer.
 
template<typename T >
T * ptr (size_t offset=0)
 Gets a typed pointer to the specified given offset the start of the buffer.
 
template<typename T >
const T * ptr (size_t offset=0) const
 Gets a typed pointer to the specified given offset the start of the buffer.
 
void grow (size_t sz)
 Grows the array to the specified size but keeps the current data intact.
 
void zero (bool reserved=false)
 
void set (int c=0, bool reserved=false)
 Sets all memory to the given character. When reserved is true not only the current size but all of it.
 
void * data (size_t offset)
 Gets a void pointer with a byte offset from the start.
 
const void * data (size_t offset) const
 Gets a const void pointer with a byte offset from the start.
 
 operator void * ()
 Cast operator to void pointer.
 
 operator const char * () const
 Const cast operators to pointer.
 
 operator char * ()
 Cast operator to a character pointer.
 
 operator const void * () const
 Const cast operator to void pointer.
 
char & operator[] (size_t i)
 Character array operator to access a single byte element.
 
char operator[] (size_t i) const
 Const character array operator to access a single byte element.
 
TDynamicBufferoperator= (const TDynamicBuffer &db)
 Assignment operators.
 

Detailed Description

template<typename Alloc = Allocator>
class sf::TDynamicBuffer< Alloc >

Template for creating a dynamic buffer using an allocator.

Template Parameters
AllocAllocator type.

Constructor & Destructor Documentation

◆ TDynamicBuffer() [1/3]

template<class Alloc >
sf::TDynamicBuffer< Alloc >::TDynamicBuffer ( )

Default constructor.

◆ TDynamicBuffer() [2/3]

template<class Alloc >
sf::TDynamicBuffer< Alloc >::TDynamicBuffer ( const TDynamicBuffer< Alloc > &  db)
inline

Copy constructor.

◆ TDynamicBuffer() [3/3]

template<class Alloc >
sf::TDynamicBuffer< Alloc >::TDynamicBuffer ( size_t  sz)
explicit

Initializing constructor.

◆ ~TDynamicBuffer()

template<class Alloc >
sf::TDynamicBuffer< Alloc >::~TDynamicBuffer ( )
inline

Destructor.

Member Function Documentation

◆ c_str() [1/2]

template<class Alloc >
char * sf::TDynamicBuffer< Alloc >::c_str ( )
inline

Gets a character pointer to the start of the buffer.

◆ c_str() [2/2]

template<class Alloc >
const char * sf::TDynamicBuffer< Alloc >::c_str ( ) const
inline

Gets a const character pointer to the start of the buffer.

◆ data() [1/4]

template<class Alloc >
void * sf::TDynamicBuffer< Alloc >::data ( )
inline

Gets a void pointer to the start of the buffer.

◆ data() [2/4]

template<class Alloc >
const void * sf::TDynamicBuffer< Alloc >::data ( ) const
inline

Returns a const pointer to the start of the buffer.

◆ data() [3/4]

template<class Alloc >
void * sf::TDynamicBuffer< Alloc >::data ( size_t  offset)
inline

Gets a void pointer with a byte offset from the start.

◆ data() [4/4]

template<class Alloc >
const void * sf::TDynamicBuffer< Alloc >::data ( size_t  offset) const
inline

Gets a const void pointer with a byte offset from the start.

◆ grow()

template<class Alloc >
void sf::TDynamicBuffer< Alloc >::grow ( size_t  sz)

Grows the array to the specified size but keeps the current data intact.

◆ offset() [1/2]

template<class Alloc >
size_t sf::TDynamicBuffer< Alloc >::offset ( ) const
inline

Returns the current offset.

◆ offset() [2/2]

template<class Alloc >
void sf::TDynamicBuffer< Alloc >::offset ( size_t  ofs)
inline

Sets an virtual offset to the buffer.

◆ operator char *()

template<class Alloc >
sf::TDynamicBuffer< Alloc >::operator char * ( )
inlineexplicit

Cast operator to a character pointer.

◆ operator const char *()

template<class Alloc >
sf::TDynamicBuffer< Alloc >::operator const char * ( ) const
inlineexplicit

Const cast operators to pointer.

◆ operator const void *()

template<class Alloc >
sf::TDynamicBuffer< Alloc >::operator const void * ( ) const
inlineexplicit

Const cast operator to void pointer.

◆ operator void *()

template<class Alloc >
sf::TDynamicBuffer< Alloc >::operator void * ( )
inlineexplicit

Cast operator to void pointer.

◆ operator=()

template<class Alloc >
TDynamicBuffer< Alloc > & sf::TDynamicBuffer< Alloc >::operator= ( const TDynamicBuffer< Alloc > &  db)

Assignment operators.

◆ operator[]() [1/2]

template<class Alloc >
char & sf::TDynamicBuffer< Alloc >::operator[] ( size_t  i)
inline

Character array operator to access a single byte element.

◆ operator[]() [2/2]

template<class Alloc >
char sf::TDynamicBuffer< Alloc >::operator[] ( size_t  i) const
inline

Const character array operator to access a single byte element.

◆ ptr() [1/2]

template<typename Alloc = Allocator>
template<typename T >
T * sf::TDynamicBuffer< Alloc >::ptr ( size_t  offset = 0)
inline

Gets a typed pointer to the specified given offset the start of the buffer.

◆ ptr() [2/2]

template<typename Alloc = Allocator>
template<typename T >
const T * sf::TDynamicBuffer< Alloc >::ptr ( size_t  offset = 0) const
inline

Gets a typed pointer to the specified given offset the start of the buffer.

◆ reserve()

template<class Alloc >
void sf::TDynamicBuffer< Alloc >::reserve ( size_t  sz,
bool  shrink = false 
)

Reserves the array but does leave the data in tact.

◆ reserved()

template<class Alloc >
size_t sf::TDynamicBuffer< Alloc >::reserved ( ) const
inline

Gets the reserved size of this instance.

◆ resize()

template<class Alloc >
void sf::TDynamicBuffer< Alloc >::resize ( size_t  sz,
bool  shrink = false 
)

Resizes the array but does leave the data in tact.

Parameters
szWhen 0 and shrink is true the underlying buffer is freed.
shrink

◆ set()

template<class Alloc >
void sf::TDynamicBuffer< Alloc >::set ( int  c = 0,
bool  reserved = false 
)
inline

Sets all memory to the given character. When reserved is true not only the current size but all of it.

◆ size() [1/2]

template<class Alloc >
size_t sf::TDynamicBuffer< Alloc >::size ( )
inline

Returns the byte size of the buffer.

◆ size() [2/2]

template<class Alloc >
size_t sf::TDynamicBuffer< Alloc >::size ( ) const
inline

Returns the byte size of the buffer.

◆ zero()

template<class Alloc >
void sf::TDynamicBuffer< Alloc >::zero ( bool  reserved = false)
inline

Zeros all current memory size or all reserved.


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