EPANET-RTX  1.1
real-time extension for the EPANET toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
RTX::OdbcPointRecord Class Referenceabstract

A persistence class for SCADA databases. More...

#include <OdbcPointRecord.h>

Inheritance diagram for RTX::OdbcPointRecord:
[legend]
Collaboration diagram for RTX::OdbcPointRecord:
[legend]

Classes

class  OdbcConnection
 
class  OdbcQuery
 
class  OdbcSqlHandle
 
class  OdbcTableDescription
 
struct  ScadaQuery
 
class  ScadaRecord
 

Public Types

enum  Sql_Connector_t { NO_CONNECTOR, wonderware_mssql, oracle, mssql }
 
typedef boost::shared_ptr
< OdbcPointRecord
sharedPointer
 
- Public Types inherited from RTX::DbPointRecord
typedef boost::shared_ptr
< DbPointRecord
sharedPointer
 
- Public Types inherited from RTX::BufferPointRecord
typedef boost::circular_buffer
< Point
PointBuffer_t
 
typedef std::pair
< PointBuffer_t,
boost::shared_ptr
< boost::signals2::mutex > > 
BufferMutexPair_t
 
typedef std::map< std::string,
BufferMutexPair_t > 
KeyedBufferMutexMap_t
 
typedef boost::shared_ptr
< BufferPointRecord
sharedPointer
 
- Public Types inherited from RTX::PointRecord
typedef boost::shared_ptr
< PointRecord
sharedPointer
 
typedef std::pair< time_t, time_t > time_pair_t
 

Public Member Functions

vector< string > dsnList ()
 
Sql_Connector_t connectorType ()
 
void setConnectorType (Sql_Connector_t connectorType)
 
virtual void dbConnect () throw (RtxException)
 
virtual bool isConnected ()
 
virtual std::string registerAndGetIdentifier (std::string recordName, Units dataUnits)
 
virtual std::vector< std::string > identifiers ()
 
virtual std::ostream & toStream (std::ostream &stream)
 
void setTimeFormat (PointRecordTime::time_format_t timeFormat)
 
PointRecordTime::time_format_t timeFormat ()
 
virtual bool supportsBoundedQueries ()
 
- Public Member Functions inherited from RTX::DbPointRecord
Point point (const string &id, time_t time)
 Get a Point with a specific name at a specific time. More...
 
Point pointBefore (const string &id, time_t time)
 
Point pointAfter (const string &id, time_t time)
 
std::vector< PointpointsInRange (const string &id, time_t startTime, time_t endTime)
 Get a vector of Points with a specific name within a specific time range. More...
 
void addPoint (const string &id, Point point)
 
void addPoints (const string &id, std::vector< Point > points)
 
void reset ()
 
void reset (const string &id)
 
virtual void invalidate (const string &identifier)
 
virtual std::vector< std::pair
< std::string, Units > > 
availableData ()
 
void setSearchDistance (time_t time)
 
time_t searchDistance ()
 
- Public Member Functions inherited from RTX::BufferPointRecord
 BufferPointRecord (int defaultCapacity=100)
 
virtual Point firstPoint (const string &id)
 
virtual Point lastPoint (const string &id)
 
virtual time_pair_t range (const string &id)
 
- Public Member Functions inherited from RTX::PointRecord
std::string name ()
 
void setName (std::string name)
 

Static Public Member Functions

static std::map
< Sql_Connector_t, OdbcQuery
queryTypes ()
 ! templates for selection queries
 
static Sql_Connector_t typeForName (const std::string &connector)
 

Public Attributes

OdbcConnection connection
 
OdbcTableDescription tableDescription
 
- Public Attributes inherited from RTX::DbPointRecord
std::string errorMessage
 

Protected Member Functions

void initDsnList ()
 
virtual void rebuildQueries ()
 
virtual std::vector< PointselectRange (const std::string &id, time_t startTime, time_t endTime)=0
 
virtual Point selectNext (const std::string &id, time_t time)=0
 
virtual Point selectPrevious (const std::string &id, time_t time)=0
 
virtual void insertSingle (const std::string &id, Point point)
 
virtual void insertRange (const std::string &id, std::vector< Point > points)
 
virtual void removeRecord (const std::string &id)
 
virtual void truncate ()
 
bool checkConnected ()
 
void bindOutputColumns (SQLHSTMT statement, ScadaRecord *record)
 
std::vector< PointpointsFromStatement (SQLHSTMT statement)
 
std::string extract_error (std::string function, SQLHANDLE handle, SQLSMALLINT type)
 

Protected Attributes

OdbcQuery _querySyntax
 
ScadaQuery _query
 
OdbcSqlHandle _handles
 
ScadaRecord _tempRecord
 
boost::signals2::mutex _odbcMutex
 
- Protected Attributes inherited from RTX::DbPointRecord
request_t request
 
- Protected Attributes inherited from RTX::PointRecord
std::string _cachedPointId
 
Point _cachedPoint
 
std::map< std::string, Point_pointCache
 

Detailed Description

A persistence class for SCADA databases.

Primarily to be used for data acquisition. Polls an ODBC-based SCADA connection for data and creates Points from that data.


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