Class PVUnion¶
Defined in File pvData.h
Inheritance Relationships¶
Base Type¶
public epics::pvData::PVField
(Class PVField)
Class Documentation¶
-
class PVUnion : public epics::pvData::PVField¶
PVUnion has a single subfield.
The type for the subfield is specified by a union introspection interface.
Public Functions
-
virtual ~PVUnion()¶
Destructor
-
inline const UnionConstPtr &getUnion() const¶
Get the introspection interface
- Returns
The interface.
-
inline const PVFieldPtr &get()¶
Get the
PVField
value stored in the field.- Returns
PVField
value of field,null
if.getSelectedIndex() == UNDEFINED_INDEX
-
PVFieldPtr select(int32 index)¶
Select field (set index) and get the field at the index.
- Parameters
index – index of the field to select.
- Throws
std::invalid_argument – if index is invalid (out of range).
- Returns
corresponding PVField (of undetermined value),
null
if.index == UNDEFINED_INDEX
-
PVFieldPtr select(std::string const &fieldName)¶
Select field (set index) and get the field by given name.
- Parameters
fieldName – the name of the field to select.
- Throws
std::invalid_argument – if field does not exist.
- Returns
corresponding PVField (of undetermined value).
-
std::string getSelectedFieldName() const¶
Get selected field name.
- Returns
selected field name, empty string if field does not exist.
-
inline void set(PVFieldPtr const &value)¶
Set the
PVField
(by reference!) as selected field. If a value is not a valid union field anstd::invalid_argument
exception is thrown.- Parameters
value – the field to set.
-
void 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 anstd::invalid_argument
exception is thrown. Useselect(int32)
to put by value.See also
- Parameters
index – index of a field to put.
value – the field to set.
-
void 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 anstd::invalid_argument
exception is thrown. Useselect(std::string const &)
to put by value.See also
- Parameters
fieldName – Name of the field to put.
value – the field to set.
- virtual void serialize (ByteBuffer *pbuffer, SerializableControl *pflusher) const OVERRIDE FINAL
Serialize.
- Parameters
pbuffer – The byte buffer.
pflusher – Interface to call when buffer is full.
- virtual void deserialize (ByteBuffer *pbuffer, DeserializableControl *pflusher) OVERRIDE FINAL
Deserialize
- Parameters
pbuffer – The byte buffer.
pflusher – Interface to call when buffer is empty.
-
explicit PVUnion(UnionConstPtr const &punion)¶
Constructor
- Parameters
punion – The introspection interface.
- virtual std::ostream & dumpValue (std::ostream &o) const OVERRIDE FINAL
Puts the PVField raw value to the stream.
- Parameters
o – output stream.
- Returns
The output stream.
-
virtual ~PVUnion()¶