casa
$Rev:20696$
|
Driver for interacting with the table on disk. More...
#include <TBTableDriver.h>
Public Member Functions | |
TBTableDriver (TableParams *tp, TBTable *table) | |
Constructor that takes the table and the table parameters. | |
virtual | ~TBTableDriver () |
void | setPrintDebug (bool pdb) |
Sets whether the driver should print debug information or not. | |
virtual bool | canRead ()=0 |
canRead() must be implemented by any subclass. | |
virtual bool | canWrite ()=0 |
canWrite() must be implemented by any subclass. | |
virtual bool | tryWriteLock ()=0 |
tryWriteLock() must be implemented by any subclass. | |
virtual bool | releaseWriteLock ()=0 |
releaseWriteLock() must be implemented by any subclass. | |
virtual Result | loadRows (int start=0, int num=TBConstants::DEFAULT_SELECT_NUM, bool full=false, vector< String > *fields=NULL, bool parsedata=true, ProgressHelper *pp=NULL)=0 |
loadRows() must be implemented by any subclass. | |
virtual void | loadArray (TBArrayData *d, unsigned int row, unsigned int col)=0 |
loadArray() must be implemented by any subclass. | |
virtual vector< int > | dimensionsOf (unsigned int col)=0 |
dimensionsOf() must be implemented by any subclass. | |
virtual Result | editData (unsigned int row, unsigned int col, TBData *newVal, vector< int > *d=NULL)=0 |
editData() must be implemented by any subclass. | |
virtual int | totalRowsOf (String location)=0 |
totalRowsOf() must be implemented by any subclass. | |
virtual Result | insertRows (int n)=0 |
insertRows() must be implemented by any subclass. | |
virtual Result | deleteRows (vector< int > r)=0 |
deleteRows() must be implemented by any subclass. | |
Protected Attributes | |
String | location |
The location of the table. | |
bool & | insertRow |
Reference to the table's insertRow parameter. | |
bool & | removeRow |
Reference to the table's removeRow parameter. | |
vector< vector< TBData * > * > & | data |
Reference to the table's data parameter. | |
vector< TBField * > & | fields |
Reference to the table's fields parameter. | |
vector< TBKeyword * > & | keywords |
Reference to the table's keywords parameter. | |
vector< int > & | subtableRows |
Reference to the table's subtableRows parameter. | |
int & | totalRows |
Reference to the table's totalRows parameter. | |
int & | loadedRows |
Reference to the table's loadedRows parameter. | |
vector< bool > & | writable |
Reference to the table's writable parameter. | |
bool & | taql |
Reference to the table's taql parameter. | |
DriverParams * | dp |
Copy of the table's driver parameters. | |
bool | printdebug |
Indicates whether the driver should print debug information or not. | |
TBTable * | table |
Reference to the table. |
Driver for interacting with the table on disk.
TBTableDriver is an abstract superclass that defines how any implementing subclass must behave in order to be used by a TBTable. Any implementing subclass should update the table parameters that the driver has references to via the TableParams passed into the constructor.
Definition at line 67 of file TBTableDriver.h.
casa::TBTableDriver::TBTableDriver | ( | TableParams * | tp, |
TBTable * | table | ||
) |
Constructor that takes the table and the table parameters.
virtual casa::TBTableDriver::~TBTableDriver | ( | ) | [virtual] |
virtual bool casa::TBTableDriver::canRead | ( | ) | [pure virtual] |
canRead() must be implemented by any subclass.
Returns whether or not the underlying table can be read (i.e., the read lock is set). Does not necessary guarantee that the next read operation will succeed, but a sufficiently close check before a read should suffice in most situations.
Implemented in casa::TBTableDriverDirect.
virtual bool casa::TBTableDriver::canWrite | ( | ) | [pure virtual] |
canWrite() must be implemented by any subclass.
Returns whether or not the underlying table can be written (i.e., the write lock is set). Does not necessary guarantee that the next write operation will succeed, but a sufficiently close check before a write should suffice in most situations.
Implemented in casa::TBTableDriverDirect.
virtual Result casa::TBTableDriver::deleteRows | ( | vector< int > | r | ) | [pure virtual] |
deleteRows() must be implemented by any subclass.
Deletes the given rows. See TBTable::deleteRows().
Implemented in casa::TBTableDriverXML, and casa::TBTableDriverDirect.
virtual vector<int> casa::TBTableDriver::dimensionsOf | ( | unsigned int | col | ) | [pure virtual] |
dimensionsOf() must be implemented by any subclass.
Returns the array dimensions of the given field. See TBTable::dimensionsOf().
Implemented in casa::TBTableDriverXML, and casa::TBTableDriverDirect.
virtual Result casa::TBTableDriver::editData | ( | unsigned int | row, |
unsigned int | col, | ||
TBData * | newVal, | ||
vector< int > * | d = NULL |
||
) | [pure virtual] |
editData() must be implemented by any subclass.
Updates the cell at the given coordinates to have the given value. If the data is an array, the array coordinates are provided in d. Returns the result of the operation.
Implemented in casa::TBTableDriverXML, and casa::TBTableDriverDirect.
virtual Result casa::TBTableDriver::insertRows | ( | int | n | ) | [pure virtual] |
insertRows() must be implemented by any subclass.
Inserts the given number of rows at the end of the table. See TBTable::insertRows().
Implemented in casa::TBTableDriverXML, and casa::TBTableDriverDirect.
virtual void casa::TBTableDriver::loadArray | ( | TBArrayData * | d, |
unsigned int | row, | ||
unsigned int | col | ||
) | [pure virtual] |
loadArray() must be implemented by any subclass.
Loads the data into the given array at the given coordinates.
Implemented in casa::TBTableDriverXML, and casa::TBTableDriverDirect.
virtual Result casa::TBTableDriver::loadRows | ( | int | start = 0 , |
int | num = TBConstants::DEFAULT_SELECT_NUM , |
||
bool | full = false , |
||
vector< String > * | fields = NULL , |
||
bool | parsedata = true , |
||
ProgressHelper * | pp = NULL |
||
) | [pure virtual] |
loadRows() must be implemented by any subclass.
Loads the given rows into the table. See TBTable::loadRows();
Implemented in casa::TBTableDriverXML, and casa::TBTableDriverDirect.
virtual bool casa::TBTableDriver::releaseWriteLock | ( | ) | [pure virtual] |
releaseWriteLock() must be implemented by any subclass.
Releases the write lock if needed.
Implemented in casa::TBTableDriverDirect.
void casa::TBTableDriver::setPrintDebug | ( | bool | pdb | ) |
Sets whether the driver should print debug information or not.
Reimplemented in casa::TBTableDriverXML.
virtual int casa::TBTableDriver::totalRowsOf | ( | String | location | ) | [pure virtual] |
totalRowsOf() must be implemented by any subclass.
Returns the total rows of the table at the given location. See TBTable::totalRowsOf().
Implemented in casa::TBTableDriverXML, and casa::TBTableDriverDirect.
virtual bool casa::TBTableDriver::tryWriteLock | ( | ) | [pure virtual] |
tryWriteLock() must be implemented by any subclass.
Tries to reopen the table using a write lock, and returns whether the operation succeeded or not. This MUST be done before any editing operations, and the lock should be released afterwards using releaseWriteLock().
Implemented in casa::TBTableDriverDirect.
vector<vector<TBData*>*>& casa::TBTableDriver::data [protected] |
DriverParams* casa::TBTableDriver::dp [protected] |
Copy of the table's driver parameters.
Definition at line 178 of file TBTableDriver.h.
vector<TBField*>& casa::TBTableDriver::fields [protected] |
Reference to the table's fields parameter.
Definition at line 157 of file TBTableDriver.h.
bool& casa::TBTableDriver::insertRow [protected] |
Reference to the table's insertRow parameter.
Definition at line 148 of file TBTableDriver.h.
vector<TBKeyword*>& casa::TBTableDriver::keywords [protected] |
Reference to the table's keywords parameter.
Definition at line 160 of file TBTableDriver.h.
int& casa::TBTableDriver::loadedRows [protected] |
Reference to the table's loadedRows parameter.
Definition at line 169 of file TBTableDriver.h.
String casa::TBTableDriver::location [protected] |
The location of the table.
Definition at line 145 of file TBTableDriver.h.
bool casa::TBTableDriver::printdebug [protected] |
Indicates whether the driver should print debug information or not.
Definition at line 181 of file TBTableDriver.h.
bool& casa::TBTableDriver::removeRow [protected] |
Reference to the table's removeRow parameter.
Definition at line 151 of file TBTableDriver.h.
vector<int>& casa::TBTableDriver::subtableRows [protected] |
Reference to the table's subtableRows parameter.
Definition at line 163 of file TBTableDriver.h.
TBTable* casa::TBTableDriver::table [protected] |
Reference to the table.
Definition at line 184 of file TBTableDriver.h.
bool& casa::TBTableDriver::taql [protected] |
Reference to the table's taql parameter.
Definition at line 175 of file TBTableDriver.h.
int& casa::TBTableDriver::totalRows [protected] |
Reference to the table's totalRows parameter.
Definition at line 166 of file TBTableDriver.h.
vector<bool>& casa::TBTableDriver::writable [protected] |
Reference to the table's writable parameter.
Definition at line 172 of file TBTableDriver.h.