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 | Protected Member Functions | Friends | List of all members
epics::pvData::PVField Class Referenceabstract

PVField is the base class for each PVData field. More...

#include <pv/pvData.h>

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

Public Types

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 ~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)
 
virtual std::ostreamdumpValue (std::ostream &o) const =0
 
void copy (const PVField &from)
 
void copyUnchecked (const PVField &from)
 
- Public Member Functions inherited from epics::pvData::Serializable
virtual ~Serializable ()
 
virtual void serialize (ByteBuffer *buffer, SerializableControl *flusher) const =0
 
virtual void deserialize (ByteBuffer *buffer, DeserializableControl *flusher)=0
 

Static Public Attributes

static size_t num_instances
 

Protected Member Functions

PVField::shared_pointer getPtrSelf ()
 
 PVField (FieldConstPtr field)
 
void setParentAndName (PVStructure *parent, std::string const &fieldName)
 

Friends

class PVDataCreate
 
class PVStructure
 

Detailed Description

PVField is the base class for each PVData field.

Each PVData field has an interface that extends PVField.

Definition at line 152 of file pvData.h.

Constructor & Destructor Documentation

virtual epics::pvData::PVField::~PVField ( )
virtual

Destructor

Member Function Documentation

virtual std::ostream& epics::pvData::PVField::dumpValue ( std::ostream o) const
pure virtual
virtual bool epics::pvData::PVField::equals ( PVField pv)
virtual

Is this field equal to another field.

Parameters
pvother field
Returns
(false,true) if (is not,is) equal.
const FieldConstPtr& epics::pvData::PVField::getField ( ) const
inline

Get the Field that describes the field.

Returns
Field, which is the reflection interface.

Definition at line 208 of file pvData.h.

const std::string& epics::pvData::PVField::getFieldName ( ) const
inline

Get the fieldName for this field.

Returns
The name or empty string if top-level field.

Definition at line 166 of file pvData.h.

std::size_t epics::pvData::PVField::getFieldOffset ( ) const

Get offset of the PVField field within top-level structure. Every field within the PVStructure has a unique offset. The top-level structure has an offset of 0. The first field within the structure has offset equal to 1. The other offsets are determined by recursively traversing each structure of the tree.

Returns
The offset.
std::string epics::pvData::PVField::getFullName ( ) const

Fully expand the name of this field using the names of its parent fields with a dot '.' separating each name.

std::size_t epics::pvData::PVField::getNextFieldOffset ( ) const

Get the next offset. If the field is a scalar or array field then this is just offset + 1. If the field is a structure it is the offset of the next field after this structure. Thus (nextOffset - offset) is always equal to the number of fields within the field.

Returns
The offset.
std::size_t epics::pvData::PVField::getNumberFields ( ) const

Get the total number of fields in this field. This is equal to nextFieldOffset - fieldOffset.

PVStructure* epics::pvData::PVField::getParent ( )
inline

Get the parent of this field.

Returns
The parent interface or null if this is PVRecord

Definition at line 213 of file pvData.h.

bool epics::pvData::PVField::isImmutable ( ) const
inline

Is the field immutable, i.e. does it not allow changes.

Returns
(false,true) if it (is not, is) immutable.

Definition at line 198 of file pvData.h.

void epics::pvData::PVField::postPut ( )

postPut. Called when the field is updated by the implementation.

virtual void epics::pvData::PVField::setImmutable ( )
virtual

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.

Reimplemented in epics::pvData::PVStructure, and epics::pvData::PVArray.

void epics::pvData::PVField::setPostHandler ( PostHandlerPtr const &  postHandler)

Set the handler for postPut. At most one handler can be set.

Parameters
postHandlerThe handler.

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