DUECA/DUSIME
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for dueca::CommObjectReader:
Collaboration graph
[legend]

Public Member Functions

 CommObjectReader (const char *classname, const void *obj=NULL)
 Constructor, for testing purposes, and for recursively accessing complex objects.
 
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 chargetMemberName (unsigned i) const
 Return an element name based on index.
 
const chargetMemberClass (unsigned i) const
 Return an element's class based on index.
 
const chargetMemberKeyClass (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 chargetClassname () 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.
 
CommObjectReaderWriteroperator= (const CommObjectReaderWriter &o)
 assignment, needed for temporary copy MSGPACKtoDCO
 

Protected Attributes

const voidobj
 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()

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.

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: