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

A dynamic buffer as typed array. Has range check on any index. More...

#include <TDynamicArray.h>

Collaboration diagram for sf::TDynamicArray< T, Alloc >:

Public Member Functions

 TDynamicArray ()=default
 Default constructor.
 
 TDynamicArray (const TDynamicBuffer< Alloc > &buf)
 Dynamic array constructor.
 
 TDynamicArray (size_t sz)
 Initialization constructor.
 
size_t count () const
 Returns the size of the array.
 
size_t size () const
 Returns the size of the array.
 
void * data ()
 Returns a typed pointer to the start of the array.
 
T & operator[] (size_t i)
 Returns reference of the specified index.
 
 operator T* ()
 Returns a typed pointer to the start of the array.
 
 operator T* () const
 Returns a typed pointer to the start of the array.
 
 operator const void * () const
 Returns a typed pointer to the start of the array.
 
 operator void * ()
 Returns a typed pointer to the start of the array.
 
void resize (size_t sz, bool shrink=false)
 Resizes the array but does leave the data in tact.
 
void grow (size_t sz)
 Grows the array to the specified size but keeps the current data intact.
 
void zero ()
 Zeroes all data.
 
 operator TDynamicBuffer< Alloc > ()
 Cast operator the TDynamic buffer.
 
TDynamicBuffer< Alloc > & getBuffer ()
 Gets access to the underlying buffer.
 

Protected Attributes

TDynamicBuffer< Alloc > _buffer
 Holds the underlying storage buffer.
 

Detailed Description

template<typename T, typename Alloc = Allocator>
class sf::TDynamicArray< T, Alloc >

A dynamic buffer as typed array. Has range check on any index.

See also
sf::TDynamicBuffer

Constructor & Destructor Documentation

◆ TDynamicArray() [1/3]

template<typename T , typename Alloc = Allocator>
sf::TDynamicArray< T, Alloc >::TDynamicArray ( )
default

Default constructor.

◆ TDynamicArray() [2/3]

template<typename T , typename Alloc = Allocator>
sf::TDynamicArray< T, Alloc >::TDynamicArray ( const TDynamicBuffer< Alloc > &  buf)
inlineexplicit

Dynamic array constructor.

◆ TDynamicArray() [3/3]

template<typename T , typename Alloc = Allocator>
sf::TDynamicArray< T, Alloc >::TDynamicArray ( size_t  sz)
inlineexplicit

Initialization constructor.

Member Function Documentation

◆ count()

template<typename T , typename Alloc = Allocator>
size_t sf::TDynamicArray< T, Alloc >::count ( ) const
inline

Returns the size of the array.

◆ data()

template<typename T , typename Alloc = Allocator>
void * sf::TDynamicArray< T, Alloc >::data ( )
inline

Returns a typed pointer to the start of the array.

◆ getBuffer()

template<typename T , typename Alloc = Allocator>
TDynamicBuffer< Alloc > & sf::TDynamicArray< T, Alloc >::getBuffer ( )
inline

Gets access to the underlying buffer.

◆ grow()

template<typename T , typename Alloc = Allocator>
void sf::TDynamicArray< T, Alloc >::grow ( size_t  sz)
inline

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

◆ operator const void *()

template<typename T , typename Alloc = Allocator>
sf::TDynamicArray< T, Alloc >::operator const void * ( ) const
inline

Returns a typed pointer to the start of the array.

◆ operator T*() [1/2]

template<typename T , typename Alloc = Allocator>
sf::TDynamicArray< T, Alloc >::operator T* ( )
inlineexplicit

Returns a typed pointer to the start of the array.

◆ operator T*() [2/2]

template<typename T , typename Alloc = Allocator>
sf::TDynamicArray< T, Alloc >::operator T* ( ) const
inlineexplicit

Returns a typed pointer to the start of the array.

◆ operator TDynamicBuffer< Alloc >()

template<typename T , typename Alloc = Allocator>
sf::TDynamicArray< T, Alloc >::operator TDynamicBuffer< Alloc > ( )
inlineexplicit

Cast operator the TDynamic buffer.

◆ operator void *()

template<typename T , typename Alloc = Allocator>
sf::TDynamicArray< T, Alloc >::operator void * ( )
inline

Returns a typed pointer to the start of the array.

◆ operator[]()

template<typename T , typename Alloc = Allocator>
T & sf::TDynamicArray< T, Alloc >::operator[] ( size_t  i)
inline

Returns reference of the specified index.

◆ resize()

template<typename T , typename Alloc = Allocator>
void sf::TDynamicArray< T, Alloc >::resize ( size_t  sz,
bool  shrink = false 
)
inline

Resizes the array but does leave the data in tact.

See also
#sf::TDynamicBuffer::resize()

◆ size()

template<typename T , typename Alloc = Allocator>
size_t sf::TDynamicArray< T, Alloc >::size ( ) const
inline

Returns the size of the array.

◆ zero()

template<typename T , typename Alloc = Allocator>
void sf::TDynamicArray< T, Alloc >::zero ( )
inline

Zeroes all data.

Member Data Documentation

◆ _buffer

template<typename T , typename Alloc = Allocator>
TDynamicBuffer<Alloc> sf::TDynamicArray< T, Alloc >::_buffer
protected

Holds the underlying storage buffer.


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