DP3
Public Member Functions | Protected Member Functions | List of all members
dp3::parmdb::ParmDBRep Class Referenceabstract

Abstract base class for a table holding parameters. More...

#include <ParmDB.h>

Inheritance diagram for dp3::parmdb::ParmDBRep:
dp3::parmdb::ParmDBBlob dp3::parmdb::ParmDBCasa

Public Member Functions

 ParmDBRep ()
 
virtual ~ParmDBRep ()
 
void clearDefFilled ()
 
virtual void clearTables ()=0
 Clear database or table. More...
 
virtual void deleteDefValues (const std::string &parmNamePattern)=0
 Delete the default value records for the given parameters. More...
 
virtual void deleteValues (const std::string &parmNamePattern, const Box &domain)=0
 Delete the records for the given parameters and domain. More...
 
virtual void flush (bool fsync)
 
const std::vector< double > & getDefaultSteps () const
 Get the default step values for the axes. More...
 
ParmValueSet getDefValue (const std::string &parmName, const ParmValue &defaultValue)
 
virtual void getDefValues (ParmMap &result, const std::string &parmNamePattern)=0
 
virtual int getNameId (const std::string &parmName)=0
 
virtual std::vector< std::string > getNames (const std::string &pattern)=0
 Get the names of all parms matching the given (filename like) pattern. More...
 
virtual void getValues (std::vector< ParmValueSet > &values, const std::vector< unsigned int > &nameIds, const std::vector< ParmId > &parmIds, const Box &domain)=0
 
virtual void getValuesPattern (ParmMap &result, const std::string &parmNamePattern, const Box &domain)
 
void link ()
 Link to the DBRep by incrementing the count. More...
 
virtual void putDefValue (const std::string &parmName, const ParmValueSet &value, bool check=true)=0
 Put the default value. More...
 
virtual void putValues (const std::string &parmName, int &nameId, ParmValueSet &values)=0
 
virtual void setDefaultSteps (const std::vector< double > &)=0
 Set the default step values. More...
 
int unlink ()
 Unlink by decrementing the count. More...
 
virtual void lock (bool lockForWrite)
 
virtual void unlock ()
 
virtual Box getRange (const std::string &parmNamePattern) const =0
 
virtual Box getRange (const std::vector< std::string > &parmNames) const =0
 
void setParmDBMeta (const ParmDBMeta &ptm)
 
const ParmDBMetagetParmDBMeta () const
 
void setParmDBSeqNr (int seqnr)
 
int getParmDBSeqNr () const
 

Protected Member Functions

void setDefStep (unsigned int i, double value)
 Set the i-th default step value (i<2) in order x,y. More...
 

Detailed Description

Abstract base class for a table holding parameters.

Constructor & Destructor Documentation

◆ ParmDBRep()

dp3::parmdb::ParmDBRep::ParmDBRep ( )

◆ ~ParmDBRep()

virtual dp3::parmdb::ParmDBRep::~ParmDBRep ( )
virtual

Member Function Documentation

◆ clearDefFilled()

void dp3::parmdb::ParmDBRep::clearDefFilled ( )
inline

Set the default value map to being not filled. This is needed after a delete, etc.

◆ clearTables()

virtual void dp3::parmdb::ParmDBRep::clearTables ( )
pure virtual

Clear database or table.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ deleteDefValues()

virtual void dp3::parmdb::ParmDBRep::deleteDefValues ( const std::string &  parmNamePattern)
pure virtual

Delete the default value records for the given parameters.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ deleteValues()

virtual void dp3::parmdb::ParmDBRep::deleteValues ( const std::string &  parmNamePattern,
const Box domain 
)
pure virtual

Delete the records for the given parameters and domain.

Put the value for the given parameters and domain. It only writes the parameters that have the same DBSeqNr as this ParmDB. overwriteMask=true indicates that the solvableMask might be changed and should be overwritten in an existing record.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ flush()

virtual void dp3::parmdb::ParmDBRep::flush ( bool  fsync)
virtual

Flush possible changes to disk.
If fsync=True the file contents are fsync-ed to disk, to ensure that the system buffers are actually written to disk. The default implementation does nothing.

Reimplemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ getDefaultSteps()

const std::vector<double>& dp3::parmdb::ParmDBRep::getDefaultSteps ( ) const
inline

Get the default step values for the axes.

◆ getDefValue()

ParmValueSet dp3::parmdb::ParmDBRep::getDefValue ( const std::string &  parmName,
const ParmValue defaultValue 
)

Get the default value for the given parameter. If no default value is defined in the ParmDB, the given default value will be used.

◆ getDefValues()

virtual void dp3::parmdb::ParmDBRep::getDefValues ( ParmMap result,
const std::string &  parmNamePattern 
)
pure virtual

Get the default value for the given parameters. Only * and ? should be used in the pattern (no [] and {}).

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ getNameId()

virtual int dp3::parmdb::ParmDBRep::getNameId ( const std::string &  parmName)
pure virtual

Get the id of a parameter. If not found in the Names table, it returns -1.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ getNames()

virtual std::vector<std::string> dp3::parmdb::ParmDBRep::getNames ( const std::string &  pattern)
pure virtual

Get the names of all parms matching the given (filename like) pattern.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ getParmDBMeta()

const ParmDBMeta& dp3::parmdb::ParmDBRep::getParmDBMeta ( ) const
inline

◆ getParmDBSeqNr()

int dp3::parmdb::ParmDBRep::getParmDBSeqNr ( ) const
inline

◆ getRange() [1/2]

virtual Box dp3::parmdb::ParmDBRep::getRange ( const std::string &  parmNamePattern) const
pure virtual

Get the domain range (freq,time) of the given parameters in the table. This is the minimum and maximum value of these axes for all parameters. An empty name pattern is the same as * (all parms).

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ getRange() [2/2]

virtual Box dp3::parmdb::ParmDBRep::getRange ( const std::vector< std::string > &  parmNames) const
pure virtual

◆ getValues()

virtual void dp3::parmdb::ParmDBRep::getValues ( std::vector< ParmValueSet > &  values,
const std::vector< unsigned int > &  nameIds,
const std::vector< ParmId > &  parmIds,
const Box domain 
)
pure virtual

Get the parameter values for the given parameters and domain. The parmids form the indices in the result vector.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ getValuesPattern()

virtual void dp3::parmdb::ParmDBRep::getValuesPattern ( ParmMap result,
const std::string &  parmNamePattern,
const Box domain 
)
virtual

Get the parameter values for the given parameters and domain. Only * and ? should be used in the pattern (no [] and {}). The default implementation uses the following getValues function.

◆ link()

void dp3::parmdb::ParmDBRep::link ( )
inline

Link to the DBRep by incrementing the count.

◆ lock()

virtual void dp3::parmdb::ParmDBRep::lock ( bool  lockForWrite)
virtual

Writelock and unlock the database tables. The user does not need to lock/unlock, but it can increase performance if many small accesses have to be done. The default implementation does nothing.

Reimplemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ putDefValue()

virtual void dp3::parmdb::ParmDBRep::putDefValue ( const std::string &  parmName,
const ParmValueSet value,
bool  check = true 
)
pure virtual

Put the default value.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ putValues()

virtual void dp3::parmdb::ParmDBRep::putValues ( const std::string &  parmName,
int &  nameId,
ParmValueSet values 
)
pure virtual

Put the values for the given parameter name and id. If it is a new value, the new rowid will be stored in the ParmValueSet. If it is a new name, the nameId will be filled in.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ setDefaultSteps()

virtual void dp3::parmdb::ParmDBRep::setDefaultSteps ( const std::vector< double > &  )
pure virtual

Set the default step values.

Implemented in dp3::parmdb::ParmDBCasa, and dp3::parmdb::ParmDBBlob.

◆ setDefStep()

void dp3::parmdb::ParmDBRep::setDefStep ( unsigned int  i,
double  value 
)
inlineprotected

Set the i-th default step value (i<2) in order x,y.

◆ setParmDBMeta()

void dp3::parmdb::ParmDBRep::setParmDBMeta ( const ParmDBMeta ptm)
inline

Set or get the name and type.

◆ setParmDBSeqNr()

void dp3::parmdb::ParmDBRep::setParmDBSeqNr ( int  seqnr)
inline

Set or get ParmDB sequence nr.

◆ unlink()

int dp3::parmdb::ParmDBRep::unlink ( )
inline

Unlink by decrementing the count.

◆ unlock()

virtual void dp3::parmdb::ParmDBRep::unlock ( )
virtual

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