EPANET-RTX  1.1
real-time extension for the EPANET toolkit
Public Types | Public Member Functions | Protected Attributes | List of all members
RTX::PointRecord Class Reference

A Point Record Class for storing and retrieving Points. More...

#include <PointRecord.h>

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

Public Types

typedef boost::shared_ptr
< PointRecord
sharedPointer
 
typedef std::pair< time_t, time_t > time_pair_t
 

Public Member Functions

std::string name ()
 
void setName (std::string name)
 
virtual std::string registerAndGetIdentifier (std::string recordName, Units dataUnits)
 
virtual std::vector< std::string > identifiers ()
 
virtual Point point (const string &identifier, time_t time)
 Get a Point with a specific name at a specific time. More...
 
virtual Point pointBefore (const string &identifier, time_t time)
 
virtual Point pointAfter (const string &identifier, time_t time)
 
virtual std::vector< PointpointsInRange (const string &identifier, time_t startTime, time_t endTime)
 Get a vector of Points with a specific name within a specific time range. More...
 
virtual void addPoint (const string &identifier, Point point)
 
virtual void addPoints (const string &identifier, std::vector< Point > points)
 
virtual void reset ()
 
virtual void reset (const string &identifier)
 
virtual void invalidate (const string &identifier)
 
virtual Point firstPoint (const string &id)
 
virtual Point lastPoint (const string &id)
 
virtual time_pair_t range (const string &id)
 
virtual std::ostream & toStream (std::ostream &stream)
 

Protected Attributes

std::string _cachedPointId
 
Point _cachedPoint
 
std::map< std::string, Point_pointCache
 

Detailed Description

A Point Record Class for storing and retrieving Points.

The base PointRecord class just keeps short-term records. Derive to add specific persistence implementations

Member Function Documentation

Point RTX::PointRecord::point ( const string &  identifier,
time_t  time 
)
virtual

Get a Point with a specific name at a specific time.

Parameters
nameThe name of the data source (tag name).
timeThe requested time.
Returns
The requested Point (as a shared pointer).
See also
Point

Reimplemented in RTX::BufferPointRecord, RTX::MapPointRecord, RTX::DequePointRecord, and RTX::DbPointRecord.

std::vector< Point > RTX::PointRecord::pointsInRange ( const string &  identifier,
time_t  startTime,
time_t  endTime 
)
virtual

Get a vector of Points with a specific name within a specific time range.

Parameters
nameThe name of the data source (tag name).
startTimeThe beginning of the requested time range.
endTimeThe end of the requested time range.
Returns
The requested Points (as a vector of shared pointers)
See also
Point

Reimplemented in RTX::BufferPointRecord, RTX::MapPointRecord, RTX::DequePointRecord, and RTX::DbPointRecord.


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