13 #ifndef CARMA_MONITOR_MONITOR_POINT_SET_h
14 #define CARMA_MONITOR_MONITOR_POINT_SET_h
16 #include "carma/corba/corba.h"
17 #include "carma/monitor/monitorframe.h"
19 #include "carma/util/PthreadMutex.h"
21 #include <boost/thread/thread.hpp>
28 class SubsystemFrameBuffer;
44 virtual unsigned int read() ;
126 long maxMonitorPoints,
200 {
return this->inScriberTime_; }
248 virtual void write(
bool autoWrite,
double autoWriteDelay = 0.0 );
261 friend class SystemFrameBuffer;
269 long maxMonitorPoints,
273 static MonitorPointUpdate_var getScriberHandle (
const std::string& name);
277 MonitorPointUpdate_var & monUpdater,
279 bool & writeSucceeded,
280 const MonitorSampleValues & samples );
283 fillMonSampleValuesHoldingMpModifiedLock(
284 MonitorSampleValues & samples,
286 const char *
const mpModifiedClone );
288 void remergeFailedWriteInfoHoldingWritingLock( );
293 ::std::auto_ptr< SubsystemFrame > frame_;
295 const int mpModifiedAllocCount_;
301 char * mpModifiedState_;
302 int mpModifiedSamplesCount_;
305 char * writingMpModifiedState_;
307 const ::std::string name_;
312 const ::std::string scriberName_;
317 MonitorPointUpdate_var monUpdater_;
320 const double delayInS );
322 boost::thread autoWriterThread_;
325 double startWriteTime_;
327 double inScriberTime_;
329 double endWriteTime_;
332 ::std::map< MonitorValueType, unsigned int > typeHighWaterMarks_;
339 #endif // CARMA_MONITOR_MONITOR_POINT_SET_h
Abstract class that defines the interface for executing a method.
short MonitorValueType
Enumeration of possible types for monitor point values.
Frame containing monitor points for a monitor subsystem, and mapped to an IPQ - essentially a Subsyst...
bool autoWriterIsAlive()
method to test whether the auto-writer thread is alive.
void startAutoWriter()
method to start the auto-write thread.
virtual void write(bool autoWrite, double autoWriteDelay=0.0)
Sends local monitor point values to FrameScriberPublisher Only sample values of modified monitor poin...
double getStartWriteTime() const
method to return the time at which the last write started.
double getStartScriberWriteTime() const
method to return the time at which the last write invoked the remote procedure on the ScriberPublishe...
A class that manages the sets of monitor points for a monitor subsystem.
void removePrewriteMethod(const Runnable &prewriteMethod)
virtual ushort getSubsystemID() const
Returns subsystemID of subsystem managed by this MonitorPointSet.
virtual void setNumSamplesPerCycle(int index, const ushort samples)
Method to modify number of samples associated with the monitor point whose header is at position 'ind...
void markMpWithTagIdModified(const tagIDType tagID)
Marks the monitor point specified by tagID as modified.
void consolidateStorage()
Calls SubsystemFrame::consolidateSamples() on the SubsystemFrame managed by this MonitorPointSet.
void installPrewriteMethod(const Runnable &prewriteMethod)
virtual ~MonitorPointSet()
Destructor.
void stopAutoWriter()
method to stop the auto-write thread.
virtual unsigned int read()
Causes a read from the IPQ associated with the internally stored subsystem frame. ...
virtual bool readNewestConditionalCopy()
If new data is available it is copied from the queue into the monitor system.
void markMpAtIndexModified(int index)
Marks the monitor point specified by index in monitorHeader array as modified.
type definitions for monitor system
Frame containing monitor points for a monitor subsystem frame.
double getEndWriteTime() const
method to return the time at which the last write ended.
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
static MonitorPointSet & getMonitorPointSet(long subsystemID, long maxMonitorPoints, long maxSamples)
method to return a MonitorPointSet.
virtual bool readNewest()
Causes a read of the latest frame from the IPQ associated wit the internally stored subsystem frame...
SubsystemFrame & getSubsystemFrame() const
Returns reference to SubsystemFrame managed by this MonitorPointSet.
unsigned int getHighWaterMark(MonitorValueType mvt)
Get highwater marks for a particular MonitorValueType.