casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
casa::TBTableDriver Class Referenceabstract

Driver for interacting with the table on disk. More...

#include <TBTableDriver.h>

Inheritance diagram for casa::TBTableDriver:
casa::TBTableDriverDirect casa::TBTableDriverXML

Public Member Functions

 TBTableDriver (TableParams *tp, TBTable *table)
 Constructor that takes the table and the table parameters. More...
 
virtual ~TBTableDriver ()
 
void setPrintDebug (bool pdb)
 Sets whether the driver should print debug information or not. More...
 
virtual bool canRead ()=0
 canRead() must be implemented by any subclass. More...
 
virtual bool canWrite ()=0
 canWrite() must be implemented by any subclass. More...
 
virtual bool tryWriteLock ()=0
 tryWriteLock() must be implemented by any subclass. More...
 
virtual bool releaseWriteLock ()=0
 releaseWriteLock() must be implemented by any subclass. More...
 
virtual Result loadRows (int start=0, int num=TBConstants::DEFAULT_SELECT_NUM, bool full=false, std::vector< casacore::String > *fields=NULL, bool parsedata=true, ProgressHelper *pp=NULL)=0
 loadRows() must be implemented by any subclass. More...
 
virtual void loadArray (TBArrayData *d, unsigned int row, unsigned int col)=0
 loadArray() must be implemented by any subclass. More...
 
virtual std::vector< int > dimensionsOf (unsigned int col)=0
 dimensionsOf() must be implemented by any subclass. More...
 
virtual Result editData (unsigned int row, unsigned int col, TBData *newVal, std::vector< int > *d=NULL)=0
 editData() must be implemented by any subclass. More...
 
virtual int totalRowsOf (casacore::String location)=0
 totalRowsOf() must be implemented by any subclass. More...
 
virtual Result insertRows (int n)=0
 insertRows() must be implemented by any subclass. More...
 
virtual Result deleteRows (std::vector< int > r)=0
 deleteRows() must be implemented by any subclass. More...
 

Protected Attributes

casacore::String location
 The location of the table. More...
 
bool & insertRow
 Reference to the table's insertRow parameter. More...
 
bool & removeRow
 Reference to the table's removeRow parameter. More...
 
std::vector< std::vector
< TBData * > * > & 
data
 Reference to the table's data parameter. More...
 
std::vector< TBField * > & fields
 Reference to the table's fields parameter. More...
 
std::vector< TBKeyword * > & keywords
 Reference to the table's keywords parameter. More...
 
std::vector< int > & subtableRows
 Reference to the table's subtableRows parameter. More...
 
int & totalRows
 Reference to the table's totalRows parameter. More...
 
int & loadedRows
 Reference to the table's loadedRows parameter. More...
 
std::vector< bool > & writable
 Reference to the table's writable parameter. More...
 
bool & taql
 Reference to the table's taql parameter. More...
 
DriverParamsdp
 Copy of the table's driver parameters. More...
 
bool printdebug
 Indicates whether the driver should print debug information or not. More...
 
TBTabletable
 Reference to the table. More...
 

Detailed Description

Driver for interacting with the table on disk.

Synopsis

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 68 of file TBTableDriver.h.

Constructor & Destructor Documentation

casa::TBTableDriver::TBTableDriver ( TableParams tp,
TBTable table 
)

Constructor that takes the table and the table parameters.

virtual casa::TBTableDriver::~TBTableDriver ( )
virtual

Member Function Documentation

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 ( std::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 std::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,
std::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,
std::vector< casacore::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.

virtual int casa::TBTableDriver::totalRowsOf ( casacore::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.

Member Data Documentation

std::vector<std::vector<TBData*>*>& casa::TBTableDriver::data
protected

Reference to the table's data parameter.

Definition at line 155 of file TBTableDriver.h.

DriverParams* casa::TBTableDriver::dp
protected

Copy of the table's driver parameters.

Definition at line 179 of file TBTableDriver.h.

std::vector<TBField*>& casa::TBTableDriver::fields
protected

Reference to the table's fields parameter.

Definition at line 158 of file TBTableDriver.h.

bool& casa::TBTableDriver::insertRow
protected

Reference to the table's insertRow parameter.

Definition at line 149 of file TBTableDriver.h.

std::vector<TBKeyword*>& casa::TBTableDriver::keywords
protected

Reference to the table's keywords parameter.

Definition at line 161 of file TBTableDriver.h.

int& casa::TBTableDriver::loadedRows
protected

Reference to the table's loadedRows parameter.

Definition at line 170 of file TBTableDriver.h.

casacore::String casa::TBTableDriver::location
protected

The location of the table.

Definition at line 146 of file TBTableDriver.h.

bool casa::TBTableDriver::printdebug
protected

Indicates whether the driver should print debug information or not.

Definition at line 182 of file TBTableDriver.h.

bool& casa::TBTableDriver::removeRow
protected

Reference to the table's removeRow parameter.

Definition at line 152 of file TBTableDriver.h.

std::vector<int>& casa::TBTableDriver::subtableRows
protected

Reference to the table's subtableRows parameter.

Definition at line 164 of file TBTableDriver.h.

TBTable* casa::TBTableDriver::table
protected

Reference to the table.

Definition at line 185 of file TBTableDriver.h.

bool& casa::TBTableDriver::taql
protected

Reference to the table's taql parameter.

Definition at line 176 of file TBTableDriver.h.

int& casa::TBTableDriver::totalRows
protected

Reference to the table's totalRows parameter.

Definition at line 167 of file TBTableDriver.h.

std::vector<bool>& casa::TBTableDriver::writable
protected

Reference to the table's writable parameter.

Definition at line 173 of file TBTableDriver.h.


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