This is Unofficial EPICS BASE Doxygen Site
epics::pvaClient::PvaClientMonitorData Class Reference

A class that holds data returned by PvaClientMonitor. More...

#include "pvaClient.h"

+ Inheritance diagram for epics::pvaClient::PvaClientMonitorData:
+ Collaboration diagram for epics::pvaClient::PvaClientMonitorData:

Public Member Functions

 POINTER_DEFINITIONS (PvaClientMonitorData)
 
 ~PvaClientMonitorData ()
 Destructor. More...
 
epics::pvData::BitSetPtr getOverrunBitSet ()
 Get the overrun BitSet for the pvStructure This shows which fields have had more than one change. More...
 
std::ostream & showOverrun (std::ostream &out)
 Show the fields that have changed. More...
 
void setData (epics::pvData::MonitorElementPtr const &monitorElement)
 
- Public Member Functions inherited from epics::pvaClient::PvaClientData
 POINTER_DEFINITIONS (PvaClientData)
 
 ~PvaClientData ()
 Destructor. More...
 
void setMessagePrefix (std::string const &value)
 Set a prefix for throw messages. More...
 
epics::pvData::StructureConstPtr getStructure ()
 Get the structure. More...
 
epics::pvData::PVStructurePtr getPVStructure ()
 Get the pvStructure. More...
 
epics::pvData::BitSetPtr getChangedBitSet ()
 Get the changed BitSet for the pvStructure. More...
 
std::ostream & showChanged (std::ostream &out)
 Show the fields that have changed value since the last get. More...
 
void setData (epics::pvData::PVStructurePtr const &pvStructureFrom, epics::pvData::BitSetPtr const &bitSetFrom)
 New data is present. More...
 
bool hasValue ()
 Is there a top level field named value. More...
 
bool isValueScalar ()
 Is the value field a scalar? More...
 
bool isValueScalarArray ()
 Is the value field a scalar array? More...
 
epics::pvData::PVFieldPtr getValue ()
 Get the interface to the value field. More...
 
epics::pvData::PVScalarPtr getScalarValue ()
 Return the interface to a scalar value field. More...
 
std::tr1::shared_ptr< epics::pvData::PVArraygetArrayValue ()
 Get the interface to an array value field. More...
 
std::tr1::shared_ptr< epics::pvData::PVScalarArraygetScalarArrayValue ()
 Get the interface to a scalar array value field. More...
 
double getDouble ()
 Get the value as a double. More...
 
std::string getString ()
 
epics::pvData::shared_vector< const double > getDoubleArray ()
 Get the value as a double array. More...
 
epics::pvData::shared_vector< const std::string > getStringArray ()
 Get the value as a string array. More...
 
epics::pvData::Alarm getAlarm ()
 Get the alarm. If the pvStructure has an alarm field it's values are returned. Otherwise an exception is thrown. More...
 
epics::pvData::TimeStamp getTimeStamp ()
 Get the timeStamp. If the pvStructure has a timeStamp field, it's values are returned. Otherwise an exception is thrown. More...
 
void parse (const std::vector< std::string > &args)
 parse from args More...
 
void streamJSON (std::ostream &strm, bool ignoreUnprintable=true, bool multiLine=false)
 generate JSON output from the current PVStructure More...
 
void zeroArrayLength ()
 set length of all array fields to 0 More...
 

Static Public Member Functions

static PvaClientMonitorDataPtr create (epics::pvData::StructureConstPtr const &structure)
 
- Static Public Member Functions inherited from epics::pvaClient::PvaClientData
static PvaClientDataPtr create (epics::pvData::StructureConstPtr const &structure)
 Factory method for creating an instance of PvaClientData. More...
 

Friends

class PvaClientMonitor
 

Additional Inherited Members

- Protected Member Functions inherited from epics::pvaClient::PvaClientData
 PvaClientData (epics::pvData::StructureConstPtr const &structure)
 
epics::pvData::PVFieldPtr getSinglePVField ()
 
void checkValue ()
 
- Protected Attributes inherited from epics::pvaClient::PvaClientData
std::string messagePrefix
 

Detailed Description

A class that holds data returned by PvaClientMonitor.

Overview of PvaClientMonitorData

Definition at line 825 of file pvaClient.h.

Constructor & Destructor Documentation

epics::pvaClient::PvaClientMonitorData::~PvaClientMonitorData ( )
inline

Destructor.

Definition at line 832 of file pvaClient.h.

832 {}

Member Function Documentation

PvaClientMonitorDataPtr epics::pvaClient::PvaClientMonitorData::create ( epics::pvData::StructureConstPtr const &  structure)
static

Factory method for creating an instance of PvaClientGetData. NOTE: Not normally called by clients

Parameters
structureIntrospection interface

Definition at line 48 of file pvaClientMonitorData.cpp.

49 {
50  PvaClientMonitorDataPtr epv(new PvaClientMonitorData(structure));
51  return epv;
52 }
std::tr1::shared_ptr< PvaClientMonitorData > PvaClientMonitorDataPtr
Definition: pvaClient.h:54
BitSetPtr epics::pvaClient::PvaClientMonitorData::getOverrunBitSet ( )

Get the overrun BitSet for the pvStructure This shows which fields have had more than one change.

Returns
The bitSet
Exceptions
runtime_errorif failure.

Definition at line 67 of file pvaClientMonitorData.cpp.

68 {
69  if(!overrunBitSet) throw std::runtime_error(messagePrefix + noStructure);
70  return overrunBitSet;
71 }
epics::pvaClient::PvaClientMonitorData::POINTER_DEFINITIONS ( PvaClientMonitorData  )
void epics::pvaClient::PvaClientMonitorData::setData ( epics::pvData::MonitorElementPtr const &  monitorElement)

Put data into PVStructure from monitorElement NOTE: Not normally called by clients

Parameters
monitorElementthe monitorElement that has new data.

Definition at line 59 of file pvaClientMonitorData.cpp.

60 {
61  PVStructurePtr pvStructure = monitorElement->pvStructurePtr;
62  BitSetPtr changedBitSet = monitorElement->changedBitSet;
63  PvaClientData::setData(pvStructure,changedBitSet);
64  overrunBitSet = monitorElement->overrunBitSet;
65 }
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< BitSet > BitSetPtr
Definition: bitSet.h:26
void setData(epics::pvData::PVStructurePtr const &pvStructureFrom, epics::pvData::BitSetPtr const &bitSetFrom)
New data is present.
std::ostream & epics::pvaClient::PvaClientMonitorData::showOverrun ( std::ostream &  out)

Show the fields that have changed.

Parameters
outThe stream that shows the changed fields.
Returns
The stream that was passed as out.

Definition at line 73 of file pvaClientMonitorData.cpp.

74 {
75  if(!overrunBitSet) throw std::runtime_error(messagePrefix + noStructure);
76  size_t nextSet = overrunBitSet->nextSetBit(0);
77  PVFieldPtr pvField;
78  while(nextSet!=string::npos) {
79  if(nextSet==0) {
80  pvField = getPVStructure();
81  } else {
82  pvField = getPVStructure()->getSubField(nextSet);
83  }
84  string name = pvField->getFullName();
85  out << name << " = " << pvField << endl;
86  nextSet = overrunBitSet->nextSetBit(nextSet+1);
87  }
88  return out;
89 }
std::tr1::shared_ptr< PVField > PVFieldPtr
Definition: pvData.h:66
epics::pvData::PVStructurePtr getPVStructure()
Get the pvStructure.

Friends And Related Function Documentation

friend class PvaClientMonitor
friend

Definition at line 858 of file pvaClient.h.


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