Tool Libs
UMIT-TIROL Institute of Automation and Control Engineering library collection
 
Loading...
Searching...
No Matches
Buffer< T > Struct Template Reference

dynamically allocated, but fixed-size buffer template More...

#include <buffer.h>

Public Member Functions

 operator T* ()
 implicit cast to pointer to T
 
T & at (size_t ix)
 access into known length of buffer
 
T & operator[] (size_t ix)
 access into known size of buffer
 
T & operator[] (size_t ix) const
 access into known size of buffer
 
Bufferappend (T b)
 simple append single item
 
Bufferappend (std::initializer_list< T > list)
 append multiple items
 
T * begin ()
 begin method for range-based for loops
 
T * end ()
 end method for range-based for loops
 
 ~Buffer ()
 destructor
 
 Buffer (const T *src, size_t len, size_t sz=0)
 copy from naked array with known length
 
 Buffer (std::initializer_list< T > list)
 initializer list constructor
 
 Buffer (size_t sz=0)
 constructor with fixed size
 
 Buffer (const Buffer &b)
 copy constructor
 
Bufferoperator= (const Buffer &b)
 copy assignment operator
 
 Buffer (Buffer &&b) noexcept
 move constructor
 
Bufferoperator= (Buffer &&b) noexcept
 move assignment operator
 

Public Attributes

size_t len
 number of items stored in buffer
 
size_t size
 total capacity of buffer
 

Detailed Description

template<typename T>
struct Buffer< T >

dynamically allocated, but fixed-size buffer template

keeps track of the number of items stored, and of allocated size provides both copy & move semantics


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