DUECA/DUSIME
|
Class to access data in a channel without access to the class of that data. More...
#include <CommObjectReader.hxx>
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 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. | |
CommObjectReaderWriter & | operator= (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 | |
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, for testing purposes, and for recursively accessing complex objects.
classname | Type of data; must match, or the result is nonsense! |
obj | Pointer to the object. |
ElementReader dueca::CommObjectReader::operator[] | ( | const char * | ename | ) | const |
Return an element accessor based on the element name.
ename | Name of the data member |
ElementReader dueca::CommObjectReader::operator[] | ( | unsigned | i | ) | const |
Return an element accessor based on index.
i | Index of the data member |