DP3
Public Types | Public Member Functions | List of all members
dp3::parmdb::ParmFacadeRep Class Referenceabstract

Data access the parameter database. More...

#include <ParmFacadeRep.h>

Inheritance diagram for dp3::parmdb::ParmFacadeRep:
dp3::parmdb::ParmFacadeLocal

Public Types

typedef std::shared_ptr< ParmFacadeRepShPtr
 Define a shared_ptr for this class. More...
 

Public Member Functions

virtual ~ParmFacadeRep ()
 The destructor disconnects. More...
 
virtual void addDefValues (const casacore::Record &, bool check=true)=0
 
virtual void addValues (const casacore::Record &)=0
 
virtual void clearTables ()=0
 Clear the tables, thus remove all parameter values and default values. 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, double freqv1, double freqv2, double timev1, double timev2, bool asStartEnd)=0
 Delete the records for the given parameters and domain. More...
 
virtual void flush (bool fsync)=0
 Flush possible changes to disk. More...
 
virtual casacore::Record getCoeff (const std::string &parmNamePattern, double freqv1, double freqv2, double timev1, double timev2, bool asStartEnd)=0
 Get coefficients, errors, and domains they belong to. More...
 
virtual std::vector< double > getDefaultSteps () const =0
 Get the default step values for the axes. More...
 
virtual std::vector< std::string > getDefNames (const std::string &parmNamePattern) const =0
 
virtual casacore::Record getDefValues (const std::string &parmNamePattern) const =0
 Get the default values of parameters matching the pattern. More...
 
virtual std::vector< std::string > getNames (const std::string &parmNamePattern, bool includeDefaults) const =0
 
virtual std::vector< double > getRange (const std::string &parmNamePattern) const =0
 
virtual casacore::Record getValues (const std::string &parmNamePattern, const std::vector< double > &freqv1, const std::vector< double > &freqv2, const std::vector< double > &timev1, const std::vector< double > &timev2, bool asStartEnd, bool includeDefaults)=0
 
virtual casacore::Record getValues (const std::string &parmNamePattern, double freqv1, double freqv2, double freqStep, double timev1, double timev2, double timeStep, bool asStartEnd, bool includeDefaults)=0
 
virtual casacore::Record getValuesGrid (const std::string &parmNamePattern, double freqv1, double freqv2, double timev1, double timev2, bool asStartEnd)=0
 
virtual void setDefaultSteps (const std::vector< double > &)=0
 Set the default step values. More...
 
virtual void lock (bool lockForWrite)=0
 
virtual void unlock ()=0
 

Detailed Description

Data access the parameter database.

ParmFacadeRep is the high level interface to the Parameter Data Base. The current version assumes it is an AIPS++ table; with a few extra constructor arguments it can easily be changed to other types of databases. The class provides a few functions:

The parameter names can be given as a pattern. This is the same as a file name pattern that can be given in the UNIX shells (e.g. RA:*). Thus it is not a full regular expression.

Member Typedef Documentation

◆ ShPtr

Define a shared_ptr for this class.

Constructor & Destructor Documentation

◆ ~ParmFacadeRep()

virtual dp3::parmdb::ParmFacadeRep::~ParmFacadeRep ( )
virtual

The destructor disconnects.

Member Function Documentation

◆ addDefValues()

virtual void dp3::parmdb::ParmFacadeRep::addDefValues ( const casacore::Record &  ,
bool  check = true 
)
pure virtual

Add one or more default values. The name of each field in the record is the parameter name. The values are subrecords containing the parameter values, etc.
By default it checks if the name does not exist.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ addValues()

virtual void dp3::parmdb::ParmFacadeRep::addValues ( const casacore::Record &  )
pure virtual

Add the values for the given parameter names and domain. The name of each field in the record is the parameter name. The values are subrecords containing the domains, parameter values, etc.
It checks if no values exist for the parameters and domains yet.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ clearTables()

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

Clear the tables, thus remove all parameter values and default values.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ deleteDefValues()

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

Delete the default value records for the given parameters.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ deleteValues()

virtual void dp3::parmdb::ParmFacadeRep::deleteValues ( const std::string &  parmNamePattern,
double  freqv1,
double  freqv2,
double  timev1,
double  timev2,
bool  asStartEnd 
)
pure virtual

Delete the records for the given parameters and domain.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ flush()

virtual void dp3::parmdb::ParmFacadeRep::flush ( bool  fsync)
pure virtual

Flush possible changes to disk.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getCoeff()

virtual casacore::Record dp3::parmdb::ParmFacadeRep::getCoeff ( const std::string &  parmNamePattern,
double  freqv1,
double  freqv2,
double  timev1,
double  timev2,
bool  asStartEnd 
)
pure virtual

Get coefficients, errors, and domains they belong to.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getDefaultSteps()

virtual std::vector<double> dp3::parmdb::ParmFacadeRep::getDefaultSteps ( ) const
pure virtual

Get the default step values for the axes.

The following functions are only implemented for a local ParmDB. The ParmFacadeDistr functions throw an exception.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getDefNames()

virtual std::vector<std::string> dp3::parmdb::ParmFacadeRep::getDefNames ( const std::string &  parmNamePattern) const
pure virtual

Get default parameter names matching the pattern. An empty name pattern is the same as * (all parm names).

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getDefValues()

virtual casacore::Record dp3::parmdb::ParmFacadeRep::getDefValues ( const std::string &  parmNamePattern) const
pure virtual

Get the default values of parameters matching the pattern.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getNames()

virtual std::vector<std::string> dp3::parmdb::ParmFacadeRep::getNames ( const std::string &  parmNamePattern,
bool  includeDefaults 
) const
pure virtual

Get parameter names in the table matching the pattern. An empty name pattern is the same as * (all parm names).

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getRange()

virtual std::vector<double> dp3::parmdb::ParmFacadeRep::getRange ( const std::string &  parmNamePattern) const
pure virtual

Get the domain range (as startfreq,endfreq,starttime,endtime) of the given parameters in the table. This is the minimum start value and maximum end value for all parameters. An empty name pattern is the same as * (all parm names).

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getValues() [1/2]

virtual casacore::Record dp3::parmdb::ParmFacadeRep::getValues ( const std::string &  parmNamePattern,
const std::vector< double > &  freqv1,
const std::vector< double > &  freqv2,
const std::vector< double > &  timev1,
const std::vector< double > &  timev2,
bool  asStartEnd,
bool  includeDefaults 
)
pure virtual

Get the values of the given parameters on the given grid where v1/v2 represents center/width or start/end. The Record contains a map of parameter name to Array<double>.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getValues() [2/2]

virtual casacore::Record dp3::parmdb::ParmFacadeRep::getValues ( const std::string &  parmNamePattern,
double  freqv1,
double  freqv2,
double  freqStep,
double  timev1,
double  timev2,
double  timeStep,
bool  asStartEnd,
bool  includeDefaults 
)
pure virtual

Get the values of the given parameters on the given regular grid where v1/v2 represents center/width or start/end. The Record contains a map of parameter name to Array<double>.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ getValuesGrid()

virtual casacore::Record dp3::parmdb::ParmFacadeRep::getValuesGrid ( const std::string &  parmNamePattern,
double  freqv1,
double  freqv2,
double  timev1,
double  timev2,
bool  asStartEnd 
)
pure virtual

Get the values of the given parameters for the given domain. The Record contains a map of parameter name to Array<value>. Furthermore it contains a subrecord "_grid" containing the grid axes used for each parameters. Their names have the form parmname/xx where xx is freqs, freqwidths, times, and timewidths. Their values are the center and width of each cell.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ lock()

virtual void dp3::parmdb::ParmFacadeRep::lock ( bool  lockForWrite)
pure 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.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ setDefaultSteps()

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

Set the default step values.

Implemented in dp3::parmdb::ParmFacadeLocal.

◆ unlock()

virtual void dp3::parmdb::ParmFacadeRep::unlock ( )
pure virtual

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