25 #include <queso/Defines.h>
26 #include <queso/2dArrayOfStuff.h>
35 m_data (m_numRows,NULL)
37 for (
unsigned int i = 0; i <
m_numRows; ++i) {
46 for (
unsigned int i = 0; i < m_numRows; ++i) {
47 for (
unsigned int j = 0; j < m_numCols; ++j) {
48 if ((*(m_data[i]))[j] != NULL)
delete (*(m_data[i]))[j];
70 queso_require_msg(!((i >= m_numRows) || (j >= m_numCols) || (m_data[i] == NULL)),
"invalid situation");
71 (*(m_data[i]))[j] = info;
80 queso_require_less(i, m_numRows);
81 queso_require_less(j, m_numCols);
82 queso_require(m_data[i]);
83 queso_require((*m_data[i])[j]);
85 return *(*(m_data[i]))[j];
92 queso_require_less(i, m_numRows);
93 queso_require_less(j, m_numCols);
94 queso_require(m_data[i]);
95 queso_require((*m_data[i])[j]);
97 return *(*(m_data[i]))[j];
void setLocation(unsigned int i, unsigned int j, T *info)
Sets the data in a specific location.
unsigned int numCols() const
Number of columns in the array.
unsigned int numRows() const
Number of rows in the array.
TwoDArray(unsigned int numRows, unsigned int numCols)
Default constructor.
std::vector< std::vector< T * > * > m_data
T & operator()(unsigned int i, unsigned int j)
Returns data stored in a specific location (non-const).