PVData C++
8.0.6
|
PVUnion has a single subfield. More...
#include <pv/pvData.h>
Public Types | |
typedef std::tr1::shared_ptr < PVUnion > | shared_pointer |
typedef std::tr1::shared_ptr < const PVUnion > | const_shared_pointer |
typedef std::tr1::weak_ptr < PVUnion > | weak_pointer |
typedef std::tr1::weak_ptr < const PVUnion > | const_weak_pointer |
typedef PVUnion & | reference |
typedef const PVUnion & | const_reference |
Public Types inherited from epics::pvData::PVField | |
enum | { isPVField =1 } |
typedef std::tr1::shared_ptr < PVField > | shared_pointer |
typedef std::tr1::shared_ptr < const PVField > | const_shared_pointer |
typedef std::tr1::weak_ptr < PVField > | weak_pointer |
typedef std::tr1::weak_ptr < const PVField > | const_weak_pointer |
Public Member Functions | |
virtual | ~PVUnion () |
const UnionConstPtr & | getUnion () const |
const PVFieldPtr & | get () |
PVField::const_shared_pointer | get () const |
template<typename PVT > | |
std::tr1::shared_ptr< PVT > | get () |
template<typename PVT > | |
std::tr1::shared_ptr< const PVT > | get () const |
PVFieldPtr | select (int32 index) |
template<typename PVT > | |
std::tr1::shared_ptr< PVT > | select (int32 index) |
PVFieldPtr | select (std::string const &fieldName) |
template<typename PVT > | |
std::tr1::shared_ptr< PVT > | select (std::string const &fieldName) |
int32 | getSelectedIndex () const |
std::string | getSelectedFieldName () const |
void | set (PVFieldPtr const &value) |
void | set (int32 index, PVFieldPtr const &value) |
void | set (std::string const &fieldName, PVFieldPtr const &value) |
virtual void | serialize (ByteBuffer *pbuffer, SerializableControl *pflusher) const OVERRIDE FINAL |
virtual void | deserialize (ByteBuffer *pbuffer, DeserializableControl *pflusher) OVERRIDE FINAL |
PVUnion (UnionConstPtr const &punion) | |
virtual std::ostream & | dumpValue (std::ostream &o) const OVERRIDE FINAL |
void | copy (const PVUnion &from) |
void | copyUnchecked (const PVUnion &from) |
Public Member Functions inherited from epics::pvData::PVField | |
virtual | ~PVField () |
const std::string & | getFieldName () const |
std::string | getFullName () const |
std::size_t | getFieldOffset () const |
std::size_t | getNextFieldOffset () const |
std::size_t | getNumberFields () const |
bool | isImmutable () const |
virtual void | setImmutable () |
const FieldConstPtr & | getField () const |
PVStructure * | getParent () |
const PVStructure * | getParent () const |
void | postPut () |
void | setPostHandler (PostHandlerPtr const &postHandler) |
virtual bool | equals (PVField &pv) |
void | copy (const PVField &from) |
void | copyUnchecked (const PVField &from) |
Public Member Functions inherited from epics::pvData::Serializable | |
virtual | ~Serializable () |
Static Public Attributes | |
static const int32 | UNDEFINED_INDEX |
Static Public Attributes inherited from epics::pvData::PVField | |
static size_t | num_instances |
Friends | |
class | PVDataCreate |
Additional Inherited Members | |
Protected Member Functions inherited from epics::pvData::PVField | |
PVField::shared_pointer | getPtrSelf () |
PVField (FieldConstPtr field) | |
void | setParentAndName (PVStructure *parent, std::string const &fieldName) |
PVUnion has a single subfield.
The type for the subfield is specified by a union introspection interface.
|
virtual |
Destructor
|
explicit |
Constructor
punion | The introspection interface. |
|
virtual |
Deserialize
pbuffer | The byte buffer. |
pflusher | Interface to call when buffer is empty. |
Implements epics::pvData::Serializable.
|
virtual |
Puts the PVField raw value to the stream.
o | output stream. |
Implements epics::pvData::PVField.
|
inline |
std::string epics::pvData::PVUnion::getSelectedFieldName | ( | ) | const |
Get selected field name.
|
inline |
|
inline |
PVFieldPtr epics::pvData::PVUnion::select | ( | int32 | index | ) |
Select field (set index) and get the field at the index.
index | index of the field to select. |
null
ifstd::invalid_argument | if index is invalid (out of range). |
PVFieldPtr epics::pvData::PVUnion::select | ( | std::string const & | fieldName | ) |
Select field (set index) and get the field by given name.
fieldName | the name of the field to select. |
std::invalid_argument | if field does not exist. |
|
virtual |
Serialize.
pbuffer | The byte buffer. |
pflusher | Interface to call when buffer is full. |
Implements epics::pvData::Serializable.
|
inline |
Set the PVField
(by reference!) as selected field. If a value is not a valid union field an std::invalid_argument
exception is thrown.
value | the field to set. |
void epics::pvData::PVUnion::set | ( | int32 | index, |
PVFieldPtr const & | value | ||
) |
Set the PVField
(by reference!) as field at given index. If a value is not a valid union field an std::invalid_argument
exception is thrown. Use select(int32)
to put by value.
index | index of a field to put. |
value | the field to set. |
void epics::pvData::PVUnion::set | ( | std::string const & | fieldName, |
PVFieldPtr const & | value | ||
) |
Set the PVField
(by reference!) as field by given name. If a value is not a valid union field an std::invalid_argument
exception is thrown. Use select(std::string const &)
to put by value.
fieldName | Name of the field to put. |
value | the field to set. |
|
static |