Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Table class. More...
#include <ilviews/dataccess/memtable.h>
Public Member Functions | |
IliMemoryTable (const IliMemoryTable &tbl) | |
Copy constructor. | |
IliMemoryTable (IlvDisplay *display, IlInt rowCnt, const char *const *values, IlInt colCnt=1, const char *const *headers=0) | |
Constructor from a description. | |
IliMemoryTable (IlvDisplay *display) | |
Constructor. | |
virtual IlBoolean | allowColumnMove () const |
Returns IlTrue if columns can be moved to this schema. | |
virtual IlBoolean | allowRowMove () const |
Returns IlTrue if the table (or subclass of the table) allows row move operations. | |
virtual void | clearRows () |
Deletes all rows. | |
virtual IlBoolean | deleteRow (IlInt r) |
Deletes a row. | |
virtual IlBoolean | deleteRowInCache (IlInt rowno) |
Deletes a row. | |
virtual IlBoolean | exchangeRows (IlInt rowno1, IlInt rowno2) |
Exchanges two rows. | |
virtual IlBoolean | exchangeRowsInCache (IlInt rowno1, IlInt rowno2) |
Exchanges two rows. | |
virtual IlInt | getRowsCount () const |
Returns the number of rows in the table. | |
virtual IliRowStatus | getRowStatus (IlInt rowno) const |
Returns the status of one row. | |
virtual IlBoolean | getValue (IlInt r, IlInt c, IliValue &) const |
Returns a value. | |
virtual IlBoolean | insertRow (IlInt r, IliTableBuffer *) |
Inserts a row that is defined by the table buffer. | |
virtual IlBoolean | insertRowInCache (IlInt rowno, IliTableBuffer *) |
Inserts a row that is defined by the table buffer. | |
virtual IlBoolean | moveRow (IlInt from, IlInt to) |
Moves a row. | |
virtual IlBoolean | moveRowInCache (IlInt from, IlInt to) |
Moves a row. | |
virtual void | setColumnMaxLength (IlInt, IlInt) |
Sets the maximum length for one column. | |
virtual void | setColumnNullable (IlInt, IlBoolean) |
Determines if the column positioned at colno is nullable (that is, may contain null values). | |
virtual void | setColumnType (IlInt, const IliDatatype *) |
Sets the type of the column. | |
virtual IlBoolean | updateRow (IlInt r, IliTableBuffer *) |
Updates a row with the values in the table buffer. | |
virtual IlBoolean | updateRowInCache (IlInt rowno, IliTableBuffer *) |
Updates a row. | |
virtual void | write (IL_STDPREF ostream &output) const |
Writes to output stream. |
Table class.
Library: dataccess
The IliMemoryTable
class implements the protocol defined by the IliTable
class, by managing all the memory necessary to store the rows. Since it can handle any set of columns (schema), it may be used as a general purpose table implementation. It is also used as a base class for other more specialized classes such as IliSQLTable
. This class manages rows on a remote database system, and caches parts of these rows locally. In this situation, the IliMemoryTable
base class provides the cache capability.
IliMemoryTable::IliMemoryTable | ( | IlvDisplay * | display | ) |
Constructor.
This constructor initializes a memory table. Initially, this table has no columns and no rows.
display | The display. |
IliMemoryTable::IliMemoryTable | ( | IlvDisplay * | display, | |
IlInt | rowCnt, | |||
const char *const * | values, | |||
IlInt | colCnt = 1 , |
|||
const char *const * | headers = 0 | |||
) |
Constructor from a description.
This constructor creates a memory table with columnsCount
columns and rowsCount
rows. All columns are of the IliStringType
and their names are given by the columnsNames
array. The row cells take their initial values from the values
array, which must be of size columnsCount
x rowsCount
. If the columnNames
parameter is null
, then the columns will be given names in the set {"Column 1", "Column 2", ...}. Note that this constructor does not keep any pointers to the character strings and arrays of character strings that it is given.
display | The display. | |
rowCnt | The row count. | |
values | The values. | |
colCnt | The column count. | |
headers | The columns name. |
IliMemoryTable::IliMemoryTable | ( | const IliMemoryTable & | tbl | ) |
Copy constructor.
This is the copy constructor of the IliMemoryTable
class.
tbl | The table. |
virtual IlBoolean IliMemoryTable::allowColumnMove | ( | ) | const [virtual] |
Returns IlTrue
if columns can be moved to this schema.
The reason why columns can or cannot be moved depends on the specific subclass of IliSchema
that is used.
IlTrue
if columns can be moved to this schema, and IlFalse
otherwise. Reimplemented from IliSchema.
Reimplemented in IliSQLTable.
virtual IlBoolean IliMemoryTable::allowRowMove | ( | ) | const [virtual] |
Returns IlTrue
if the table (or subclass of the table) allows row move operations.
IlTrue
if the table (or subclass of the table) allows row move operations. Reimplemented from IliTable.
virtual void IliMemoryTable::clearRows | ( | ) | [virtual] |
Deletes all rows.
If the table (or subclass of the table) defines a mapping with a remote database, then only the rows in the IliTable
object are deleted. The rows in the remote database are not affected by this operation. This enables the row cache of such a table to be cleared.
Reimplemented from IliTable.
Reimplemented in IliSQLTable.
Deletes a row.
rowno | The row position. |
IlTrue
if successful and IlFalse
if rowno
is out of bounds, or if the row could not be deleted. If the table (or subclass of the table) defines a mapping with a remote database, the row is also deleted in the remote database. Reimplemented from IliTable.
Reimplemented in IliSQLTable.
Deletes a row.
This virtual member function is similar to the deleteRow
member function except that it only deletes the row in the local row cache if this table is a two-tier table.
rowno | The row position. |
IlTrue
if successful and IlFalse
if rowno
is out of bounds, or if the row could not be deleted. If the table (or subclass of the table) defines a mapping with a remote database, the row is also deleted in the remote database. Reimplemented from IliTable.
Exchanges two rows.
rowno1 | The first row position. | |
rowno2 | The second row position. |
IlTrue
if successful. If the table (or subclass of the table) defines a mapping with a remote database, the rows are also exchanged in the remote database (if possible). Reimplemented from IliTable.
Reimplemented in IliSQLTable.
Exchanges two rows.
This virtual member function is similar to the exchangeRows
member function except that it exchanges only the rows in the local row cache.
rowno1 | The first row position. | |
rowno2 | The second row position. |
IlTrue
if successful. If the table (or subclass of the table) defines a mapping with a remote database, the rows are also exchanged in the remote database (if possible). Reimplemented from IliTable.
virtual IlInt IliMemoryTable::getRowsCount | ( | ) | const [virtual] |
Returns the number of rows in the table.
Reimplemented from IliTable.
Reimplemented in IliSQLTable.
virtual IliRowStatus IliMemoryTable::getRowStatus | ( | IlInt | rowno | ) | const [virtual] |
Returns the status of one row.
This is useful when a transaction manager manages the table. The row status can be one of the following:
IliNotARow
The row index is out of bounds. IliRegularRow
The row has not been touched in the current local transaction. IliInsertedRow
The row has been inserted in the current local transaction. IliUpdatedRow
The row has been updated in the current local transaction. IliDeletedRow
The row has been deleted in the current local transaction. The "current local transaction" refers to the changes that have occurred since the most recent call to one of the following member functions (assuming the transaction manager is currently started):
Note that the IliDeletedRow
tag is never returned since a deleted row has no row index. This exists and is mentioned here for your information only.
rowno | The row position. |
Reimplemented from IliTable.
virtual IlBoolean IliMemoryTable::getValue | ( | IlInt | rowno, | |
IlInt | colno, | |||
IliValue & | value | |||
) | const [virtual] |
Returns a value.
This member function handles the fetching of the row (and all preceding rows) as necessary.
rowno | The row position. | |
colno | The column position. | |
value | The value. |
IlTrue
if successful. Reimplemented from IliTable.
Reimplemented in IliSQLTable.
virtual IlBoolean IliMemoryTable::insertRow | ( | IlInt | rowno, | |
IliTableBuffer * | buff | |||
) | [virtual] |
Inserts a row that is defined by the table buffer.
Not all the values are used to insert the row, instead the values for which the isModified
are used, the others being replaced by null values. Note that this member function does not check any of the constraints defined in the schema. If the table (or subclass of the table) defines a mapping with a remote database, the row is also inserted in the remote database.
rowno | The row position. | |
buff | The table buffer. |
IlTrue
if successful, and IlFalse
if rowno
is out of bounds, or if the row could not be inserted. Reimplemented from IliTable.
Reimplemented in IliSQLTable.
virtual IlBoolean IliMemoryTable::insertRowInCache | ( | IlInt | rowno, | |
IliTableBuffer * | buff | |||
) | [virtual] |
Inserts a row that is defined by the table buffer.
This virtual member function is similar to the insertRow
member function except that it only inserts the row in the local row cache if this table is a two-tier table.
rowno | The row position. | |
buff | The table buffer. |
IlTrue
if successful, and IlFalse
if rowno
is out of bounds, or if the row could not be inserted. Reimplemented from IliTable.
Moves a row.
from | The origin row position. | |
to | The destination row position. |
IlTrue
if successful. If the table (or subclass of the table) defines a mapping with a remote database, the row is also moved in the remote database (if possible). Reimplemented from IliTable.
Reimplemented in IliSQLTable.
Moves a row.
This virtual member function is similar to the moveRow
member function except that it moves only the row in the local row cache.
from | The origin row position. | |
to | The destination row position. |
IlTrue
if successful. If the table (or subclass of the table) defines a mapping with a remote database, the row is also moved in the remote database (if possible). Reimplemented from IliTable.
Sets the maximum length for one column.
colno | The column position. | |
maxlen | The maximum length. |
Reimplemented from IliSchema.
Determines if the column positioned at colno
is nullable
(that is, may contain null values).
colno | The column position. | |
nullable | If IlTrue , the column is nullable. |
Reimplemented from IliSchema.
virtual void IliMemoryTable::setColumnType | ( | IlInt | colno, | |
const IliDatatype * | type | |||
) | [virtual] |
Sets the type of the column.
colno | The column position. | |
type | The column type. |
Reimplemented from IliSchema.
virtual IlBoolean IliMemoryTable::updateRow | ( | IlInt | rowno, | |
IliTableBuffer * | buff | |||
) | [virtual] |
Updates a row with the values in the table buffer.
Not all the values are used to update the row. Instead the values for which the isModified
member function returns IlTrue
, are used. Note that this member function does not check any of the constraints defined in the schema. If the table (or subclass of the table) defines a mapping with a remote database, the row is also changed in the remote database.
rowno | The row position. | |
buff | The table buffer. |
IlTrue
if successful and IlFalse
if rowno
is out of bounds, or if the row could not be updated. Reimplemented from IliTable.
Reimplemented in IliSQLTable.
virtual IlBoolean IliMemoryTable::updateRowInCache | ( | IlInt | rowno, | |
IliTableBuffer * | buff | |||
) | [virtual] |
Updates a row.
This virtual member function is similar to the updateRow
member function except that it only updates the row in the local row cache if this table is a two-tier table.
rowno | The row position. | |
buff | The table buffer. |
IlTrue
if successful and IlFalse
if rowno
is out of bounds, or if the row could not be updated. Reimplemented from IliTable.
virtual void IliMemoryTable::write | ( | IL_STDPREF ostream & | output | ) | const [virtual] |
Writes to output stream.
Writes a memory table to an output stream, in a form suitable to be able to be read back by the stream-based constructor.
output | The output stream. |
Reimplemented from IliTable.
Reimplemented in IliSQLTable.
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.