PVData C++  8.0.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
epics::pvData::PVUnion Class Reference

PVUnion has a single subfield. More...

#include <pv/pvData.h>

Inheritance diagram for epics::pvData::PVUnion:
Inheritance graph
[legend]
Collaboration diagram for epics::pvData::PVUnion:
Collaboration graph
[legend]

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 PVUnionreference
 
typedef const PVUnionconst_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 UnionConstPtrgetUnion () const
 
const PVFieldPtrget ()
 
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::ostreamdumpValue (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::stringgetFieldName () 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 FieldConstPtrgetField () const
 
PVStructuregetParent ()
 
const PVStructuregetParent () 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)
 

Detailed Description

PVUnion has a single subfield.

The type for the subfield is specified by a union introspection interface.

Definition at line 940 of file pvData.h.

Constructor & Destructor Documentation

virtual epics::pvData::PVUnion::~PVUnion ( )
virtual

Destructor

epics::pvData::PVUnion::PVUnion ( UnionConstPtr const &  punion)
explicit

Constructor

Parameters
punionThe introspection interface.

Member Function Documentation

virtual void epics::pvData::PVUnion::deserialize ( ByteBuffer pbuffer,
DeserializableControl pflusher 
)
virtual

Deserialize

Parameters
pbufferThe byte buffer.
pflusherInterface to call when buffer is empty.

Implements epics::pvData::Serializable.

virtual std::ostream& epics::pvData::PVUnion::dumpValue ( std::ostream o) const
virtual

Puts the PVField raw value to the stream.

Parameters
ooutput stream.
Returns
The output stream.

Implements epics::pvData::PVField.

const PVFieldPtr& epics::pvData::PVUnion::get ( )
inline

Get the PVField value stored in the field.

Returns
PVField value of field, null if .

Definition at line 968 of file pvData.h.

std::string epics::pvData::PVUnion::getSelectedFieldName ( ) const

Get selected field name.

Returns
selected field name, empty string if field does not exist.
int32 epics::pvData::PVUnion::getSelectedIndex ( ) const
inline

Get selected field index.

Returns
selected field index.

Definition at line 1014 of file pvData.h.

const UnionConstPtr& epics::pvData::PVUnion::getUnion ( ) const
inline

Get the introspection interface

Returns
The interface.

Definition at line 962 of file pvData.h.

PVFieldPtr epics::pvData::PVUnion::select ( int32  index)

Select field (set index) and get the field at the index.

Parameters
indexindex of the field to select.
Returns
corresponding PVField (of undetermined value), null if
index == UNDEFINED_INDEX
.
Exceptions
std::invalid_argumentif 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.

Parameters
fieldNamethe name of the field to select.
Returns
corresponding PVField (of undetermined value).
Exceptions
std::invalid_argumentif field does not exist.
virtual void epics::pvData::PVUnion::serialize ( ByteBuffer pbuffer,
SerializableControl pflusher 
) const
virtual

Serialize.

Parameters
pbufferThe byte buffer.
pflusherInterface to call when buffer is full.

Implements epics::pvData::Serializable.

void epics::pvData::PVUnion::set ( PVFieldPtr const &  value)
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.

Parameters
valuethe field to set.

Definition at line 1028 of file pvData.h.

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.

Parameters
indexindex of a field to put.
valuethe field to set.
See Also
select(int32)
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.

Parameters
fieldNameName of the field to put.
valuethe field to set.
See Also
select(std::string const &)

Member Data Documentation

const int32 epics::pvData::PVUnion::UNDEFINED_INDEX
static

Undefined index. Default value upon PVUnion construction. Can be set by the user. Corresponds to null value.

Definition at line 956 of file pvData.h.


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