92template<
class TYPE>
void
105template<
class TYPE>
void
120 for (i = 0; i < columnNames.
Size(); i++)
127 for (i = 0; i < rowNames.
Size(); i++)
137template<
class TYPE>
void
150template<
class TYPE>
void
154 TableEntry& entry = this->tableEntires.At(colIndex, rowIndex);
158 for (i = 0; i < numElms; i++)
168template<
class TYPE>
void
172 n_assert((refColIndex <= colIndex) && (refRowIndex <= rowIndex));
180template<
class TYPE>
void
192template<
class TYPE>
void
202template<
class TYPE>
SizeT
211template<
class TYPE>
SizeT
220template<
class TYPE>
bool
229template<
class TYPE>
bool
238template<
class TYPE>
IndexT
247template<
class TYPE>
IndexT
256template<
class TYPE>
const TYPE*
276template<
class TYPE>
const TYPE*
281 return this->
GetElements(colIndex, rowIndex, outNumElements);
Nebula's dynamic array class.
Definition array.h:60
const SizeT Size() const
get number of elements in array
Definition array.h:880
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
A fixed-size 2-dimensional array.
Definition fixedtable.h:18
SizeT GetNumRows() const
get number of rows in the sparse table
Definition sparsetable.h:212
bool inSetup
Definition sparsetable.h:76
bool HasColumn(const StringAtom &colName) const
return true if column exists
Definition sparsetable.h:221
const TYPE * LookupElements(const StringAtom &colName, const StringAtom &rowName, SizeT &outNumElements) const
lookup entry by row/column names
Definition sparsetable.h:277
Dictionary< StringAtom, IndexT > rowIndexMap
Definition sparsetable.h:75
SparseTable()
constructor
Definition sparsetable.h:83
Array< TYPE > uniqueElements
Definition sparsetable.h:72
void AddSingle(IndexT colIndex, IndexT rowIndex, const TYPE &elm)
add a single new unique entry
Definition sparsetable.h:138
Dictionary< StringAtom, IndexT > colIndexMap
Definition sparsetable.h:74
FixedTable< TableEntry > tableEntries
Definition sparsetable.h:73
void BeginSetup(const Array< StringAtom > &columnNames, const Array< StringAtom > &rowNames, SizeT numUnique=0)
setup the sparse table
Definition sparsetable.h:106
void AddMultiple(IndexT colIndex, IndexT rowIndex, const TYPE *firstElm, SizeT numElements)
add a new multiple entry
Definition sparsetable.h:151
IndexT GetRowIndexByName(const StringAtom &rowName) const
return row index by name
Definition sparsetable.h:248
void AddReference(IndexT colIndex, IndexT rowIndex, IndexT refColIndex, IndexT refRowIndex)
add a reference to another column/index
Definition sparsetable.h:169
void SetEntryDirect(IndexT colIndex, IndexT rowIndex, ushort startIndex, ushort numElements)
add a direct reference using an index into the unique element array
Definition sparsetable.h:181
bool HasRow(const StringAtom &rowName) const
return true if row exists
Definition sparsetable.h:230
IndexT GetColumnIndexByName(const StringAtom &colName) const
return column index by name
Definition sparsetable.h:239
void EndSetup()
finish setting up the sparse table
Definition sparsetable.h:193
const TYPE * GetElements(IndexT colIndex, IndexT rowIndex, SizeT &outNumElements) const
get entry at given index
Definition sparsetable.h:257
SizeT GetNumColumns() const
get number of columns in the sparse table
Definition sparsetable.h:203
void Clear()
clear object
Definition sparsetable.h:93
SizeT GetNumUniqueElements() const
get current number of unique elements
A StringAtom.
Definition stringatom.h:22
#define n_assert(exp)
Definition debug.h:50
A pinned array is an array which manages its own virtual memory.
Definition String.cs:6
a table entry in the sparse table
Definition sparsetable.h:65
ushort startIndex
Definition sparsetable.h:68
TableEntry()
Definition sparsetable.h:66
ushort numElements
Definition sparsetable.h:69
int SizeT
Definition types.h:49
unsigned short ushort
Definition types.h:32
int IndexT
Definition types.h:48