SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DataStructures::Table Class Reference

Holds a set of columns, a set of rows, and rows times columns cells. More...

`#include <slikenet/DS_Table.h>`

## Classes

struct | Cell
| Holds the actual data in the table. More...
struct | ColumnDescriptor
struct | FilterQuery
struct | Row
| Stores the list of cells for this row, and a special flag used for internal sorting. More...
struct | SortQuery

## Public Types

enum | ColumnType { NUMERIC, STRING, BINARY, POINTER }
enum | FilterQueryType { QF_EQUAL, QF_NOT_EQUAL, QF_GREATER_THAN, QF_GREATER_THAN_EQ, QF_LESS_THAN, QF_LESS_THAN_EQ, QF_IS_EMPTY, QF_NOT_EMPTY }
enum | SortQueryType { QS_INCREASING_ORDER, QS_DECREASING_ORDER }
| Increasing or decreasing sort order. More...

## Public Member Functions

| Table ()
| ~Table ()
unsigned | AddColumn (const char columnName[_TABLE_MAX_COLUMN_NAME_LENGTH], ColumnType columnType)
| Adds a column to the table.
void | RemoveColumn (unsigned columnIndex)
| Removes a column by index.
unsigned | ColumnIndex (char columnName[_TABLE_MAX_COLUMN_NAME_LENGTH]) const
| Gets the index of a column by name.
unsigned | ColumnIndex (const char *columnName) const
char * | ColumnName (unsigned index) const
| Gives the string name of the column at a certain index.
ColumnType | GetColumnType (unsigned index) const
| Returns the type of a column, referenced by index.
unsigned | GetColumnCount (void) const
unsigned | GetRowCount (void) const
Table::Row * | AddRow (unsigned rowId)
| Adds a row to the table.
Table::Row * | AddRow (unsigned rowId, DataStructures::List< Cell > &initialCellValues)
Table::Row * | AddRow (unsigned rowId, DataStructures::List< Cell * > &initialCellValues, bool copyCells=false)
bool | RemoveRow (unsigned rowId)
| Removes a row specified by rowId.
void | RemoveRows (Table *tableContainingRowIDs)
| Removes all the rows with IDs that the specified table also has.
bool | UpdateCell (unsigned rowId, unsigned columnIndex, int value)
| Updates a particular cell in the table.
bool | UpdateCell (unsigned rowId, unsigned columnIndex, char *str)
bool | UpdateCell (unsigned rowId, unsigned columnIndex, int byteLength, char *data)
bool | UpdateCellByIndex (unsigned rowIndex, unsigned columnIndex, int value)
bool | UpdateCellByIndex (unsigned rowIndex, unsigned columnIndex, char *str)
bool | UpdateCellByIndex (unsigned rowIndex, unsigned columnIndex, int byteLength, char *data)
void | GetCellValueByIndex (unsigned rowIndex, unsigned columnIndex, int *output)
| Note this is much less efficient to call than GetRow, then working with the cells directly. Numeric, string, binary.
void | GetCellValueByIndex (unsigned rowIndex, unsigned columnIndex, char *output)
void | GetCellValueByIndex (unsigned rowIndex, unsigned columnIndex, char *output, size_t outputLength)
void | GetCellValueByIndex (unsigned rowIndex, unsigned columnIndex, char *output, int *outputLength)
Row * | GetRowByID (unsigned rowId) const
| Gets a row. More efficient to do this and access Row::cells than to repeatedly call GetCell. You can also update cells in rows from this function.
Row * | GetRowByIndex (unsigned rowIndex, unsigned *key) const
| Gets a row at a specific index. rowIndex should be less than GetRowCount()
void | QueryTable (unsigned *columnIndicesSubset, unsigned numColumnSubset, FilterQuery *inclusionFilters, unsigned numInclusionFilters, unsigned *rowIds, unsigned numRowIDs, Table *result)
| Queries the table, optionally returning only a subset of columns and rows.
void | SortTable (Table::SortQuery *sortQueries, unsigned numSortQueries, Table::Row **out)
| Sorts the table by rows.
void | Clear (void)
| Frees all memory in the table.
void | PrintColumnHeaders (char *out, int outLength, char columnDelineator) const
| Prints out the names of all the columns.
void | PrintRow (char *out, int outLength, char columnDelineator, bool printDelineatorForBinary, Table::Row *inputRow) const
| Writes a text representation of the row to out.
const DataStructures::List < ColumnDescriptor > & | GetColumns (void) const
| Direct access to make things easier.
const DataStructures::BPlusTree < unsigned, Row *, _TABLE_BPLUS_TREE_ORDER > & | GetRows (void) const
| Direct access to make things easier.
DataStructures::Page< unsigned, Row *, _TABLE_BPLUS_TREE_ORDER > * | GetListHead (void)
| Get the head of a linked list containing all the row data.
unsigned | GetAvailableRowId (void) const
| Get the first free row id. This could be made more efficient.
Table & | operator= (const Table &input)

## Protected Member Functions

Table::Row * | AddRowColumns (unsigned rowId, Row *row, DataStructures::List< unsigned > columnIndices)
void | DeleteRow (Row *row)
void | QueryRow (DataStructures::List< unsigned > &inclusionFilterColumnIndices, DataStructures::List< unsigned > &columnIndicesToReturn, unsigned key, Table::Row *row, FilterQuery *inclusionFilters, Table *result)

## Protected Attributes

DataStructures::BPlusTree < unsigned, Row *, _TABLE_BPLUS_TREE_ORDER > | rows
DataStructures::List < ColumnDescriptor > | columns

## Detailed Description

Holds a set of columns, a set of rows, and rows times columns cells.

The table data structure is useful if you want to store a set of structures and perform queries on those structures.
This is a relatively simple and fast implementation of the types of tables commonly used in databases.
See TableSerializer to serialize data members of the table.
See LightweightDatabaseClient and LightweightDatabaseServer to transmit the table over the network.

Definition at line 42 of file DS_Table.h.

## Class Documentation

struct DataStructures::Table::SortQuery

Definition at line 178 of file DS_Table.h.

Class Members
unsigned | columnIndex | The index of the table column we are sorting on.
SortQueryType | operation | See SortQueryType.

## Member Enumeration Documentation

enum DataStructures::Table::ColumnType

Enumerator:

  NUMERIC |
  STRING |
  BINARY |
  POINTER |

Definition at line 46 of file DS_Table.h.

enum DataStructures::Table::FilterQueryType

Enumerator:

  QF_EQUAL |
  QF_NOT_EQUAL |
  QF_GREATER_THAN |
  QF_GREATER_THAN_EQ |
  QF_LESS_THAN |
  QF_LESS_THAN_EQ |
  QF_IS_EMPTY |
  QF_NOT_EMPTY |

Definition at line 142 of file DS_Table.h.

enum DataStructures::Table::SortQueryType

Increasing or decreasing sort order.

Enumerator:

  QS_INCREASING_ORDER |
  QS_DECREASING_ORDER |

Definition at line 170 of file DS_Table.h.

## Constructor & Destructor Documentation

Table::Table | ( |  | ) |

Definition at line 284 of file DS_Table.cpp.

Table::~Table | ( |  | ) |

Definition at line 287 of file DS_Table.cpp.

References Clear().

## Member Function Documentation

unsigned Table::AddColumn | ( | const char | columnName[_TABLE_MAX_COLUMN_NAME_LENGTH],
|  | ColumnType | columnType
| ) |  |

Adds a column to the table.

Parameters

  [in] | columnName | The name of the column
  [in] | columnType | What type of data this column will hold

Returns
  The index of the new column

Definition at line 291 of file DS_Table.cpp.

References _FILE_AND_LINE_, columns, ExtendRows(), DataStructures::BPlusTree< KeyType, DataType, order >::ForEachData(), DataStructures::List< list_type >::Insert(), rows, and DataStructures::List< list_type >::Size().

Referenced by SLNet::TableSerializer::DeserializeColumns(), operator=(), and QueryTable().

Table::Row * Table::AddRow | ( | unsigned | rowId | ) |

Adds a row to the table.

New rows are added with empty values for all cells. However, if you specify initialCelLValues you can specify initial values It's up to you to ensure that the values in the specific cells match the type of data used by that row rowId can be considered the primary key for the row. It is much faster to lookup a row by its rowId than by searching keys. rowId must be unique Rows are stored in sorted order in the table, using rowId as the sort key

Parameters

  [in] | rowId | The UNIQUE primary key for the row. This can never be changed.
  [in] | initialCellValues | Initial values to give the row (optional)

Returns
  The newly added row

Definition at line 359 of file DS_Table.cpp.

References _FILE_AND_LINE_, DataStructures::Table::Row::cells, columns, DataStructures::List< list_type >::Insert(), DataStructures::BPlusTree< KeyType, DataType, order >::Insert(), SLNet::OP_DELETE(), rows, and DataStructures::List< list_type >::Size().

Referenced by SLNet::TableSerializer::DeserializeRow(), and operator=().

Table::Row * Table::AddRow | ( | unsigned | rowId,
|  | DataStructures::List< Cell > & | initialCellValues
| ) |  |

Definition at line 373 of file DS_Table.cpp.

References _FILE_AND_LINE_, DataStructures::Table::Row::cells, columns, DataStructures::List< list_type >::Insert(), DataStructures::BPlusTree< KeyType, DataType, order >::Insert(), rows, DataStructures::Table::Cell::SetByType(), and DataStructures::List< list_type >::Size().

Table::Row * Table::AddRow | ( | unsigned | rowId,
|  | DataStructures::List< Cell * > & | initialCellValues,
|  | bool | copyCells = `false`
| ) |  |

Definition at line 392 of file DS_Table.cpp.

References _FILE_AND_LINE_, DataStructures::Table::Row::cells, columns, DataStructures::List< list_type >::Insert(), DataStructures::BPlusTree< KeyType, DataType, order >::Insert(), rows, and DataStructures::List< list_type >::Size().

Table::Row * Table::AddRowColumns | ( | unsigned | rowId,
|  | Row * | row,
|  | DataStructures::List< unsigned > | columnIndices
| ) |  |

protected

Definition at line 415 of file DS_Table.cpp.

References _FILE_AND_LINE_, DataStructures::Table::Row::cells, columns, DataStructures::List< list_type >::Insert(), DataStructures::BPlusTree< KeyType, DataType, order >::Insert(), rows, and DataStructures::List< list_type >::Size().

Referenced by QueryRow().

void Table::Clear | ( | void |  | ) |

Frees all memory in the table.

Definition at line 1073 of file DS_Table.cpp.

References _FILE_AND_LINE_, DataStructures::BPlusTree< KeyType, DataType, order >::Clear(), DataStructures::List< list_type >::Clear(), columns, DataStructures::BPlusTree< KeyType, DataType, order >::ForEachData(), FreeRow(), and rows.

Referenced by SLNet::TableSerializer::DeserializeColumns(), operator=(), QueryTable(), DataStructures::Table::Cell::Set(), DataStructures::Table::Cell::SetPtr(), DataStructures::Table::Cell::~Cell(), and ~Table().

unsigned Table::ColumnIndex | ( | char | columnName[_TABLE_MAX_COLUMN_NAME_LENGTH] | ) | const

Gets the index of a column by name.

Column indices are stored in the order they are added.

Parameters

  [in] | columnName | The name of the column

Returns
  The index of the column, or (unsigned)-1 if no such column

Definition at line 333 of file DS_Table.cpp.

Referenced by QueryTable().

unsigned Table::ColumnIndex | ( | const char * | columnName | ) | const

Definition at line 325 of file DS_Table.cpp.

References columns, and DataStructures::List< list_type >::Size().

char * Table::ColumnName | ( | unsigned | index | ) | const

Gives the string name of the column at a certain index.

Parameters

  [in] | index | The index of the column

Returns
  The name of the column, or 0 if an invalid index

Definition at line 337 of file DS_Table.cpp.

References columns, and DataStructures::List< list_type >::Size().

Referenced by operator=().

void Table::DeleteRow | ( | Table::Row * | row | ) |

protected

Definition at line 1119 of file DS_Table.cpp.

References _FILE_AND_LINE_, DataStructures::Table::Row::cells, SLNet::OP_DELETE(), and DataStructures::List< list_type >::Size().

Referenced by RemoveRow().

unsigned Table::GetAvailableRowId | ( | void |  | ) | const

Get the first free row id. This could be made more efficient.

Definition at line 1091 of file DS_Table.cpp.

References DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, rows, and DataStructures::Page< KeyType, DataType, order >::size.

void Table::GetCellValueByIndex | ( | unsigned | rowIndex,
|  | unsigned | columnIndex,
|  | int * | output
| ) |  |

Note this is much less efficient to call than GetRow, then working with the cells directly. Numeric, string, binary.

Definition at line 534 of file DS_Table.cpp.

References DataStructures::Table::Row::cells, columns, DataStructures::List< list_type >::Get(), GetRowByIndex(), NUMERIC, and RakAssert.

void Table::GetCellValueByIndex | ( | unsigned | rowIndex,
|  | unsigned | columnIndex,
|  | char * | output
| ) |  |

Definition at line 544 of file DS_Table.cpp.

References DataStructures::Table::Row::cells, columns, DataStructures::List< list_type >::Get(), GetRowByIndex(), RakAssert, and STRING.

void Table::GetCellValueByIndex | ( | unsigned | rowIndex,
|  | unsigned | columnIndex,
|  | char * | output,
|  | size_t | outputLength
| ) |  |

Definition at line 554 of file DS_Table.cpp.

References DataStructures::Table::Row::cells, columns, DataStructures::List< list_type >::Get(), GetRowByIndex(), RakAssert, and STRING.

void Table::GetCellValueByIndex | ( | unsigned | rowIndex,
|  | unsigned | columnIndex,
|  | char * | output,
|  | int * | outputLength
| ) |  |

Definition at line 564 of file DS_Table.cpp.

References BINARY, DataStructures::Table::Row::cells, columns, DataStructures::List< list_type >::Get(), GetRowByIndex(), and RakAssert.

unsigned Table::GetColumnCount | ( | void |  | ) | const

Returns the number of columns

Returns
  The number of columns in the table

Definition at line 351 of file DS_Table.cpp.

References columns, and DataStructures::List< list_type >::Size().

Referenced by operator=().

const List< Table::ColumnDescriptor > & Table::GetColumns | ( | void |  | ) | const

Direct access to make things easier.

Definition at line 1079 of file DS_Table.cpp.

References columns.

Referenced by SLNet::TableSerializer::DeserializeRow(), SLNet::TableSerializer::SerializeColumns(), and SLNet::TableSerializer::SerializeTable().

Table::ColumnType Table::GetColumnType | ( | unsigned | index | ) | const

Returns the type of a column, referenced by index.

Parameters

  [in] | index | The index of the column

Returns
  The type of the column

Definition at line 344 of file DS_Table.cpp.

References columns, and DataStructures::List< list_type >::Size().

Referenced by operator=().

DataStructures::Page< unsigned, DataStructures::Table::Row *, _TABLE_BPLUS_TREE_ORDER > * Table::GetListHead | ( | void |  | ) |

Get the head of a linked list containing all the row data.

Definition at line 1087 of file DS_Table.cpp.

References DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), and rows.

Table::Row * Table::GetRowByID | ( | unsigned | rowId | ) | const

Gets a row. More efficient to do this and access Row::cells than to repeatedly call GetCell. You can also update cells in rows from this function.

Parameters

  [in] | rowId | The ID of the row

Returns
  The desired row, or 0 if no such row.

Definition at line 588 of file DS_Table.cpp.

References DataStructures::BPlusTree< KeyType, DataType, order >::Get(), and rows.

Referenced by UpdateCell().

Table::Row * Table::GetRowByIndex | ( | unsigned | rowIndex,
|  | unsigned * | key
| ) |  | const

Gets a row at a specific index. rowIndex should be less than GetRowCount()

Parameters

  [in] | rowIndex | The index of the row
  [out] | key | The ID of the row returned

Returns
  The desired row, or 0 if no such row.

Definition at line 596 of file DS_Table.cpp.

References DataStructures::Page< KeyType, DataType, order >::data, DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, rows, and DataStructures::Page< KeyType, DataType, order >::size.

Referenced by GetCellValueByIndex(), and UpdateCellByIndex().

unsigned Table::GetRowCount | ( | void |  | ) | const

Returns the number of rows

Returns
  The number of rows in the table

Definition at line 355 of file DS_Table.cpp.

References rows, and DataStructures::BPlusTree< KeyType, DataType, order >::Size().

const DataStructures::BPlusTree< unsigned, Table::Row *, _TABLE_BPLUS_TREE_ORDER > & Table::GetRows | ( | void |  | ) | const

Direct access to make things easier.

Definition at line 1083 of file DS_Table.cpp.

References rows.

Referenced by operator=(), RemoveRows(), and SLNet::TableSerializer::SerializeTable().

Table & Table::operator= | ( | const Table & | input | ) |

Definition at line 1128 of file DS_Table.cpp.

References AddColumn(), AddRow(), DataStructures::Table::Row::cells, Clear(), ColumnName(), DataStructures::Page< KeyType, DataType, order >::data, GetColumnCount(), GetColumnType(), DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), GetRows(), DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, and DataStructures::Page< KeyType, DataType, order >::size.

void Table::PrintColumnHeaders | ( | char * | out,
|  | int | outLength,
|  | char | columnDelineator
| ) |  | const

Prints out the names of all the columns.

Parameters

  [out] | out | A pointer to an array of bytes which will hold the output.
  [in] | outLength | The size of the out array
  [in] | columnDelineator | What character to print to delineate columns

Definition at line 958 of file DS_Table.cpp.

References columns, and DataStructures::List< list_type >::Size().

void Table::PrintRow | ( | char * | out,
|  | int | outLength,
|  | char | columnDelineator,
|  | bool | printDelineatorForBinary,
|  | Table::Row * | inputRow
| ) |  | const

Writes a text representation of the row to out.

Parameters

  [out] | out | A pointer to an array of bytes which will hold the output.
  [in] | outLength | The size of the out array
  [in] | columnDelineator | What character to print to delineate columns
  [in] | printDelineatorForBinary | Binary output is not printed. True to still print the delineator.
  [in] | inputRow | The row to print

Definition at line 989 of file DS_Table.cpp.

References DataStructures::Table::Row::cells, columns, NUMERIC, POINTER, DataStructures::List< list_type >::Size(), and STRING.

void Table::QueryRow | ( | DataStructures::List< unsigned > & | inclusionFilterColumnIndices,
|  | DataStructures::List< unsigned > & | columnIndicesToReturn,
|  | unsigned | key,
|  | Table::Row * | row,
|  | FilterQuery * | inclusionFilters,
|  | Table * | result
| ) |  |

protected

Definition at line 688 of file DS_Table.cpp.

References AddRowColumns(), BINARY, DataStructures::Table::Cell::c, DataStructures::Table::Row::cells, DataStructures::Table::FilterQuery::cellValue, columns, DataStructures::Table::Cell::i, NUMERIC, POINTER, DataStructures::Table::Cell::ptr, QF_EQUAL, QF_GREATER_THAN, QF_GREATER_THAN_EQ, QF_IS_EMPTY, QF_LESS_THAN, QF_LESS_THAN_EQ, QF_NOT_EMPTY, QF_NOT_EQUAL, RakAssert, DataStructures::List< list_type >::Size(), and STRING.

Referenced by QueryTable().

void Table::QueryTable | ( | unsigned * | columnIndicesSubset,
|  | unsigned | numColumnSubset,
|  | FilterQuery * | inclusionFilters,
|  | unsigned | numInclusionFilters,
|  | unsigned * | rowIds,
|  | unsigned | numRowIDs,
|  | Table * | result
| ) |  |

Queries the table, optionally returning only a subset of columns and rows.

Parameters

  [in] | columnSubset | An array of column indices. Only columns in this array are returned. Pass 0 for all columns
  [in] | numColumnSubset | The number of elements in columnSubset
  [in] | inclusionFilters | An array of FilterQuery. All filters must pass for the row to be returned.
  [in] | numInclusionFilters | The number of elements in inclusionFilters
  [in] | rowIds | An arrow of row IDs. Only these rows with these IDs are returned. Pass 0 for all rows.
  [in] | numRowIDs | The number of elements in rowIds
  [out] | result | The result of the query. If no rows are returned, the table will only have columns.

Definition at line 616 of file DS_Table.cpp.

References _FILE_AND_LINE_, AddColumn(), Clear(), DataStructures::Table::FilterQuery::columnIndex, ColumnIndex(), columns, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::BPlusTree< KeyType, DataType, order >::Get(), DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), DataStructures::List< list_type >::Insert(), DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, QueryRow(), rows, DataStructures::Page< KeyType, DataType, order >::size, and DataStructures::List< list_type >::Size().

void Table::RemoveColumn | ( | unsigned | columnIndex | ) |

Removes a column by index.

Parameters

  [in] | columnIndex | The index of the column to remove

Definition at line 304 of file DS_Table.cpp.

References _FILE_AND_LINE_, DataStructures::Table::Row::cells, columns, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), DataStructures::Page< KeyType, DataType, order >::next, SLNet::OP_DELETE(), DataStructures::List< list_type >::RemoveAtIndex(), rows, DataStructures::Page< KeyType, DataType, order >::size, and DataStructures::List< list_type >::Size().

bool Table::RemoveRow | ( | unsigned | rowId | ) |

Removes a row specified by rowId.

Parameters

  [in] | rowId | The ID of the row

Returns
  true if the row was deleted. False if not.

Definition at line 438 of file DS_Table.cpp.

References DataStructures::BPlusTree< KeyType, DataType, order >::Delete(), DeleteRow(), and rows.

Referenced by SLNet::TableSerializer::DeserializeRow().

void Table::RemoveRows | ( | Table * | tableContainingRowIDs | ) |

Removes all the rows with IDs that the specified table also has.

Parameters

  [in] | tableContainingRowIDs | The IDs of the rows

Definition at line 448 of file DS_Table.cpp.

References DataStructures::BPlusTree< KeyType, DataType, order >::Delete(), DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), GetRows(), DataStructures::Page< KeyType, DataType, order >::keys, DataStructures::Page< KeyType, DataType, order >::next, rows, and DataStructures::Page< KeyType, DataType, order >::size.

void Table::SortTable | ( | Table::SortQuery * | sortQueries,
|  | unsigned | numSortQueries,
|  | Table::Row ** | out
| ) |  |

Sorts the table by rows.

You can sort the table in ascending or descending order on one or more columns Columns have precedence in the order they appear in the sortQueries array If a row cell on column n has the same value as a a different row on column n, then the row will be compared on column n+1

Parameters

  [in] | sortQueries | A list of SortQuery structures, defining the sorts to perform on the table
  [in] | numColumnSubset | The number of elements in numSortQueries
  [out] | out | The address of an array of Rows, which will receive the sorted output. The array must be long enough to contain all returned rows, up to GetRowCount()

Definition at line 904 of file DS_Table.cpp.

References _columnIndices, _columns, _FILE_AND_LINE_, _numSortQueries, _sortQueries, BINARY, DataStructures::Table::SortQuery::columnIndex, columns, DataStructures::Page< KeyType, DataType, order >::data, DataStructures::BPlusTree< KeyType, DataType, order >::GetListHead(), DataStructures::OrderedList< key_type, data_type, default_comparison_function >::Insert(), DataStructures::List< list_type >::Insert(), DataStructures::Page< KeyType, DataType, order >::next, RakAssert, rows, DataStructures::Page< KeyType, DataType, order >::size, DataStructures::OrderedList< key_type, data_type, default_comparison_function >::Size(), and DataStructures::List< list_type >::Size().

bool Table::UpdateCell | ( | unsigned | rowId,
|  | unsigned | columnIndex,
|  | int | value
| ) |  |

Updates a particular cell in the table.

Note
  If you are going to update many cells of a particular row, it is more efficient to call GetRow and perform the operations on the row directly.
  Row pointers do not change, so you can also write directly to the rows for more efficiency.

Parameters

  [in] | rowId | The ID of the row
  [in] | columnIndex | The column of the cell
  [in] | value | The data to set

Definition at line 462 of file DS_Table.cpp.

References columns, GetRowByID(), NUMERIC, RakAssert, and DataStructures::Table::Row::UpdateCell().

bool Table::UpdateCell | ( | unsigned | rowId,
|  | unsigned | columnIndex,
|  | char * | str
| ) |  |

Definition at line 474 of file DS_Table.cpp.

References columns, GetRowByID(), RakAssert, STRING, and DataStructures::Table::Row::UpdateCell().

bool Table::UpdateCell | ( | unsigned | rowId,
|  | unsigned | columnIndex,
|  | int | byteLength,
|  | char * | data
| ) |  |

Definition at line 486 of file DS_Table.cpp.

References BINARY, columns, GetRowByID(), RakAssert, and DataStructures::Table::Row::UpdateCell().

bool Table::UpdateCellByIndex | ( | unsigned | rowIndex,
|  | unsigned | columnIndex,
|  | int | value
| ) |  |

Definition at line 498 of file DS_Table.cpp.

References columns, GetRowByIndex(), NUMERIC, RakAssert, and DataStructures::Table::Row::UpdateCell().

bool Table::UpdateCellByIndex | ( | unsigned | rowIndex,
|  | unsigned | columnIndex,
|  | char * | str
| ) |  |

Definition at line 510 of file DS_Table.cpp.

References columns, GetRowByIndex(), RakAssert, STRING, and DataStructures::Table::Row::UpdateCell().

bool Table::UpdateCellByIndex | ( | unsigned | rowIndex,
|  | unsigned | columnIndex,
|  | int | byteLength,
|  | char * | data
| ) |  |

Definition at line 522 of file DS_Table.cpp.

References BINARY, columns, GetRowByIndex(), RakAssert, and DataStructures::Table::Row::UpdateCell().

## Member Data Documentation

DataStructures::List<ColumnDescriptor> DataStructures::Table::columns

protected

Definition at line 346 of file DS_Table.h.

Referenced by AddColumn(), AddRow(), AddRowColumns(), Clear(), ColumnIndex(), ColumnName(), GetCellValueByIndex(), GetColumnCount(), GetColumns(), GetColumnType(), PrintColumnHeaders(), PrintRow(), QueryRow(), QueryTable(), RemoveColumn(), SortTable(), UpdateCell(), and UpdateCellByIndex().

DataStructures::BPlusTree<unsigned, Row*, _TABLE_BPLUS_TREE_ORDER> DataStructures::Table::rows

protected

Definition at line 343 of file DS_Table.h.

Referenced by AddColumn(), AddRow(), AddRowColumns(), Clear(), GetAvailableRowId(), GetListHead(), GetRowByID(), GetRowByIndex(), GetRowCount(), GetRows(), QueryTable(), RemoveColumn(), RemoveRow(), RemoveRows(), and SortTable().

The documentation for this class was generated from the following files:

- Source/include/slikenet/DS_Table.h
- Source/src/DS_Table.cpp