pvaClientCPP
4.8.1-dev
|
A base class for PvaClientGetData, PvaClientPutData, and PvaClientMonitorData. More...
#include <pv/pvaClient.h>
Public Member Functions | |
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::PVArray > | getArrayValue () |
Get the interface to an array value field. More... | |
std::tr1::shared_ptr< epics::pvData::PVScalarArray > | getScalarArrayValue () |
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 and displays it on the output stream. More... | |
void | zeroArrayLength () |
set length of all array fields to 0 More... | |
Protected Member Functions | |
PvaClientData (epics::pvData::StructureConstPtr const &structure) | |
epics::pvData::PVFieldPtr | getSinglePVField () |
void | checkValue () |
Static Protected Member Functions | |
static PvaClientDataPtr | create (epics::pvData::StructureConstPtr const &structure) |
Protected Attributes | |
std::string | messagePrefix |
Friends | |
class | PvaClientGet |
class | PvaClientPutGet |
A base class for PvaClientGetData, PvaClientPutData, and PvaClientMonitorData.
Definition at line 541 of file pvaClient.h.
|
inline |
Destructor.
Definition at line 548 of file pvaClient.h.
|
protected |
Definition at line 55 of file pvaClientData.cpp.
|
protected |
Definition at line 84 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug(), and messagePrefix.
Referenced by getArrayValue(), getScalarArrayValue(), getScalarValue(), and getValue().
|
staticprotected |
Definition at line 48 of file pvaClientData.cpp.
Alarm epics::pvaClient::PvaClientData::getAlarm | ( | ) |
Get the alarm. If the pvStructure has an alarm field it's values are returned. Otherwise an exception is thrown.
runtime_error | if failure. |
Definition at line 270 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug(), and messagePrefix.
PVArrayPtr epics::pvaClient::PvaClientData::getArrayValue | ( | ) |
Get the interface to an array value field.
runtime_error | if failure. |
Definition at line 182 of file pvaClientData.cpp.
References checkValue(), epics::pvaClient::PvaClient::getDebug(), and messagePrefix.
BitSetPtr epics::pvaClient::PvaClientData::getChangedBitSet | ( | ) |
Get the changed BitSet for the pvStructure.
This shows which fields have changed value since the last get.
runtime_error | if failure |
Definition at line 107 of file pvaClientData.cpp.
References messagePrefix.
double epics::pvaClient::PvaClientData::getDouble | ( | ) |
Get the value as a double.
runtime_error | if failure. |
Definition at line 204 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug(), and getSinglePVField().
shared_vector< const double > epics::pvaClient::PvaClientData::getDoubleArray | ( | ) |
Get the value as a double array.
runtime_error | if failure. |
Definition at line 237 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug(), and getSinglePVField().
PVStructurePtr epics::pvaClient::PvaClientData::getPVStructure | ( | ) |
Get the pvStructure.
runtime_error | if failure. |
Definition at line 101 of file pvaClientData.cpp.
References messagePrefix.
Referenced by getSinglePVField().
PVScalarArrayPtr epics::pvaClient::PvaClientData::getScalarArrayValue | ( | ) |
Get the interface to a scalar array value field.
runtime_error | if failure. |
Definition at line 193 of file pvaClientData.cpp.
References checkValue(), epics::pvaClient::PvaClient::getDebug(), and messagePrefix.
PVScalarPtr epics::pvaClient::PvaClientData::getScalarValue | ( | ) |
Return the interface to a scalar value field.
runtime_error | if failure. |
Definition at line 172 of file pvaClientData.cpp.
References checkValue(), epics::pvaClient::PvaClient::getDebug(), and messagePrefix.
|
protected |
Definition at line 60 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug(), and getPVStructure().
Referenced by getDouble(), getDoubleArray(), getString(), and getStringArray().
string epics::pvaClient::PvaClientData::getString | ( | ) |
Get the value as a string.
runtime_error | if failure. |
Definition at line 225 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug(), and getSinglePVField().
shared_vector< const string > epics::pvaClient::PvaClientData::getStringArray | ( | ) |
Get the value as a string array.
runtime_error | if failure. |
Definition at line 256 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug(), and getSinglePVField().
StructureConstPtr epics::pvaClient::PvaClientData::getStructure | ( | ) |
Get the structure.
runtime_error | if failure. |
Definition at line 96 of file pvaClientData.cpp.
TimeStamp epics::pvaClient::PvaClientData::getTimeStamp | ( | ) |
Get the timeStamp. If the pvStructure has a timeStamp field, it's values are returned. Otherwise an exception is thrown.
Definition at line 286 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug(), and messagePrefix.
PVFieldPtr epics::pvaClient::PvaClientData::getValue | ( | ) |
Get the interface to the value field.
runtime_error | if failure. |
Definition at line 165 of file pvaClientData.cpp.
References checkValue(), and epics::pvaClient::PvaClient::getDebug().
bool epics::pvaClient::PvaClientData::hasValue | ( | ) |
Is there a top level field named value.
Definition at line 142 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug().
bool epics::pvaClient::PvaClientData::isValueScalar | ( | ) |
Is the value field a scalar?
Definition at line 149 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug().
bool epics::pvaClient::PvaClientData::isValueScalarArray | ( | ) |
Is the value field a scalar array?
Definition at line 157 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug().
void epics::pvaClient::PvaClientData::parse | ( | const std::vector< std::string > & | args | ) |
parse from args
Accepts arguments of the form json or field='value' where value is json syntax. field is name.name...
args | The arguments. |
runtime_error | if failure. |
Definition at line 345 of file pvaClientData.cpp.
References messagePrefix.
Referenced by zeroArrayLength().
epics::pvaClient::PvaClientData::POINTER_DEFINITIONS | ( | PvaClientData | ) |
void epics::pvaClient::PvaClientData::setData | ( | epics::pvData::PVStructurePtr const & | pvStructureFrom, |
epics::pvData::BitSetPtr const & | bitSetFrom | ||
) |
New data is present.
This is called by other pvaClient classes, i. e. not by client.
pvStructureFrom | The new data. |
bitSetFrom | the bitSet showing which values have changed. |
Definition at line 131 of file pvaClientData.cpp.
References epics::pvaClient::PvaClient::getDebug().
void epics::pvaClient::PvaClientData::setMessagePrefix | ( | std::string const & | value | ) |
Set a prefix for throw messages.
This is called by other pvaClient classes.
value | The prefix. |
Definition at line 91 of file pvaClientData.cpp.
References messagePrefix.
std::ostream & epics::pvaClient::PvaClientData::showChanged | ( | std::ostream & | out | ) |
Show the fields that have changed value since the last get.
out | The stream that shows the changed fields. |
Definition at line 113 of file pvaClientData.cpp.
References messagePrefix.
void epics::pvaClient::PvaClientData::streamJSON | ( | std::ostream & | strm, |
bool | ignoreUnprintable = true , |
||
bool | multiLine = false |
||
) |
generate JSON output from the current PVStructure and displays it on the output stream.
strm | The output stream. |
ignoreUnprintable | false or true; The default is true. |
multiline | false or true; The default is false. |
runtime_error | if failure. |
Definition at line 392 of file pvaClientData.cpp.
References zeroArrayLength().
void epics::pvaClient::PvaClientData::zeroArrayLength | ( | ) |
set length of all array fields to 0
Definition at line 302 of file pvaClientData.cpp.
References messagePrefix, and parse().
Referenced by streamJSON().
|
friend |
Definition at line 702 of file pvaClient.h.
|
friend |
Definition at line 703 of file pvaClient.h.
|
protected |
Definition at line 684 of file pvaClient.h.
Referenced by checkValue(), getAlarm(), getArrayValue(), getChangedBitSet(), getPVStructure(), getScalarArrayValue(), getScalarValue(), getTimeStamp(), parse(), setMessagePrefix(), showChanged(), and zeroArrayLength().