Class PVStructure

Nested Relationships

Nested Types

Inheritance Relationships

Base Types

Class Documentation

class PVStructure : public epics::pvData::PVField, public epics::pvData::BitSetSerializable

Data interface for a structure,.

Public Types

typedef PVStructure &reference
typedef const PVStructure &const_reference

Public Functions

POINTER_DEFINITIONS(PVStructure)
virtual ~PVStructure()

Destructor

virtual void setImmutable () OVERRIDE FINAL

Set the field to be immutable, i.e. it can no longer be modified. This is permanent, i.e. once done the field cannot be made mutable.

inline const StructureConstPtr &getStructure() const

Get the introspection interface

Returns

The interface.

inline const PVFieldPtrArray &getPVFields() const

Get the array of pointers to the subfields in the structure.

Returns

The array.

template<typename A> inline FORCE_INLINE std::tr1::shared_ptr< PVField > getSubField (A a)

Get the subfield with the specified offset.

Parameters

a – A sub-field name or index

Returns

Pointer to the field or NULL if field does not exist.

template<typename A> inline FORCE_INLINE std::tr1::shared_ptr< const PVField > getSubField (A a) const
template<typename PVD, typename A>
inline std::tr1::shared_ptr<PVD> getSubField(A a)

Get a subfield with the specified name.

A field name is a ‘.’ delimited list of child field names (no whitespace allowed)

Parameters

a – A sub-field name or index

Returns

A pointer to the sub-field or null if field does not exist or has a different type

PVIntPtr ptr = pvStruct->getSubField<PVInt>("substruct.leaffield");

template<typename PVD, typename A>
inline std::tr1::shared_ptr<const PVD> getSubField(A a) const
template<typename A> inline FORCE_INLINE std::tr1::shared_ptr< PVField > getSubFieldT (A a)

Get the subfield with the specified offset.

Parameters

a – A sub-field name or index

Throws

std::runtime_error – if the requested sub-field doesn’t exist, or has a different type

Returns

Pointer to the field

template<typename A> inline FORCE_INLINE std::tr1::shared_ptr< const PVField > getSubFieldT (A a) const
template<typename PVD, typename A>
inline std::tr1::shared_ptr<PVD> getSubFieldT(A a)
template<typename PVD, typename A>
inline std::tr1::shared_ptr<const PVD> getSubFieldT(A a) const
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.

virtual void serialize (ByteBuffer *pbuffer, SerializableControl *pflusher, BitSet *pbitSet) const OVERRIDE FINAL

Serialize.

Parameters
  • pbuffer – The byte buffer.

  • pflusher – Interface to call when buffer is full.

  • pbitSet – A bitset the specifies which fields to serialize.

virtual void deserialize (ByteBuffer *pbuffer, DeserializableControl *pflusher, BitSet *pbitSet) OVERRIDE FINAL

Deserialize

Parameters
  • pbuffer – The byte buffer.

  • pflusher – Interface to call when buffer is empty.

  • pbitSet – A bitset the specifies which fields to deserialize.

explicit PVStructure(StructureConstPtr const &structure)

Constructor

Parameters

structure – The introspection interface.

PVStructure(StructureConstPtr const &structure, PVFieldPtrArray const &pvFields)

Constructor

Parameters
  • structure – The introspection interface.

  • pvFields – The array of fields for the structure.

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.

void copy(const PVStructure &from)
void copyUnchecked(const PVStructure &from)
void copyUnchecked(const PVStructure &from, const BitSet &maskBitSet, bool inverse = false)
inline FORCE_INLINE Formatter stream () const
struct Formatter

Public Types

enum mode_t

Values:

enumerator Auto
enumerator Plain
enumerator ANSI
enum format_t

Values:

enumerator Raw
enumerator NT
enumerator JSON

Public Functions

inline explicit Formatter(const PVStructure &top)
inline FORCE_INLINE Formatter & show (const BitSet &set)
inline FORCE_INLINE Formatter & highlight (const BitSet &set)
inline FORCE_INLINE Formatter & mode (mode_t m)
inline FORCE_INLINE Formatter & format (format_t f)

Friends

friend epicsShareFunc std::ostream & operator<< (std::ostream &strm, const Formatter &format)
friend void printRaw(std::ostream &strm, const PVStructure::Formatter &format, const PVStructure &cur)