1 #ifndef CARMA_DBMS_MONITORCONFIGURATIONDATABASE_H
2 #define CARMA_DBMS_MONITORCONFIGURATIONDATABASE_H
18 #include "carma/util/Logger.h"
25 class MonitorDescription;
54 bool ignoreCase =
false )
const;
85 const ::std::string & name,
88 unsigned maxpoints )
const;
161 bool updateOnlyIfNecessary =
true )
const;
172 bool updateOnlyIfNecessary =
true,
173 bool noInsertDenied=
false )
const;
196 unsigned tagID, const ::std::string &mpName,
197 const ::std::string &fieldName,
198 const ::std::string &newValue,
199 const ::std::string &requester);
221 const ::std::string & canonicalName,
259 const ::std::vector< int > *
const tagIDs = 0,
260 bool retreiveOnlyValidConfigs =
false,
275 const ::std::vector< int > * tagIDs,
302 unsigned getMaxTagID(
unsigned short subsysID )
const;
322 ::std::string & cname,
323 ::std::string & mpname)
const;
365 int getTagID( const ::std::string & mpName )
const;
398 ::std::map< int, ::std::string >
getTagIDs(
399 const ::std::string & wildcardedName,
400 const ::std::string & multiCharacterWildcard =
"%",
401 const ::std::string & singleCharacterWildcard =
"_" )
const;
490 const ::std::string & signature,
491 bool updateOnlyIfNecessary =
true )
const;
538 void setEnumerators_(
int tagID,
539 const ::std::string & name,
553 void getEnumerators_(
unsigned tagID,
554 const ::std::string * name,
563 void insertEnumerators_(
unsigned tagID,
572 bool mutateEnumerator(
575 unsigned tagID,
const std::string &mpName,
576 const std::string &fieldName,
const std::string &newValue,
577 const std::string &username);
580 int getMaxVersionNumber(
const std::string &mpname)
const;
586 unsigned tagID, const ::std::string &mpName,
587 const ::std::string &userName);
599 const ::std::string &mpname, const ::std::string &fieldname,
600 const ::std::string &newValue, const ::std::string &oldValue,
601 const ::std::string &userName,
int index=0);
607 bool getEnumID(const ::std::string &enumName,
608 const ::std::string &description,
617 short getLocationID_( const ::std::string & locationName,
618 bool ignoreCase =
false )
const;
629 ::std::string * getLocationName_(
unsigned short locationID )
const;
638 short getDeviceID_( const ::std::string & deviceName,
639 bool ignoreCase =
false )
const;
650 ::std::string * getDeviceName_(
unsigned short deviceID )
const;
654 log4cpp::Category & logger_;
662 #endif // CARMA_DBMS_MONITORCONFIGURATIONDATABASE_H
bool monitorConfigExists(const ::std::string &canonicalName) const
does the monitor configuration exist in the db?
Class to mimic a db table The Table class is meant to mimic a database table.
template to mimic a db column.
bool insertTagIDNameSignaturesRecord(util::frameType frameCount, const ::std::string &signature, bool updateOnlyIfNecessary=true) const
get the maximum length permitted for the shortName of a monitor point
void getContainerAndMPNames(const char *hname,::std::string &cname,::std::string &mpname) const
get the conanical container name and monitor point name of a monitor point with the specified canonic...
::std::map< int,::std::string > getTagIDs(const ::std::string &wildcardedName, const ::std::string &multiCharacterWildcard="%", const ::std::string &singleCharacterWildcard="_") const
get the tagIDs corresponding to the specified canonical names
dbms::Table getTagIDNameSignatures(const dbms::DBColumn *orderBy, dbms::SortOrder sortOrder=dbms::DESCENDING) const
get the TagIDNameSignatures table
dbms::ID2MDMap getMonitorConfigurations(const ::std::vector< int > *tagIDs, util::frameType frameCount=util::Time::computeCurrentFrame()) const
get monitor configuration info for the specified tagIDs
::std::string * getSubsystemName(unsigned short subsysID) const
get the subsystem name associated with the specified subsystem ID callers are responsible for deletin...
::std::string * getTagIDNameSignature(util::frameType frameCount=util::Time::computeCurrentFrame()) const
get the tagID->canonical names map signature valid at the specified frame count.
::std::map< int,::std::string > getTagID2NameMap() const
get a map of tagid's to canonical names of monitor points
bool mutateStaticParms(const ::std::string &disposition, unsigned tagID, const ::std::string &mpName, const ::std::string &fieldName, const ::std::string &newValue, const ::std::string &requester)
Change a value in the static parameter table for a monitor point.
dbms::Table getDevicesTable() const
get the devices table
bool tagIDExists(int tagID) const
Does the specified tagID exist in the DB?
unsigned int frameType
Half second frames since Jan 1, 2000.
int getTagID(const ::std::string &mpName) const
get the tagID associated with the specified monitor point name
This class contains methods for accessing monitor configuration information.
A MonitorDescription object holds all information on a monitor point which is stored in the database ...
dbms::Table getAggregateSubsystemsTable() const
get the aggregate subsystems table
void populateMonitorPointTypesTable() const
populate the MonitorPointTypes table
dbms::Table getValiditiesTable() const
get the Validities table
dbms::Table getMonitorPointTypesTable() const
get the MonitorPointTypes table
SortOrder
enum representing table sort order in an order by clause
static frameType computeCurrentFrame()
Get integral half-second frame since 2000, rounded down.
void populateLocationsTable() const
populate the Locations table
dbms::Table getMonitorPointDataTypesTable() const
get the MonitorPointDataTypes table
dbms::MonitorDescription tableRow2MonitorDescription(const dbms::Table &t, int row) const
transform a monitor configuration represented by a table row into a MonitorDescription object...
void insertAggregateSubsystemsRecord(const ::std::string &name, unsigned count, unsigned maxsamples, unsigned maxpoints) const
insert a record into the aggregate subsystems table
dbms::Table getBlankingFlagsTable() const
get the BlankingFlags table
void populateBlankingFlagsTable() const
populate the Validities table
void populateMonitorPointDataTypesTable() const
populate the MonitorPointDataTypes table
dbms::Table getTagIDToDataTypeIDTable() const
get a table containing the tagID to dataTypeID mappings for all monitor points
access of column names in the database
dbms::Table getFullMonitorConfigurationTable(const ::std::vector< int > *const tagIDs=0, bool retreiveOnlyValidConfigs=false, util::frameType frameCount=util::Time::computeCurrentFrame()) const
get the full monitor configuration table (static parms table joined with changable parms table + join...
short getSubsystemID(const ::std::string &subsysName, bool ignoreCase=false) const
get the ID for the specified subsystem
::std::string * getCurrentTagIDNameSignature() const
get the currently valid tagID->canonical names map signature the returned pointer is created by by th...
dbms::Table getSubsystemsTable() const
get the subsystem table
void populateSubsystemsTable() const
populate the Subsystem table using values from monitor::TagIDAuthority::subsysnames ...
void populateValiditiesTable() const
populate the Validities table
unsigned getMaxTagID(unsigned short subsysID) const
get the maximum tagID for the specified subsystem
void populateDevicesTable() const
populate the Devices table using values from monitor::PhysicalDeviceIDAuthority::deviceNames if an ID...
unsigned getTotalMaxSamples() const
get the value of maxsamples summed over all subsystems
MonitorDescription getMonitorConfiguration(const ::std::string &canonicalName, util::frameType frameCount=util::Time::computeCurrentFrame()) const
get monitor description associated with the specified canonical name which is valid at the specified ...
an abstract class from which database queries may be launched.
unsigned insertMonitorConfiguration(const MonitorDescription &md, bool updateOnlyIfNecessary=true) const
add a monitor point configuration to the database
unsigned getTotalMaxPoints() const
get the value of maxpoints summed over all subsystems
::std::string getCanonicalName(const int tagID) const
get the canonical name for a monitor point associated with the specified tagId
std::map< const int, const carma::dbms::MonitorDescription > ID2MDMap
map of id (normally a tagID) -> monitor configuration
MonitorConfigurationDatabase(const DBConnection *dbc)
constructor
dbms::Table getLocationsTable() const
get the location table