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

This class implements introspection object for a structure. More...

#include <pv/pvIntrospect.h>

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

Public Types

typedef std::tr1::shared_ptr
< Structure
shared_pointer
 
typedef std::tr1::shared_ptr
< const Structure
const_shared_pointer
 
typedef std::tr1::weak_ptr
< Structure
weak_pointer
 
typedef std::tr1::weak_ptr
< const Structure
const_weak_pointer
 
typedef Structurereference
 
typedef const Structureconst_reference
 
- Public Types inherited from epics::pvData::Field
enum  { isField =1 }
 
typedef std::tr1::shared_ptr
< Field
shared_pointer
 
typedef std::tr1::shared_ptr
< const Field
const_shared_pointer
 
typedef std::tr1::weak_ptr< Fieldweak_pointer
 
typedef std::tr1::weak_ptr
< const Field
const_weak_pointer
 

Public Member Functions

std::size_t getNumberFields () const
 
FieldConstPtr getField (std::string const &fieldName) const
 
template<typename FT >
std::tr1::shared_ptr< const FT > getField (std::string const &fieldName) const
 
FieldConstPtr getFieldT (std::string const &fieldName) const
 
template<typename FT >
std::tr1::shared_ptr< const FT > getFieldT (std::string const &fieldName) const
 
const FieldConstPtrgetField (std::size_t index) const
 
template<typename FT >
std::tr1::shared_ptr< const FT > getField (std::size_t index) const
 
FieldConstPtr getFieldT (std::size_t index) const
 
template<typename FT >
std::tr1::shared_ptr< const FT > getFieldT (std::size_t index) const
 
std::size_t getFieldIndex (std::string const &fieldName) const
 
FieldConstPtrArray const & getFields () const
 
StringArray const & getFieldNames () const
 
const std::stringgetFieldName (std::size_t fieldIndex) const
 
virtual std::string getID () const
 
virtual std::ostreamdump (std::ostream &o) const
 
virtual void serialize (ByteBuffer *buffer, SerializableControl *control) const
 
virtual void deserialize (ByteBuffer *buffer, DeserializableControl *control)
 
std::tr1::shared_ptr< PVStructurebuild () const
 
- Public Member Functions inherited from epics::pvData::Field
Type getType () const
 
std::tr1::shared_ptr< PVFieldbuild () const
 
- Public Member Functions inherited from epics::pvData::Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static const std::stringdefaultId ()
 

Static Public Attributes

static const std::string DEFAULT_ID
 
- Static Public Attributes inherited from epics::pvData::Field
static size_t num_instances
 

Protected Member Functions

 Structure (StringArray const &fieldNames, FieldConstPtrArray const &fields, std::string const &id=defaultId())
 
- Protected Member Functions inherited from epics::pvData::Field
 Field (Type type)
 
void cacheCleanup ()
 

Friends

class FieldCreate
 
class Union
 

Detailed Description

This class implements introspection object for a structure.

Definition at line 689 of file pvIntrospect.h.

Member Function Documentation

std::tr1::shared_ptr<PVStructure> epics::pvData::Structure::build ( ) const

Allocate a new instance

Version
Added after 7.0.0
static const std::string& epics::pvData::Structure::defaultId ( )
static

Get the default structure ID.

Returns
The default structure ID.
virtual void epics::pvData::Structure::deserialize ( ByteBuffer buffer,
DeserializableControl flusher 
)
virtual

Deserialize buffer.

Parameters
bufferserialization buffer.
flusherdeserialization control.

Implements epics::pvData::Serializable.

virtual std::ostream& epics::pvData::Structure::dump ( std::ostream o) const
virtual

Puts the string representation to the stream.

Parameters
ooutput stream.
Returns
The output stream.

Implements epics::pvData::Field.

FieldConstPtr epics::pvData::Structure::getField ( std::string const &  fieldName) const

Lookup Field by name

Parameters
fieldNameMember field name. May not contain '.'
Returns
NULL if no member by this name.
template<typename FT >
std::tr1::shared_ptr<const FT> epics::pvData::Structure::getField ( std::string const &  fieldName) const
inline

Lookup Field by name and cast to Field sub-class.

Parameters
fieldNameMember field name. May not contain '.'
Returns
NULL If no member by this name, or member exists, but has type other than FT.

Definition at line 726 of file pvIntrospect.h.

const FieldConstPtr& epics::pvData::Structure::getField ( std::size_t  index) const
inline

Lookup Field by index, within this Structure.

Parameters
indexIndex of member in this structure.
index>=0 && index<getNumberFields()
Returns
Field pointer (never NULL)
Exceptions
std::out_of_rangeIf index >= getNumberFields()

Definition at line 764 of file pvIntrospect.h.

template<typename FT >
std::tr1::shared_ptr<const FT> epics::pvData::Structure::getField ( std::size_t  index) const
inline

Lookup Field by index, within this Structure.

Parameters
indexIndex of member in this structure.
index>=0 && index<getNumberFields()
Returns
NULL if member is not a sub-class of FT
Exceptions
std::out_of_rangeIf index >= getNumberFields()

Definition at line 772 of file pvIntrospect.h.

std::size_t epics::pvData::Structure::getFieldIndex ( std::string const &  fieldName) const

Get the field index for the specified fieldName.

Returns
The introspection interface. This will be -1 if the field is not in the structure.
const std::string& epics::pvData::Structure::getFieldName ( std::size_t  fieldIndex) const
inline

Get the name of the field with the specified index;

Parameters
fieldIndexThe index of the desired field.
Returns
The fieldName.

Definition at line 826 of file pvIntrospect.h.

StringArray const& epics::pvData::Structure::getFieldNames ( ) const
inline

Get the names of the fields in the structure.

Returns
The array of fieldNames.

Definition at line 820 of file pvIntrospect.h.

FieldConstPtrArray const& epics::pvData::Structure::getFields ( ) const
inline

Get the fields in the structure.

Returns
The array of fields.

Definition at line 815 of file pvIntrospect.h.

FieldConstPtr epics::pvData::Structure::getFieldT ( std::string const &  fieldName) const
inline

Lookup Field by name

Parameters
fieldNameMember field name. May not contain '.'
Returns
Field pointer (never NULL)
Exceptions
std::runtime_errorIf no member by this name

Definition at line 738 of file pvIntrospect.h.

template<typename FT >
std::tr1::shared_ptr<const FT> epics::pvData::Structure::getFieldT ( std::string const &  fieldName) const
inline

Lookup Field by name and cast to Field sub-class.

Parameters
fieldNameMember field name. May not contain '.'
Returns
Field pointer (never NULL)
Exceptions
std::runtime_errorIf no member by this name, or member exists, but has type other than FT.

Definition at line 746 of file pvIntrospect.h.

FieldConstPtr epics::pvData::Structure::getFieldT ( std::size_t  index) const
inline

Lookup Field by index, within this Structure.

Parameters
indexIndex of member in this structure.
index>=0 && index<getNumberFields()
Returns
Field pointer (never NULL)
Exceptions
std::out_of_rangeIf index >= getNumberFields()

Definition at line 783 of file pvIntrospect.h.

template<typename FT >
std::tr1::shared_ptr<const FT> epics::pvData::Structure::getFieldT ( std::size_t  index) const
inline

Lookup Field by index, within this Structure.

Parameters
indexIndex of member in this structure.
index>=0 && index<getNumberFields()
Returns
Field pointer (never NULL)
Exceptions
std::out_of_rangeIf index >= getNumberFields()
std::runtime_errorIf member is not a sub-class of FT

Definition at line 792 of file pvIntrospect.h.

virtual std::string epics::pvData::Structure::getID ( ) const
virtual

Get the identification string.

Returns
The identification string, can be empty.

Implements epics::pvData::Field.

std::size_t epics::pvData::Structure::getNumberFields ( ) const
inline

Get the number of immediate subfields in the structure.

Returns
The number of fields.

Definition at line 712 of file pvIntrospect.h.

virtual void epics::pvData::Structure::serialize ( ByteBuffer buffer,
SerializableControl flusher 
) const
virtual

Serialize field into given buffer.

Parameters
bufferserialization buffer.
flusherflush interface.

Implements epics::pvData::Serializable.

Member Data Documentation

const std::string epics::pvData::Structure::DEFAULT_ID
static

Default structure ID.

Definition at line 696 of file pvIntrospect.h.


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