Table
Table<T> is a templated storage container for storing the assorted tabulated data. It can handle any type T of values. Boolean type values internally stored as integers.
The data inside of the Table container is manipulated using a number of dedicated methods:
Constructors
cppTable()Default constructor. Constructs empty table.
cppTable(const Table<T>& rhs)Copy constructor. Initializes current container with a copy of
rhs.
cppTable(const size_t N, const size_t M)Constructor. Allocates internal storage to the specified dimensions
(N,M).
cppvoid Allocate(const size_t N, const size_t M)Allocates internal storage to the specified table dimensions
(N,M).
cppvoid Reallocate(const size_t N, const size_t M)Reallocates internal storage to new dimensions
(N,M). Previously stored data is erased.
Data access and manipulation
cppT const& operator()(const size_t n, const size_t m) constOne-directional access operator. Returns constant reference to the table element
(n,m).
cppT& operator()(const size_t n, const size_t m)Bi-directional access operator. Returns reference to the table element
(n,m).
cppvoid set(const size_t n, const size_t m, const T value)Sets
Tableelement(n,m)to the specifiedvalue.
cppvoid set_to_value(const T value)Sets all table elements to the specified
value.
cppT get(const size_t n, const size_t m) constReturns the value of
Tableelement(n,m).
cppTable<T>& operator=(const Table<T>& rhs)Assignment operator, assumes equal dimension tables for receiving container and
rhs, or empty receiving container which before assignment. Does not check dimensions.
Container properties
cppsize_t sizeN() constReturns first dimension of the stored table
cppsize_t sizeM() constReturns the second dimension of the stored table.
cppbool IsNotAllocated() constReturns true if
Tableis not allocated (internal storage size is zero).
cppbool IsAllocated() constReturns true if
Tableis allocated (internal storage size is not zero).