Rogue Wave Views
Data Access Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IliMemoryTable Class Reference

Table class. More...

#include <ilviews/dataccess/memtable.h>

Inheritance diagram for IliMemoryTable:
IliTable IliSchema IliRefCounted IliSQLTable

Public Member Functions

 IliMemoryTable (IlvDisplay *display)
 Constructor. More...
 
 IliMemoryTable (IlvDisplay *display, IlInt rowsCount, const char *const *values, IlInt columnsCount=1, const char *const *columnNames=0)
 Constructor from a description. More...
 
 IliMemoryTable (const IliMemoryTable &tbl)
 Copy constructor. More...
 
virtual IlBoolean allowColumnMove () const
 Returns IlTrue if columns can be moved to this schema. More...
 
virtual IlBoolean allowRowMove () const
 Returns IlTrue if the table (or subclass of the table) allows row move operations. More...
 
virtual void clearRows ()
 Deletes all rows. More...
 
virtual IlBoolean deleteRow (IlInt)
 Deletes a row. More...
 
virtual IlBoolean deleteRowInCache (IlInt)
 Deletes a row. More...
 
virtual IlBoolean exchangeRows (IlInt, IlInt)
 Exchanges two rows. More...
 
virtual IlBoolean exchangeRowsInCache (IlInt, IlInt)
 Exchanges two rows. More...
 
virtual IlInt getRowsCount () const
 Returns the number of rows in the table. More...
 
virtual IliRowStatus getRowStatus (IlInt) const
 Returns the status of one row. More...
 
virtual IlBoolean getValue (IlInt, IlInt, IliValue &) const
 Returns a value. More...
 
virtual IlBoolean insertRow (IlInt, IliTableBuffer *)
 Inserts a row that is defined by the table buffer. More...
 
virtual IlBoolean insertRowInCache (IlInt, IliTableBuffer *)
 Inserts a row that is defined by the table buffer. More...
 
virtual IlBoolean moveRow (IlInt, IlInt)
 Moves a row. More...
 
virtual IlBoolean moveRowInCache (IlInt, IlInt)
 Moves a row. More...
 
virtual void setColumnMaxLength (IlInt, IlInt)
 Sets the maximum length for one column. More...
 
virtual void setColumnNullable (IlInt, IlBoolean)
 Determines if the column positioned at colno is nullable (that is, may contain null values). More...
 
virtual void setColumnType (IlInt, const IliDatatype *)
 Sets the type of the column. More...
 
virtual IlBoolean updateRow (IlInt, IliTableBuffer *)
 Updates a row with the values in the table buffer. More...
 
virtual IlBoolean updateRowInCache (IlInt, IliTableBuffer *)
 Updates a row. More...
 
virtual void write (IL_STDPREF ostream &output) const
 Writes to output stream. More...
 
- Public Member Functions inherited from IliTable
void addErrorSink (IliErrorSink *sink)
 Adds an error sink. 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...
 
IliTablecopyTable () const
 Returns a copy of the table. More...
 
void deleteParameter (IlInt paramno)
 Deletes a parameter. More...
 
void enableColumnCompletion (IlInt colno, IlBoolean flag)
 Specifies whether completion is enabled for the column. 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...
 
IliTableBuffergetBuffer ()
 Returns a table buffer for the table. More...
 
IlBoolean getColumnDisplayValue (IlInt colno, const IliValue &value, IliValue &displayValue, IlvGraphicHolder *h=0)
 Returns the display value for a value. More...
 
IliTablegetColumnEffectiveForeignTable (IlInt colno, IlvGraphicHolder *h=0) 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...
 
IliTablegetColumnForeignTable (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 IliTablePropertyManagergetDefaultPropertyManager () const
 Returns the default property manager. More...
 
IliTablePropertyManagergetDefaultPropertyManager ()
 Returns the default property manager. More...
 
IlvGadgetHolder * getGadgetHolder () const
 Returns the gadget holder to which the table is attached. More...
 
IliTablePropertyManagergetNamedPropertyManager (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 IliDatatypegetParameterType (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 IlvSymbolgetPropertyNameAt (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...
 
IliTransactionManagergetTransactionManager () 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 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...
 
IlBoolean isReadOnly () const
 Returns IlTrue if the table is read-only. More...
 
virtual IlBoolean isSelectDone () const
 Returns IlTrue if the select() member function has been called since the object was constructed. More...
 
virtual IliTablemakeQueryTable () const
 Returns a memory table having the same number of columns as this table. More...
 
IliTablePropertyManagernewNamedPropertyManager (const char *name)
 Creates and returns a new named property manager. More...
 
virtual IliTablePropertyManagernewPropertyManager ()
 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...
 
virtual void setReadOnly (IlBoolean readOnly)
 Specifies whether the table is read-only. 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...
 
void writeTable (std::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...
 
IlInt appendColumn (const char *name, const IliDatatype *type, IlInt maxlen=-1)
 Appends a new column to the schema. More...
 
const IliDatatypeasDatatype () 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 IliFormatgetColumnFormat (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 IliInputMaskgetColumnMask (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 IliDatatypegetColumnType (IlInt colno) const
 Returns the type of the column. More...
 
IlvDisplaygetDisplay () 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 IliSchemagetNestedSchema (const IliAttributePath &path) const
 Returns the nested schema. More...
 
IliSchemagetNestedSchema (const IliAttributePath &path)
 Returns the nested schema. More...
 
const char * getSchemaName () const
 Returns the schema name. More...
 
IlBoolean hasHook (IliTableHook *hook) const
 Returns IlTrue 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 setColumnName (IlInt colno, const char *colname)
 Sets the name of the column. 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 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from IliTable
static IliTableReadTable (IlvDisplay *disp, std::istream &input)
 Constructs and returns an instance of a subclass of IliTable by reading its definition from an input stream. More...
 
- Protected Member Functions inherited from IliTable
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...
 
- Protected Member Functions inherited from IliRefCounted
virtual ~IliRefCounted ()
 This is the virtual destructor of the IliRefCounted class. More...
 

Detailed Description

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.

See also
IliTable, IliStringType.

Accessors

Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue(), IlvValueInterface::queryValues(), IlvValueInterface::changeValue(), IlvValueInterface::changeValues(). This class inherits the accessors of its superclass IliTable.

Constructor & Destructor Documentation

§ IliMemoryTable() [1/3]

IliMemoryTable::IliMemoryTable ( IlvDisplay display)

Constructor.

This constructor initializes a memory table. Initially, this table has no columns and no rows.

Parameters
displayThe display.

§ IliMemoryTable() [2/3]

IliMemoryTable::IliMemoryTable ( IlvDisplay display,
IlInt  rowsCount,
const char *const *  values,
IlInt  columnsCount = 1,
const char *const *  columnNames = 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 columnNames array. The row cells take their initial values from the values array, which must be of size columnsCount × rowsCount. If the columnNames parameter is 0, 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.

Parameters
displayThe display.
rowsCountThe row count.
valuesThe values.
columnsCountThe column count.
columnNamesThe columns name.

§ IliMemoryTable() [3/3]

IliMemoryTable::IliMemoryTable ( const IliMemoryTable tbl)

Copy constructor.

This is the copy constructor of the IliMemoryTable class.

Parameters
tblThe table.

Member Function Documentation

§ allowColumnMove()

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.

Returns
IlTrue if columns can be moved to this schema, and IlFalse otherwise.

Reimplemented from IliSchema.

Reimplemented in IliSQLTable.

§ allowRowMove()

virtual IlBoolean IliMemoryTable::allowRowMove ( ) const
virtual

Returns IlTrue if the table (or subclass of the table) allows row move operations.

Returns
IlTrue if the table (or subclass of the table) allows row move operations.

Reimplemented from IliTable.

§ clearRows()

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.

§ deleteRow()

virtual IlBoolean IliMemoryTable::deleteRow ( IlInt  rowno)
virtual

Deletes a row.

Parameters
rownoThe row position.
Returns
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.

§ deleteRowInCache()

virtual IlBoolean IliMemoryTable::deleteRowInCache ( IlInt  rowno)
virtual

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.

Parameters
rownoThe row position.
Returns
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.

§ exchangeRows()

virtual IlBoolean IliMemoryTable::exchangeRows ( IlInt  rowno1,
IlInt  rowno2 
)
virtual

Exchanges two rows.

Parameters
rowno1The first row position.
rowno2The second row position.
Returns
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.

§ exchangeRowsInCache()

virtual IlBoolean IliMemoryTable::exchangeRowsInCache ( IlInt  rowno1,
IlInt  rowno2 
)
virtual

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.

Parameters
rowno1The first row position.
rowno2The second row position.
Returns
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.

§ getRowsCount()

virtual IlInt IliMemoryTable::getRowsCount ( ) const
virtual

Returns the number of rows in the table.

Returns
The count.

Reimplemented from IliTable.

Reimplemented in IliSQLTable.

§ getRowStatus()

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.

Parameters
rownoThe row position.
Returns
The status.

Reimplemented from IliTable.

§ getValue()

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.

Parameters
rownoThe row position.
colnoThe column position.
valueThe value.
Returns
IlTrue if successful.

Reimplemented from IliTable.

Reimplemented in IliSQLTable.

§ insertRow()

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.

Parameters
rownoThe row position.
buffThe table buffer.
Returns
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.

§ insertRowInCache()

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.

Parameters
rownoThe row position.
buffThe table buffer.
Returns
IlTrue if successful, and IlFalse if rowno is out of bounds, or if the row could not be inserted.

Reimplemented from IliTable.

§ moveRow()

virtual IlBoolean IliMemoryTable::moveRow ( IlInt  from,
IlInt  to 
)
virtual

Moves a row.

Parameters
fromThe origin row position.
toThe destination row position.
Returns
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.

§ moveRowInCache()

virtual IlBoolean IliMemoryTable::moveRowInCache ( IlInt  from,
IlInt  to 
)
virtual

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.

Parameters
fromThe origin row position.
toThe destination row position.
Returns
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.

§ setColumnMaxLength()

virtual void IliMemoryTable::setColumnMaxLength ( IlInt  colno,
IlInt  maxlen 
)
virtual

Sets the maximum length for one column.

Parameters
colnoThe column position.
maxlenThe maximum length.

Reimplemented from IliSchema.

§ setColumnNullable()

virtual void IliMemoryTable::setColumnNullable ( IlInt  colno,
IlBoolean  nullable 
)
virtual

Determines if the column positioned at colno is nullable (that is, may contain null values).

Parameters
colnoThe column position.
nullableIf IlTrue, the column is nullable.

Reimplemented from IliSchema.

§ setColumnType()

virtual void IliMemoryTable::setColumnType ( IlInt  colno,
const IliDatatype type 
)
virtual

Sets the type of the column.

Parameters
colnoThe column position.
typeThe column type.

Reimplemented from IliSchema.

§ updateRow()

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.

Parameters
rownoThe row position.
buffThe table buffer.
Returns
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.

§ updateRowInCache()

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.

Parameters
rownoThe row position.
buffThe table buffer.
Returns
IlTrue if successful and IlFalse if rowno is out of bounds, or if the row could not be updated.

Reimplemented from IliTable.

§ write()

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.

Parameters
outputThe output stream.

Reimplemented from IliTable.


© Copyright 2018, 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.