Rogue Wave Views |
Rogue Wave Views Documentation Home |
Table class. More...
#include <ilviews/dataccess/table.h>
Public Member Functions | |
void | addErrorSink (IliErrorSink *sink) |
Adds an error sink. More... | |
virtual IlBoolean | allowRowMove () const |
Returns IlTrue if the table (or subclass of the table) allows row move operations. More... | |
IlInt | appendParameter (const char *paramName, const IliDatatype *type, IlInt maxlen=-1) |
Appends a new parameter to the table parameters. More... | |
IlInt | appendRow (IliTableBuffer *tblBuf) |
Appends a new row defined by the table buffer. More... | |
IlInt | appendRowInCache (IliTableBuffer *tblBuf) |
Appends a new row defined by the table buffer. More... | |
virtual IlBoolean | applyQueryMode (IliTable *queryTable) |
Applies the query specified by the conditions contained in the provided table. More... | |
IliValue | at (IlInt rowno, IlInt colno) const |
Returns a value. More... | |
IliValue | at (IlInt rowno, IliName colname) const |
Returns a value. More... | |
virtual IlBoolean | checkConstraints (IlInt rowno, IliTableBuffer *buff) const |
Validates the table buffer data. More... | |
virtual void | clearRows () |
Deletes all rows. More... | |
IliTable * | copyTable () const |
Returns a copy of the table. More... | |
void | deleteParameter (IlInt paramno) |
Deletes a parameter. More... | |
virtual IlBoolean | deleteRow (IlInt rowno) |
Deletes a row. More... | |
virtual IlBoolean | deleteRowInCache (IlInt rowno) |
Deletes a row. More... | |
void | enableColumnCompletion (IlInt colno, IlBoolean flag) |
Specifies whether completion is enabled for the column. More... | |
virtual IlBoolean | exchangeRows (IlInt rowno1, IlInt rowno2) |
Exchanges two rows. More... | |
virtual IlBoolean | exchangeRowsInCache (IlInt rowno1, IlInt rowno2) |
Exchanges two rows. More... | |
virtual IlInt | fetchAll () |
Fetches all remaining rows and stores them in the local row cache. More... | |
virtual IlBoolean | fetchCompleted () const |
Returns IlTrue , if all the rows have been fetched from the database and stored in the local row cache. More... | |
virtual IlInt | fetchNext (IlInt count=1) |
Fetches up a number of rows from the database and stores them in the local row cache. More... | |
IlInt | findFirstRow (const IliValue &value, IlInt colno, IlBoolean complete, IlInt fromRow=0, IlInt toRow=-1) const |
Searches for a row located between two positions. More... | |
IlInt | findRow (const IliValue &value, IlInt colno, IlBoolean complete, IlInt fromRow=0, IlInt toRow=-1) const |
Searches for a row located between two positions. More... | |
IliTableBuffer * | getBuffer () |
Returns a table buffer for the table. More... | |
IlBoolean | getColumnDisplayValue (IlInt colno, const IliValue &value, IliValue &displayValue, IlvGraphicHolder *h=NULL) |
Returns the display value for a value. More... | |
IliTable * | getColumnEffectiveForeignTable (IlInt colno, IlvGraphicHolder *h=NULL) const |
Returns the effective foreign table. More... | |
const char * | getColumnForeignDataSourceName (IlInt colno) const |
Returns the name of the data source that will provide a foreign table for one column. More... | |
const char * | getColumnForeignDisplayColumn (IlInt colno) const |
Returns the name of the display column in the foreign table. More... | |
IliTable * | getColumnForeignTable (IlInt colno) const |
Returns the foreign table of one column. More... | |
const char * | getColumnForeignValueColumn (IlInt colno) const |
Returns the name of the value column in the foreign table. More... | |
IlAny | getCompareData () const |
Returns the user data that can be used to compare two rows. More... | |
IliCompareFunction | getCompareFunction () const |
Returns the function that is used to compare two rows. More... | |
const IliTablePropertyManager * | getDefaultPropertyManager () const |
Returns the default property manager. More... | |
IliTablePropertyManager * | getDefaultPropertyManager () |
Returns the default property manager. More... | |
IlvGadgetHolder * | getGadgetHolder () const |
Returns the gadget holder to which the table is attached. More... | |
IliTablePropertyManager * | getNamedPropertyManager (const char *name) const |
Returns a property manager from its name. More... | |
IlInt | getNamedPropertyManagerCount () const |
Returns the number of named property managers. More... | |
const char * | getParameterColumnName (IlInt paramno) const |
Returns the name of the column, which the parameter is attached to. More... | |
const char * | getParameterDataSourceName (IlInt paramno) const |
Returns the name of the data source which the parameter is attached to. More... | |
IliValue | getParameterDataSourceValue (IlInt paramno) const |
Returns the current value of one parameter. More... | |
IlInt | getParameterIndex (const char *name) const |
Returns the position of one parameter. More... | |
IlInt | getParameterMaxLength (IlInt paramno) const |
Returns the maximum length allowed for one parameter. More... | |
const char * | getParameterName (IlInt paramno) const |
Returns a parameter name. More... | |
IlInt | getParametersCount () const |
Returns the number of parameters defined for this table. More... | |
const IliDatatype * | getParameterType (IlInt paramno) const |
Returns the parameter type. More... | |
IliValue | getParameterValue (IlInt paramno) const |
Returns the current value of one parameter. More... | |
IliValue | getParameterValue (IliName paramName) const |
Returns the current value of one parameter. More... | |
IlBoolean | getProperty (IlInt rowno, IlInt colno, const IlvSymbol *propName, IliValue &propVal) const |
Returns a property value attached to the part of the table. More... | |
IlInt | getPropertyCount (IlInt rowno, IlInt colno) const |
Returns the property count attached to the part of the table. More... | |
const char * | getPropertyManagerNameAt (IlInt idx) const |
Returns the name of the named property manager. More... | |
const IlvSymbol * | getPropertyNameAt (IlInt rowno, IlInt colno, IlInt propIndex) const |
Returns a property name attached to the part of the table. More... | |
IliRowPtr | getRowPtr (IlInt rowno=-1) const |
Returns an IliRowPtr that points to one row. More... | |
virtual IlInt | getRowsCount () const |
Returns the number of rows in the table. More... | |
virtual IliRowStatus | getRowStatus (IlInt rowno) const |
Returns the status of one row. More... | |
IliTransactionManager * | getTransactionManager () const |
Returns the transaction manager managing the table. More... | |
const char * | getTransactionManagerName () const |
Returns the name of the transaction manager that manages the table. More... | |
virtual IlBoolean | getValue (IlInt rowno, IlInt colno, IliValue &value) const |
Returns a value. More... | |
virtual IlBoolean | insertRow (IlInt rowno, IliTableBuffer *buff) |
Inserts a row that is defined by the table buffer. More... | |
virtual IlBoolean | insertRowInCache (IlInt rowno, IliTableBuffer *buff) |
Inserts a row that is defined by the table buffer. More... | |
virtual IlBoolean | insertRowsFrom (const IliTable *src, IlInt srcFromRow=0, IlInt srcToRow=-1, IlBoolean stopAtFirstError=IlTrue, IlInt insertAt=-1) |
Inserts rows into this table by copying them from another table. More... | |
IlBoolean | isColumnCompletionEnabled (IlInt colno) const |
Returns IlTrue if completion is enabled for the column. More... | |
IlBoolean | isColumnValueConstrained (IlInt colno) const |
Returns IlTrue if the column is constrained to taking its values from the domain of the value column of the foreign table. More... | |
IlBoolean | isModified () const |
Returns IlTrue if the rows of the table have been modified since the last time. More... | |
virtual IlBoolean | isQueryModeSupported () const |
Returns IlTrue if the table supports query mode. More... | |
virtual IlBoolean | isSelectDone () const |
Returns IlTrue if the select member function has been called since the object was constructed. More... | |
virtual IliTable * | makeQueryTable () const |
Returns a memory table having the same number of columns as this table. More... | |
virtual IlBoolean | moveRow (IlInt from, IlInt to) |
Moves a row. More... | |
virtual IlBoolean | moveRowInCache (IlInt from, IlInt to) |
Moves a row. More... | |
IliTablePropertyManager * | newNamedPropertyManager (const char *name) |
Creates and returns a new named property manager. More... | |
virtual IliTablePropertyManager * | newPropertyManager () |
Creates and returns a new anonymous property manager. More... | |
virtual IlBoolean | refreshAndLockRow (IlInt rowno) |
Refreshes and lock a row. More... | |
virtual IlBoolean | refreshRow (IlInt rowno) |
Refreshes a row. More... | |
void | releaseBuffer (IliTableBuffer *buff) |
Releases a table buffer. More... | |
void | removeErrorSink (IliErrorSink *sink) |
Removes an error sink from this table. More... | |
void | removeNamedPropertyManager (const char *name) |
Removes a property manager. More... | |
void | removeProperty (IlInt rowno, IlInt colno, const IlvSymbol *propName) |
Removes a property from the part of the table. More... | |
virtual IlBoolean | select () |
Reads all rows from a remote database. More... | |
IlBoolean | set (IlInt rowno, IlInt colno, const IliValue &value) |
Sets a value. More... | |
IlBoolean | set (IlInt rowno, IliName colname, const IliValue &value) |
Sets a value. More... | |
void | setColumnForeignDataSourceName (IlInt colno, const char *dsname) |
Sets the name of the foreign data source for one column. More... | |
void | setColumnForeignDisplayColumn (IlInt colno, const char *name) |
Sets the name of the display column in the foreign table. More... | |
void | setColumnForeignTable (IlInt colno, IliTable *table) |
Sets the foreign table of one column. More... | |
void | setColumnForeignValueColumn (IlInt colno, const char *name) |
Sets the name of the value column in the foreign table. More... | |
void | setColumnValueConstrained (IlInt colno, IlBoolean flag) |
Specifies that the column is constrained to take its values from the domain of the value column of the foreign table. More... | |
void | setCompareFunction (IliCompareFunction fct, IlAny arg=0) |
Defines the function and user data that must be used to compare two rows. More... | |
void | setGadgetHolder (IlvGadgetHolder *gadHold) |
Attaches the table to a gadget holder. More... | |
IlBoolean | setInCache (IlInt rowno, IlInt colno, const IliValue &value) |
Sets a value. More... | |
virtual void | setModified (IlBoolean flag) |
Sets the value of the modified property of the table. More... | |
void | setParameterColumnName (IlInt paramno, const char *colname) |
Attaches a parameter to one column. More... | |
void | setParameterDataSourceName (IlInt paramno, const char *dsname) |
Attaches one parameter to one data source. More... | |
void | setParameterMaxLength (IlInt paramno, IlInt maxlen) |
Sets the maximum length allowed for the parameter. More... | |
void | setParameterName (IlInt paramno, const char *name) |
Sets a parameter name. More... | |
void | setParameterType (IlInt paramno, const IliDatatype *type) |
Sets the type of one parameter. More... | |
void | setParameterValue (IlInt paramno, const IliValue &value) |
Sets the value of one parameter. More... | |
void | setParameterValue (IliName paramName, const IliValue &value) |
Sets the value of one parameter. More... | |
void | setProperty (IlInt rowno, IlInt colno, const IlvSymbol *propName, const IliValue &propVal) |
Sets a property value to a part of the table. More... | |
void | setTransactionManager (IliTransactionManager *tm) |
Changes the transaction that manages this table. More... | |
void | setTransactionManagerName (const char *name) |
Changes the transaction that manages this table. More... | |
void | sortRows (const IlInt *colnoArray, IlInt columnsCount, IlInt fromRow=0, IlInt toRow=-1, IliCompareFunction fct=0, IlAny data=0) |
Sorts a set of rows. More... | |
virtual IlBoolean | updateRow (IlInt rowno, IliTableBuffer *buff) |
Updates a row with the values in the table buffer. More... | |
virtual IlBoolean | updateRowInCache (IlInt rowno, IliTableBuffer *buff) |
Updates a row. More... | |
virtual void | write (IL_STDPREF ostream &) const |
Writes the definition of a schema to an output stream in a form suitable to be read back by the stream-based constructor. More... | |
void | writeTable (IL_STDPREF ostream &output) const |
Writes the definition of the table to an output stream, in a form suitable to be read back by the ReadTable static member function. More... | |
Public Member Functions inherited from IliSchema | |
IliSchema (IlvDisplay *display) | |
This constructor initializes a schema object. More... | |
IliSchema (const IliSchema &) | |
This is the copy constructor of the IliSchema class. | |
IliSchema (IlvDisplay *display, IL_STDPREF istream &input) | |
This constructor initializes a schema by reading its definition from an input stream. More... | |
void | addHook (IliTableHook *hook) |
Adds a hook to the list of hooks of the schema object. More... | |
virtual IlBoolean | allowColumnMove () const |
Returns IlTrue if columns can be moved to this schema. More... | |
IlInt | appendColumn (const char *name, const IliDatatype *type, IlInt maxlen=-1) |
Appends a new column to the schema. More... | |
const IliDatatype * | asDatatype () const |
Returns the data type that is defined by this schema. More... | |
virtual IlBoolean | deleteColumn (IlInt colno) |
Deletes a column. More... | |
void | endOfBatch () |
Used in conjunction with the startOfBatch member function to terminate a series of modifications on the schema. More... | |
IlvAlignment | getColumnAlignment (IlInt colno) const |
Returns the column alignment. More... | |
const char * | getColumnDefault (IlInt colno) const |
Returns the default value for one column. More... | |
IlInt | getColumnDisplayWidth (IlInt colno) const |
Returns the display width, in pixels, of one column. More... | |
const IliFormat & | getColumnFormat (IlInt colno) const |
Returns the format of one column. More... | |
IlInt | getColumnIndex (const char *name) const |
Returns the position of the column. More... | |
IlInt | getColumnIndex (IlInt token) const |
Returns the position of the column. More... | |
const char * | getColumnLabel (IlInt colno) const |
Returns the label of one column. More... | |
const IliInputMask & | getColumnMask (IlInt colno) const |
Returns the input mask of one column. More... | |
IlInt | getColumnMaxLength (IlInt colno) const |
Returns the maximum length allowed for one column. More... | |
const char * | getColumnName (IlInt colno) const |
Returns the name of the column. More... | |
IlInt | getColumnsCount () const |
Returns the number of columns in the schema. More... | |
const char * | getColumnTitle (IlInt colno) const |
Returns the title of one column. More... | |
IlInt | getColumnToken (IlInt colno) const |
Returns the token of the column. More... | |
const IliDatatype * | getColumnType (IlInt colno) const |
Returns the type of the column. More... | |
IlvDisplay * | getDisplay () const |
Returns the display of the schema object. More... | |
const char * | getElementTypeName () const |
Returns the type name of the objects in the collection. More... | |
const IliSchema * | getNestedSchema (const IliAttributePath &path) const |
Returns the nested schema. More... | |
IliSchema * | getNestedSchema (const IliAttributePath &path) |
Returns the nested schema. More... | |
const char * | getSchemaName () const |
Returns the schema name. More... | |
IlBoolean | hasHook (IliTableHook *hook) const |
Returns True if the hook is already into the list of hooks of the schema object. More... | |
virtual IlBoolean | insertColumn (IlInt colno, const char *colname, const IliDatatype *type, IlInt maxlen=-1) |
Inserts a new column in the schema. More... | |
IlBoolean | isACollection () const |
Returns IlTrue if the schema defines a type that is a collection of objects or values. More... | |
IlBoolean | isASimpleCollection () const |
Returns IlTrue if the schema is defined as a simple collection type. More... | |
IlBoolean | isColumnNullable (IlInt colno) const |
Returns IlTrue if the column allows null values. More... | |
IlBoolean | isColumnPartOfKey (IlInt colno) const |
Returns IlTrue if the column is part of the primary key of the schema. More... | |
IlBoolean | isColumnReadOnly (IlInt colno) const |
Returns IlTrue if the column is read-only. More... | |
IlBoolean | isColumnVisible (IlInt colno) const |
Returns IlTrue if the column should be visible. More... | |
IlBoolean | isPrimaryKeyDefined () const |
Returns IlTrue if the schema has one or more columns defined as being part of the primary key. More... | |
virtual IlBoolean | moveColumn (IlInt from, IlInt to) |
Moves a column. More... | |
void | removeHook (IliTableHook *hook) |
Removes a hook from the list of hooks of the schema object. More... | |
void | setAsCollection (IlBoolean flag) |
Sets the schema as a collection type. More... | |
void | setAsSimpleCollection (IlBoolean flag) |
Sets the schema as a simple collection type. More... | |
virtual void | setColumnAlignment (IlInt colno, IlvAlignment align) |
Sets the alignment of one column. More... | |
virtual void | setColumnDefault (IlInt colno, const char *val) |
Sets the default value for one column. More... | |
virtual void | setColumnDisplayWidth (IlInt colno, IlInt width) |
Sets the display width of one column. More... | |
virtual void | setColumnFormat (IlInt colno, const IliFormat &fmt) |
Sets the format of the column. More... | |
virtual void | setColumnLabel (IlInt colno, const char *label) |
Sets the label of one column. More... | |
virtual void | setColumnMask (IlInt colno, const IliInputMask &mask) |
Sets the input mask of one column. More... | |
virtual void | setColumnMaxLength (IlInt colno, IlInt maxlen) |
Sets the maximum length for one column. More... | |
virtual void | setColumnName (IlInt colno, const char *colname) |
Sets the name of the column. More... | |
virtual void | setColumnNullable (IlInt colno, IlBoolean nullable) |
Determines if the column positioned at colno is nullable (that is, may contain null values). More... | |
virtual void | setColumnPartOfKey (IlInt colno, IlBoolean partOfKey) |
Specifies whether the column is part of the primary key. More... | |
virtual void | setColumnReadOnly (IlInt colno, IlBoolean readOnly) |
Specifies whether a column is read-only. More... | |
virtual void | setColumnTitle (IlInt colno, const char *title) |
Sets the title of one column. More... | |
virtual void | setColumnType (IlInt colno, const IliDatatype *type) |
Sets the type of the column. More... | |
virtual void | setColumnVisible (IlInt colno, IlBoolean visible) |
Sets the column visibility. More... | |
void | setElementTypeName (const char *name) |
Sets the element type name. More... | |
void | setSchemaName (const char *name) |
Sets the schema name. More... | |
void | startOfBatch () |
Used to start a series of modifications on the schema object. More... | |
Public Member Functions inherited from IliRefCounted | |
IlInt | getRefCount () const |
Returns the reference count of the object. Initially, this property is set to 0 . More... | |
void | lock () const |
Increments the reference count of the object. | |
void | unLock () const |
Decrements the reference count of the object. More... | |
Static Public Member Functions | |
static IliTable * | ReadTable (IlvDisplay *disp, IL_STDPREF istream &input) |
Constructs and returns an instance of a subclass of IliTable by reading its definition from an input stream. More... | |
Protected Member Functions | |
virtual void | cellChanged (IlInt rowno, IlInt colno) |
Called just after a cell has changed. More... | |
virtual void | raiseError (const IliErrorMessage &msg) const |
Called each time an error occurs. More... | |
virtual void | rowChanged (IlInt rowno) |
Called just after the row at position rowno has changed (that is, when one or more values in the row have changed). More... | |
virtual void | rowDeleted (IlInt rowno) |
Called just after a row has been removed from the table. More... | |
virtual void | rowFetched (IlInt rowno) |
Called just after a new row has been fetched from a remote database and inserted. More... | |
virtual void | rowInserted (IlInt rowno) |
Called just after a new row has been inserted. More... | |
virtual void | rowMoved (IlInt src, IlInt dest) |
Called just after a row has moved. More... | |
virtual void | rowToBeChanged (IlInt rowno) |
Called just before the row is changed. More... | |
virtual void | rowToBeDeleted (IlInt rowno) |
Called just before a row is removed from the table. More... | |
virtual void | tableChanged () |
Called when the IliTable object has undergone a significant number of changes. More... | |
Friends | |
class | IliMemoryTable |
class | IliTransactionManager |
Table class.
Library: dataccess
The IliTable
class is an abstract class that defines objects capable of managing an ordered collection of rows. Each of these rows conforms to the same schema. Since the IliTable
class is abstract, it defines a protocol for creating, editing, and inspecting a table object. This protocol is implemented in subclasses of the IliTable
class. In addition to having a schema, a table has a set of parameters. A table also manages a set of rows. Some of the IliTable
subclasses, such as IliMemoryTable
or IliStringsTable
, manage rows themselves. They are called one-tier tables. Other subclasses, such as IliSQLTable
, manage rows located in a remote database. They are called two-tier tables. Some of the member functions of the IliTable
class, behave differently in these two types of tables. It should be noted that a two-tier table implements a local row cache, where it stores a copy of some of the remote rows to which the table is mapped at any particular time. The purpose of this cache is to reduce communication overheads with the remote database engine, and to allow you to overcome the fact that many database systems do not provide random access to their data. In this situation, a subset of the database rows is copied and stored in the local row cache allowing the table object to provide random access to these rows. The IliTable
class does not support the concept of a current row. This is due to the fact that such a concept would not allow many users to simultaneously access the table, each with their own current row. Instead, a companion class, IliTableBuffer
, is provided. This class implements the notion of current row, allowing many simultaneous users of an IliTable
object.
void IliTable::addErrorSink | ( | IliErrorSink * | sink | ) |
Adds an error sink.
All errors that are thrown by one of the raiseError
member functions will be forwarded to this error sink. Note that the table will not delete the error sink at destruction time, so the same error sink may be safely shared among many tables.
sink | The error sink. |
|
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 in IliMemoryTable, and IliStringsTable.
IlInt IliTable::appendParameter | ( | const char * | paramName, |
const IliDatatype * | type, | ||
IlInt | maxlen = -1 |
||
) |
Appends a new parameter to the table parameters.
paramName | The parameter name, it is copied. |
type | The parameter type. |
maxlen | The maximum length. |
IlInt IliTable::appendRow | ( | IliTableBuffer * | tblBuf | ) |
Appends a new row defined by the table buffer.
tblBuf | The table buffer. |
-1
if it fails. If the table (or subclass of the table) defines a mapping with a remote database, the row is also inserted in the remote database. IlInt IliTable::appendRowInCache | ( | IliTableBuffer * | tblBuf | ) |
Appends a new row defined by the table buffer.
This member function is similar to the appendRow
member function except that it appends only the row in the local row cache if this table is a two-tier table.
tblBuf | The table buffer. |
-1
if it fails. If the table (or subclass of the table) defines a mapping with a remote database, the row is also inserted in the remote database. Applies the query specified by the conditions contained in the provided table.
If query mode is supported, applies the query specified by the conditions contained in the queryTable
parameter, which is expected to be a table obtained by calling the makeQueryTable
virtual member function.
queryTable | The table. |
IlTrue
if successful. Reimplemented in IliSQLTable.
Returns a value.
rowno | The row position. |
colno | The column position. |
rowno
for the column positioned at colno
. This member function is similar to the getValue
member function, except that it does not report any errors that may have occurred. Returns a value.
rowno | The row position. |
colname | The name of the column. |
rowno
for the column named colname
. Called just after a cell has changed.
If more than one value has changed in a row, it is preferable to call the rowChanged
member function once, instead of calling cellChanged
many times.
rowno | The row position. |
colno | The column position. |
|
virtual |
Validates the table buffer data.
rowno | The row position. |
buff | The table buffer. |
IlTrue
if the buff
table buffer contains a valid row as defined by the constraints specified in the schema of the table. If the rowno
parameter is equal to -1
, the buff
parameter is assumed to contain a row that will be inserted into the table. Otherwise, rowno
must designate an existing row, and buff
is assumed to contain a replacement for that row. The constraints that are checked by this member function are the primary key constraint, the NOT NULL
constraint, and the maximum length column constraint.
|
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 in IliSQLTable, IliMemoryTable, and IliStringsTable.
IliTable* IliTable::copyTable | ( | ) | const |
Returns a copy of the table.
This member function can copy any subclass of IliTable
.
void IliTable::deleteParameter | ( | IlInt | paramno | ) |
Deletes a parameter.
paramno | The parameter position. |
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 in IliSQLTable, IliMemoryTable, and IliStringsTable.
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 in IliMemoryTable.
Specifies whether completion is enabled for the column.
colno | The column name. |
flag | The completion flags. |
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 in IliSQLTable, and IliMemoryTable.
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 in IliMemoryTable.
|
virtual |
Fetches all remaining rows and stores them in the local row cache.
Reimplemented in IliSQLTable.
|
virtual |
Returns IlTrue
, if all the rows have been fetched from the database and stored in the local row cache.
The table (or subclass of the table) must define a mapping with a database.
IlTrue
, if all the rows have been fetched from the database and stored in the local row cache. Reimplemented in IliSQLTable.
Fetches up a number of rows from the database and stores them in the local row cache.
count | The row count. |
Reimplemented in IliSQLTable.
IlInt IliTable::findFirstRow | ( | const IliValue & | value, |
IlInt | colno, | ||
IlBoolean | complete, | ||
IlInt | fromRow = 0 , |
||
IlInt | toRow = -1 |
||
) | const |
Searches for a row located between two positions.
value | The value. |
colno | The column position. |
complete | The complete flag. To make a match when the parameter is IlTrue , the character string representation of the value parameter may be a prefix of the character string representation of the value contained in the colno column of the row. In this case, if several rows correspond to the prefix, the function returns the position of the first row to which it corresponds. |
fromRow | The start position. |
toRow | The last row position. If equals -1 then all rows starting at fromRow are located. The first of these rows that contains a value equal to the value in the column is the match. |
-1
. IlInt IliTable::findRow | ( | const IliValue & | value, |
IlInt | colno, | ||
IlBoolean | complete, | ||
IlInt | fromRow = 0 , |
||
IlInt | toRow = -1 |
||
) | const |
Searches for a row located between two positions.
value | The value. |
colno | The column position. |
complete | The complete flag. To make a match when the parameter is IlTrue , the character string representation of the value parameter may be a prefix of the character string representation of the value contained in the colno column of the row. In this case, if several rows correspond to the prefix, the function returns -1 . |
fromRow | The start position. |
toRow | The last row position. If equals -1 then all rows starting at fromRow are located. The first of these rows that contains a value equal to the value in the column is a match. |
-1
. IliTableBuffer* IliTable::getBuffer | ( | ) |
Returns a table buffer for the table.
A table buffer is used to inspect, alter or add rows into the table. Any table buffer obtained through this member function should be returned to the table when finished, using the releaseBuffer
member function.
IlBoolean IliTable::getColumnDisplayValue | ( | IlInt | colno, |
const IliValue & | value, | ||
IliValue & | displayValue, | ||
IlvGraphicHolder * | h = NULL |
||
) |
Returns the display value for a value.
If the column has an effective foreign table, this member function attempts to map the value parameter through the effective foreign table yielding a display value. If the column does not have an effective foreign table, the value is copied into the display value.
colno | The column name. |
value | The value. |
displayValue | The display value. |
h | The holder. It is used to resolve the foreign data source. |
IlTrue
if successful. IliTable* IliTable::getColumnEffectiveForeignTable | ( | IlInt | colno, |
IlvGraphicHolder * | h = NULL |
||
) | const |
Returns the effective foreign table.
If a foreign table has been specified with the getColumnForeignTable
member function for one column, this table is returned. Otherwise, if a foreign data source name has been specified with the getColumnForeignDataSourceName
, this name is resolved to a data source (by way of the IliRepository
object and the holder) and if a data source with that name is found, it is returned. Otherwise, NULL
is returned.
colno | The column name. |
h | The holder. |
const char* IliTable::getColumnForeignDataSourceName | ( | IlInt | colno | ) | const |
Returns the name of the data source that will provide a foreign table for one column.
colno | The column position. |
NULL
if position is out of bounds, and an empty string if no foreign data source is defined for the column. const char* IliTable::getColumnForeignDisplayColumn | ( | IlInt | colno | ) | const |
Returns the name of the display column in the foreign table.
The column which is used to find a replacement value for the column.
colno | The column position. |
Returns the foreign table of one column.
NULL
if this column does not have a foreign table. const char* IliTable::getColumnForeignValueColumn | ( | IlInt | colno | ) | const |
Returns the name of the value column in the foreign table.
The column which the value in the column must be matched with, to yield a display value.
colno | The column position. |
IlAny IliTable::getCompareData | ( | ) | const |
Returns the user data that can be used to compare two rows.
IliCompareFunction IliTable::getCompareFunction | ( | ) | const |
Returns the function that is used to compare two rows.
const IliTablePropertyManager* IliTable::getDefaultPropertyManager | ( | ) | const |
Returns the default property manager.
IliTable
object. IliTablePropertyManager* IliTable::getDefaultPropertyManager | ( | ) |
Returns the default property manager.
IliTable
object. IlvGadgetHolder* IliTable::getGadgetHolder | ( | ) | const |
Returns the gadget holder to which the table is attached.
A table must be attached to a gadget holder for the getParameterDataSourceValue
member function to work correctly.
NULL
if the table is not attached to a gadget holder. IliTablePropertyManager* IliTable::getNamedPropertyManager | ( | const char * | name | ) | const |
Returns a property manager from its name.
name | The property manager name. |
name
if it exists and NULL
otherwise. IlInt IliTable::getNamedPropertyManagerCount | ( | ) | const |
Returns the number of named property managers.
const char* IliTable::getParameterColumnName | ( | IlInt | paramno | ) | const |
Returns the name of the column, which the parameter is attached to.
paramno | The parameter position. |
NULL
if position is out of bounds, and an empty string if the parameter is not attached to a column. const char* IliTable::getParameterDataSourceName | ( | IlInt | paramno | ) | const |
Returns the name of the data source which the parameter is attached to.
paramno | The parameter position. |
NULL
if position is out of bounds, and an empty character string if the parameter is not attached to a data source. Returns the current value of one parameter.
This member function takes into account any data source or column that the parameter may be attached to.
paramno | The parameter position. |
IlInt IliTable::getParameterIndex | ( | const char * | name | ) | const |
Returns the position of one parameter.
name | The parameter name. |
-1
if no such parameter is found. Returns the maximum length allowed for one parameter.
A value of -1
means that the length is not constrained.
paramno | The parameter position. |
const char* IliTable::getParameterName | ( | IlInt | paramno | ) | const |
Returns a parameter name.
paramno | The parameter position. |
NULL
if position is out of bounds. IlInt IliTable::getParametersCount | ( | ) | const |
Returns the number of parameters defined for this table.
const IliDatatype* IliTable::getParameterType | ( | IlInt | paramno | ) | const |
Returns the parameter type.
paramno | The parameter position. |
NULL
if position is out of bounds. Returns the current value of one parameter.
This member function does not take into account any data source or column which the parameter may be attached to.
paramno | The parameter position. |
Returns the current value of one parameter.
This member function does not take into account any data source or column which the parameter may be attached to.
paramName | The parameter name. |
IlBoolean IliTable::getProperty | ( | IlInt | rowno, |
IlInt | colno, | ||
const IlvSymbol * | propName, | ||
IliValue & | propVal | ||
) | const |
Returns a property value attached to the part of the table.
Note: Accesses the default property manager.
rowno | The row position. |
colno | The column position. |
propName | The property name. |
propVal | The value. |
IlTrue
if successful. Returns the property count attached to the part of the table.
Note: Accesses the default property manager.
rowno | The row position. |
colno | The column position. |
const char* IliTable::getPropertyManagerNameAt | ( | IlInt | idx | ) | const |
Returns the name of the named property manager.
idx | The property manager position. It must be between 0 and getNamedPropertyManagerCount() . |
Returns a property name attached to the part of the table.
Note: Accesses the default property manager.
rowno | The row position. |
colno | The column position. |
propIndex | The property index. The value must be between 0 and getPropertyCount() . |
rowno
and colno
positioned at propIndex
.
|
virtual |
Returns the number of rows in the table.
Reimplemented in IliSQLTable, IliMemoryTable, IliMapTable, and IliStringsTable.
|
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 in IliMemoryTable.
IliTransactionManager* IliTable::getTransactionManager | ( | ) | const |
Returns the transaction manager managing the table.
Initially, this property is NULL
.
NULL
if the table is not managed by a transaction manager. const char* IliTable::getTransactionManagerName | ( | ) | const |
Returns the name of the transaction manager that manages the table.
NULL
if the table is not managed by a transaction manager or if it is managed by an anonymous transaction manager. 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 in IliSQLTable, IliMemoryTable, IliMapTable, and IliStringsTable.
|
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 in IliSQLTable, IliMemoryTable, and IliStringsTable.
|
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 in IliMemoryTable.
|
virtual |
Inserts rows into this table by copying them from another table.
The rows are taken from the src
parameter, starting from srcFromRow
up to srcToRow
(or up to the end of src
if srcToRow
is less than 0
). The only constraint on table src
is that it must have a schema identical to that of this table. In other words, it must have the same number of columns and the columns must have compatible data types.
src | The source table. |
srcFromRow | The first row position of the source table. |
srcToRow | The last row position of the source table. |
stopAtFirstError | If IlTrue , the process of inserting rows will stop as soon as an error is caught. Otherwise, the maximum possible number of rows will be copied. |
insertAt | The insertion position. |
IlTrue
if it is successful and IlFalse
otherwise. Returns IlTrue
if completion is enabled for the column.
colno | The column name. |
IlTrue
if completion is enabled for the column. Returns IlTrue
if the column is constrained to taking its values from the domain of the value column of the foreign table.
colno | The column position. |
IlBoolean IliTable::isModified | ( | ) | const |
Returns IlTrue
if the rows of the table have been modified since the last time.
IlTrue
if the rows of the table have been modified since the last time.
|
virtual |
Returns IlTrue
if the table supports query mode.
IlTrue
if the table supports query mode. Reimplemented in IliSQLTable.
|
virtual |
Returns IlTrue
if the select
member function has been called since the object was constructed.
IlTrue
if the select
member function has been called since the object was constructed. Reimplemented in IliSQLTable.
|
virtual |
Returns a memory table having the same number of columns as this table.
If query mode is supported, creates and returns a memory table having the same number of columns as this table. The returned memory table columns are all of the String type.
Reimplemented in IliSQLTable.
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 in IliSQLTable, IliMemoryTable, and IliStringsTable.
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 in IliMemoryTable.
IliTablePropertyManager* IliTable::newNamedPropertyManager | ( | const char * | name | ) |
Creates and returns a new named property manager.
|
virtual |
Creates and returns a new anonymous property manager.
IliTable
object.
|
protectedvirtual |
Called each time an error occurs.
msg | The error message. |
|
static |
Constructs and returns an instance of a subclass of IliTable
by reading its definition from an input stream.
disp | The display. |
input | The input stream. |
Refreshes and lock a row.
If this is a two-tier table, this member function re-reads the row from the remote database. In addition, if the remote database supports it, the remote row is locked so that other users cannot modify or delete it as long as the lock is held. The means by which the lock can be released is not specified by class IliTable
. It is left to the discretion of subclasses (see class IliSQLTable
).
rowno | The row position. |
IlTrue
if the row was successfully refreshed and remotely locked. If this is a one-tier table, this member function returns IlTrue
without having any side effects. Reimplemented in IliSQLTable.
Refreshes a row.
If this is a two-tier table, this member function re-reads the row from the remote database.
rowno | The row position. |
IlTrue
in case of success and IlFalse
otherwise. If this is a one-tier table, this member function returns IlTrue
without having any side effects. Reimplemented in IliSQLTable.
void IliTable::releaseBuffer | ( | IliTableBuffer * | buff | ) |
Releases a table buffer.
Releases a table buffer that has been obtained with the getBuffer
member function.
buff | The table buffer. |
void IliTable::removeErrorSink | ( | IliErrorSink * | sink | ) |
Removes an error sink from this table.
Here is an example showing how errors can be trapped:
sink | The error sink. |
void IliTable::removeNamedPropertyManager | ( | const char * | name | ) |
Removes a property manager.
name | The property manager name. |
Removes a property from the part of the table.
Note: Accesses the default property manager.
rowno | The row position. |
colno | The column position. |
propName | The property name. |
|
protectedvirtual |
Called just after the row at position rowno
has changed (that is, when one or more values in the row have changed).
If only one value in the row has changed, it is preferable to call the cellChanged
member function instead of rowChanged
.
rowno | The row position. |
|
protectedvirtual |
Called just after a row has been removed from the table.
rowno | The row position. |
|
protectedvirtual |
Called just after a new row has been fetched from a remote database and inserted.
In this case the rowInserted
member function must also be called.
rowno | The row position. |
|
protectedvirtual |
Called just after a new row has been inserted.
rowno | The row position. |
Called just after a row has moved.
src | The origin row position. |
dest | The destination row position. |
|
protectedvirtual |
Called just before the row is changed.
rowno | The row position. |
|
protectedvirtual |
Called just before a row is removed from the table.
rowno | The row position. |
|
virtual |
Reads all rows from a remote database.
If the table (or subclass of the table) defines a mapping with a remote database, this member function clears the local row cache, and queries the database to obtain a new, up-to-date, set of rows.
IlTrue
if successful, and IlFalse
otherwise. Reimplemented in IliSQLTable.
Sets a value.
Changes the value in the column positioned at colno
of the row positioned at rowno
to value
. This member function calls the updateRow
member function. Note that if the table is a two-tier table (such as an IliSQLTable
object) and if more than one column must be changed at once, calling the set
member function twice (once for each column) does not necessarily have the same effect as using a table buffer, assigning the two columns in the table buffer, and calling the updateRow
member function once with that table buffer.
rowno | The row position. |
colno | The column position. |
value | The value. |
IlTrue
if successful. Sets a value.
Changes the value in the column named colname
of the row positioned at rowno
to value
.
rowno | The row position. |
colname | The name of the column. |
value | The value. |
IlTrue
if successful. void IliTable::setColumnForeignDataSourceName | ( | IlInt | colno, |
const char * | dsname | ||
) |
Sets the name of the foreign data source for one column.
colno | The column position. |
dsname | The data source name. If it is an empty string, the column has no defined foreign data source. |
void IliTable::setColumnForeignDisplayColumn | ( | IlInt | colno, |
const char * | name | ||
) |
Sets the name of the display column in the foreign table.
The column which is used to find a replacement value for the column. The column name is set to a copy.
colno | The column position. |
name | The name. |
Sets the foreign table of one column.
colno | The column position. |
table | The foreign table. |
void IliTable::setColumnForeignValueColumn | ( | IlInt | colno, |
const char * | name | ||
) |
Sets the name of the value column in the foreign table.
The column which the value of the column must be matched with, to yield a display value. The column name is set to a copy.
colno | The column position. |
name | The name. |
Specifies that the column is constrained to take its values from the domain of the value column of the foreign table.
colno | The column name. |
flag | The constraint flags. |
void IliTable::setCompareFunction | ( | IliCompareFunction | fct, |
IlAny | arg = 0 |
||
) |
Defines the function and user data that must be used to compare two rows.
fct | The function to compare. |
arg | The user data that can be used to compare two rows. |
void IliTable::setGadgetHolder | ( | IlvGadgetHolder * | gadHold | ) |
Attaches the table to a gadget holder.
gadHold | The gadget holder. If NULL , the table is detached from any gadget holder. |
Sets a value.
This member function is similar to the set
member function except that it calls updateRowInCache
instead of updateRow
. The effect is that if this is a two-tier table, the value is changed in the local row cache only.
rowno | The row position. |
colno | The column position. |
value | The value. |
IlTrue
if successful.
|
virtual |
Sets the value of the modified property of the table.
flag | The modified property of the table. |
void IliTable::setParameterColumnName | ( | IlInt | paramno, |
const char * | colname | ||
) |
Attaches a parameter to one column.
paramno | The parameter position. |
colname | The column name. If NULL or an empty string, the parameter is detached from any column it may be attached to. Value is copied by this member function. |
void IliTable::setParameterDataSourceName | ( | IlInt | paramno, |
const char * | dsname | ||
) |
Attaches one parameter to one data source.
paramno | The parameter position. |
dsname | The data source name. If NULL or an empty string, the parameter is detached from a data source. The value is copied. |
Sets the maximum length allowed for the parameter.
paramno | The parameter position. |
maxlen | The maximum length allowed. |
void IliTable::setParameterName | ( | IlInt | paramno, |
const char * | name | ||
) |
Sets a parameter name.
paramno | The parameter position. |
name | The parameter name. |
void IliTable::setParameterType | ( | IlInt | paramno, |
const IliDatatype * | type | ||
) |
Sets the type of one parameter.
paramno | The parameter position. |
type | The parameter type. |
Sets the value of one parameter.
paramno | The parameter position. |
value | The value. |
Sets the value of one parameter.
paramName | The parameter name. |
value | The value. |
void IliTable::setProperty | ( | IlInt | rowno, |
IlInt | colno, | ||
const IlvSymbol * | propName, | ||
const IliValue & | propVal | ||
) |
Sets a property value to a part of the table.
Note: Accesses the default property manager.
rowno | The row position. |
colno | The column position. |
propName | The property name. |
propVal | The value. propVal . |
void IliTable::setTransactionManager | ( | IliTransactionManager * | tm | ) |
Changes the transaction that manages this table.
tm | The transaction manager. If it is NULL , the table will not be managed by a transaction manager. |
void IliTable::setTransactionManagerName | ( | const char * | name | ) |
Changes the transaction that manages this table.
name | The transaction manager name, it is created if it does not already exist. |
void IliTable::sortRows | ( | const IlInt * | colnoArray, |
IlInt | columnsCount, | ||
IlInt | fromRow = 0 , |
||
IlInt | toRow = -1 , |
||
IliCompareFunction | fct = 0 , |
||
IlAny | data = 0 |
||
) |
Sorts a set of rows.
Sorts all rows between position fromRow
and position toRow
. If toRow
equals -1
, all rows starting at fromRow
are sorted. The sorting order is defined by the colnoArray
parameter, which designates an array of columnsCount
column positions. Each given column is sorted in the ascending or descending order of the values. The global functions IliAscOrder
and IliDescOrder
are used to indicate the type of sort. Example:
colnoArray | The column list. |
columnsCount | The column count. |
fromRow | The first row position. |
toRow | The last row position. |
fct | The function to compare. It uses to provide its own function to sort the rows. |
data | The user data that can be used to compare two rows. |
|
protectedvirtual |
Called when the IliTable
object has undergone a significant number of changes.
It is much more efficient to call this member function after a number of changes, instead of calling one of the specific member functions (described below) after each change.
|
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 in IliSQLTable, IliMemoryTable, and IliStringsTable.
|
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 in IliMemoryTable.
|
virtual |
Writes the definition of a schema to an output stream in a form suitable to be read back by the stream-based constructor.
output | The output stream. |
Reimplemented from IliSchema.
Reimplemented in IliSQLTable, IliMemoryTable, IliMapTable, and IliStringsTable.
void IliTable::writeTable | ( | IL_STDPREF ostream & | output | ) | const |
Writes the definition of the table to an output stream, in a form suitable to be read back by the ReadTable
static member function.
This member function can write any subclass of IliTable
.
output | The output stream. |
© Copyright 2015, 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.