![]() |
TBTK
|
Need a break? Support the development by playing Polarity Puzzles |
Container for a C style array. More...
#include <CArray.h>
Public Member Functions | |
| CArray () | |
| CArray (unsigned int size) | |
| CArray (const CArray &carray) | |
| CArray (CArray &&carray) | |
| CArray (const std::string &serialization, Serializable::Mode mode) | |
| ~CArray () | |
| CArray & | operator= (const CArray &carray) |
| CArray & | operator= (CArray &&carray) |
| DataType & | operator[] (unsigned int n) |
| const DataType & | operator[] (unsigned int n) const |
| DataType * | getData () |
| const DataType * | getData () const |
| unsigned int | getSize () const |
| std::string | serialize (Serializable::Mode mode) const |
Container for a C style array.
The CArray contains a pointer to an array and its size. It provides the same efficiency as a raw array, but without requiring manual memory management.
| TBTK::CArray< DataType >::CArray |
Constructor.
| TBTK::CArray< DataType >::CArray | ( | unsigned int | size | ) |
Constructor.
| size | The size of the array. |
| TBTK::CArray< DataType >::CArray | ( | const CArray< DataType > & | carray | ) |
Copy constructor.
| carray | The carray to copy. |
| TBTK::CArray< DataType >::CArray | ( | CArray< DataType > && | carray | ) |
Move constructor.
| carray | The carray to move. |
| TBTK::CArray< DataType >::CArray | ( | const std::string & | serialization, |
| Serializable::Mode | mode | ||
| ) |
| TBTK::CArray< DataType >::~CArray |
Destructor.
| const DataType * TBTK::CArray< DataType >::getData |
Get the data as a bare c-array.
| const DataType* TBTK::CArray< DataType >::getData | ( | ) | const |
Get the data as a bare c-array.
| unsigned int TBTK::CArray< DataType >::getSize |
Get size.
| CArray< DataType > & TBTK::CArray< DataType >::operator= | ( | CArray< DataType > && | carray | ) |
Move assignment operator.
| rhs | The right hand side of the expression. |
| CArray< DataType > & TBTK::CArray< DataType >::operator= | ( | const CArray< DataType > & | carray | ) |
Assignment operator.
| rhs | The right hand side of the expression. |
| DataType & TBTK::CArray< DataType >::operator[] | ( | unsigned int | n | ) |
Array subscript operator.
| n | Position to get the value for. |
| const DataType & TBTK::CArray< DataType >::operator[] | ( | unsigned int | n | ) | const |
Array subscript operator.
| n | Position to get the value for. |
| std::string TBTK::CArray< DataType >::serialize | ( | Serializable::Mode | mode | ) | const |
Serialize the CArray. Note that CArray is pseudo-Serializable in that it implements Serializable interface, but does so non-virtually.
| mode | Serialization mode to use. |