This is Unofficial EPICS BASE Doxygen Site
epics::pvDatabase::PVRecordStructure Class Reference

Interface for a field that is a structure. More...

#include "pvDatabase.h"

+ Inheritance diagram for epics::pvDatabase::PVRecordStructure:
+ Collaboration diagram for epics::pvDatabase::PVRecordStructure:

Public Member Functions

 POINTER_DEFINITIONS (PVRecordStructure)
 
 PVRecordStructure (epics::pvData::PVStructurePtr const &pvStructure, PVRecordStructurePtr const &parent, PVRecordPtr const &pvRecord)
 Constructor. More...
 
virtual ~PVRecordStructure ()
 Destructor. More...
 
PVRecordFieldPtrArrayPtr getPVRecordFields ()
 Get the sub fields. More...
 
epics::pvData::PVStructurePtr getPVStructure ()
 Get the data structure/. More...
 
- Public Member Functions inherited from epics::pvDatabase::PVRecordField
 POINTER_DEFINITIONS (PVRecordField)
 
 PVRecordField (epics::pvData::PVFieldPtr const &pvField, PVRecordStructurePtr const &parent, PVRecordPtr const &pvRecord)
 Constructor. More...
 
virtual ~PVRecordField ()
 Destructor. More...
 
PVRecordStructurePtr getParent ()
 Get the parent. More...
 
epics::pvData::PVFieldPtr getPVField ()
 Get the PVField. More...
 
std::string getFullFieldName ()
 Get the full name of the field, i.e. field,field,.. More...
 
std::string getFullName ()
 Get the recordName plus the full name of the field, i.e. recordName.field,field,.. More...
 
PVRecordPtr getPVRecord ()
 Return the PVRecord to which this field belongs. More...
 
virtual void postPut ()
 This is called by the code that implements the data interface. It is called whenever the put method is called. More...
 
- Public Member Functions inherited from epics::pvData::PostHandler
 POINTER_DEFINITIONS (PostHandler)
 
virtual ~PostHandler ()
 

Protected Member Functions

virtual void init ()
 Called by implementation code of PVRecord. More...
 
- Protected Member Functions inherited from epics::pvDatabase::PVRecordField
virtual void postParent (PVRecordFieldPtr const &subField)
 
virtual void postSubField ()
 

Friends

class PVRecord
 

Detailed Description

Interface for a field that is a structure.

One exists for each structure field of the top level PVStructure.

Author
mrk

Definition at line 365 of file pvDatabase.h.

Constructor & Destructor Documentation

epics::pvDatabase::PVRecordStructure::PVRecordStructure ( epics::pvData::PVStructurePtr const &  pvStructure,
PVRecordStructurePtr const &  parent,
PVRecordPtr const &  pvRecord 
)

Constructor.

Parameters
pvStructureThe data.
parentThe parent
pvRecordThe record that has this field.

Definition at line 442 of file pvRecord.cpp.

446 :
447  PVRecordField(pvStructure,parent,pvRecord),
448  pvStructure(pvStructure),
449  pvRecordFields(new PVRecordFieldPtrArray)
450 {
451 }
PVRecordField(epics::pvData::PVFieldPtr const &pvField, PVRecordStructurePtr const &parent, PVRecordPtr const &pvRecord)
Constructor.
Definition: pvRecord.cpp:323
std::vector< PVRecordFieldPtr > PVRecordFieldPtrArray
Definition: pvDatabase.h:28
virtual epics::pvDatabase::PVRecordStructure::~PVRecordStructure ( )
inlinevirtual

Destructor.

Definition at line 381 of file pvDatabase.h.

381 {}

Member Function Documentation

PVRecordFieldPtrArrayPtr epics::pvDatabase::PVRecordStructure::getPVRecordFields ( )

Get the sub fields.

Returns
the array of PVRecordFieldPtr.

Definition at line 479 of file pvRecord.cpp.

480 {
481  return pvRecordFields;
482 }
PVStructurePtr epics::pvDatabase::PVRecordStructure::getPVStructure ( )

Get the data structure/.

Returns
The shared pointer.

Definition at line 484 of file pvRecord.cpp.

484 {return pvStructure.lock();}
void epics::pvDatabase::PVRecordStructure::init ( )
protectedvirtual

Called by implementation code of PVRecord.

Reimplemented from epics::pvDatabase::PVRecordField.

Definition at line 453 of file pvRecord.cpp.

454 {
456  const PVFieldPtrArray & pvFields = pvStructure.lock()->getPVFields();
457  size_t numFields = pvFields.size();
458  pvRecordFields->reserve( numFields);
459  PVRecordStructurePtr self =
460  static_pointer_cast<PVRecordStructure>(shared_from_this());
461  PVRecordPtr pvRecord = getPVRecord();
462  for(size_t i=0; i<numFields; i++) {
463  PVFieldPtr pvField = pvFields[i];
464  if(pvField->getField()->getType()==structure) {
466  PVRecordStructurePtr pvRecordStructure(
467  new PVRecordStructure(xxx,self,pvRecord));
468  pvRecordFields->push_back(pvRecordStructure);
469  pvRecordStructure->init();
470  } else {
471  PVRecordFieldPtr pvRecordField(
472  new PVRecordField(pvField,self,pvRecord));
473  pvRecordFields->push_back(pvRecordField);
474  pvRecordField->init();
475  }
476  }
477 }
int i
Definition: scan.c:967
shared_ptr< T > static_pointer_cast(shared_ptr< U > const &r) BOOST_NOEXCEPT
Definition: shared_ptr.hpp:788
PVRecordField(epics::pvData::PVFieldPtr const &pvField, PVRecordStructurePtr const &parent, PVRecordPtr const &pvRecord)
Constructor.
Definition: pvRecord.cpp:323
PVRecordPtr getPVRecord()
Return the PVRecord to which this field belongs.
Definition: pvRecord.cpp:366
PVRecordStructure(epics::pvData::PVStructurePtr const &pvStructure, PVRecordStructurePtr const &parent, PVRecordPtr const &pvRecord)
Constructor.
Definition: pvRecord.cpp:442
std::vector< PVFieldPtr > PVFieldPtrArray
Definition: pvData.h:70
Data interface for a structure,.
Definition: pvData.h:712
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< PVRecordStructure > PVRecordStructurePtr
Definition: pvDatabase.h:31
std::tr1::shared_ptr< PVField > PVFieldPtr
Definition: pvData.h:66
std::tr1::shared_ptr< PVRecordField > PVRecordFieldPtr
Definition: pvDatabase.h:26
Interface for a field that is a structure.
Definition: pvDatabase.h:365
epics::pvDatabase::PVRecordStructure::POINTER_DEFINITIONS ( PVRecordStructure  )

Friends And Related Function Documentation

friend class PVRecord
friend

Definition at line 400 of file pvDatabase.h.


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