DUECA/DUSIME
Loading...
Searching...
No Matches
dueca::CommObjectReader Class Reference

Class to access data in a channel without access to the class of that data. More...

#include <CommObjectReader.hxx>

Inheritance diagram for dueca::CommObjectReader:
Collaboration diagram for dueca::CommObjectReader:

Public Member Functions

 CommObjectReader (const char *classname, const void *obj=NULL)
 Constructor, for testing purposes, and for recursively accessing complex objects.
template<typename T>
 CommObjectReader (T &obj)
 Templated constructor.
ElementReader operator[] (const char *ename) const
 Return an element accessor based on the element name.
ElementReader operator[] (unsigned i) const
 Return an element accessor based on index.
 ~CommObjectReader ()
 Destructor.
Public Member Functions inherited from dueca::CommObjectReaderWriter
 CommObjectReaderWriter (const char *classname)
 Constructor, for testing purposes, and for recursively accessing complex objects.
 ~CommObjectReaderWriter ()
 Destructor.
const char * getMemberName (unsigned i) const
 Return an element name based on index.
const char * getMemberClass (unsigned i) const
 Return an element's class based on index.
const char * getMemberKeyClass (unsigned i) const
 Return an element's key class based on index.
MemberArity getMemberArity (unsigned i) const
 Return the member arity.
size_t getMemberSize (unsigned i) const
 Get member fixed length, if available.
const char * getClassname () const
 Return the classname of the currently written or read type; typically for debugging messages.
size_t getNumMembers () const
 Determine the number of members in the object.
const CommObjectMemberAccessBase & getMemberAccessor (unsigned i) const
 Directly reach the MemberAccess object.
CommObjectReaderWriteroperator= (const CommObjectReaderWriter &o)
 assignment, needed for temporary copy MSGPACKtoDCO

Protected Attributes

const void * obj
 Pointer to the currently accessed object, NULL if not used.
Protected Attributes inherited from dueca::CommObjectReaderWriter
DataClassRegistry_entry_type entry
 entry giving the class information

Detailed Description

Class to access data in a channel without access to the class of that data.

Note that using a DataReader is in many cases much more efficient, the CommObjectReader is only applicable for generic or data-agnostic reading.

Given the name of one of the Communication object's members, or the index of a data member (as returned by the DataClassRegistry::getMemberIndex call), an ElementReader can be created.

Constructor & Destructor Documentation

◆ CommObjectReader() [1/2]

dueca::CommObjectReader::CommObjectReader ( const char * classname,
const void * obj = NULL )

Constructor, for testing purposes, and for recursively accessing complex objects.

Parameters
classnameType of data; must match, or the result is nonsense!
objPointer to the object.

◆ CommObjectReader() [2/2]

template<typename T>
dueca::CommObjectReader::CommObjectReader ( T & obj)
inline

Templated constructor.

Parameters
objObject to be read.

Member Function Documentation

◆ operator[]() [1/2]

ElementReader dueca::CommObjectReader::operator[] ( const char * ename) const

Return an element accessor based on the element name.

Parameters
enameName of the data member

◆ operator[]() [2/2]

ElementReader dueca::CommObjectReader::operator[] ( unsigned i) const

Return an element accessor based on index.

Parameters
iIndex of the data member

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/dueca-4.2.8-build/dueca-4.2.8/dueca/CommObjectReader.hxx