DUECA/DUSIME
|
Introspective access to data in a channel. More...
#include <CommObjectReader.hxx>
Public Member Functions | |
DCOReader (const char *classname, ChannelReadToken &token, const DataTimeSpec &ts) | |
Constructor. | |
DCOReader (const char *classname, ChannelReadToken &token, const TimeSpec &ts) | |
Constructor with TimeSpec. | |
DCOReader (const char *classname, ChannelReadToken &token, TimeTickType ts=MAX_TIMETICK) | |
Constructor with time tick. | |
~DCOReader () | |
Destructor. | |
const DataTimeSpec & | timeSpec () const |
Return the time specification of the data. | |
const GlobalId & | origin () const |
Return the origin/sender of the data. | |
Public Member Functions inherited from dueca::CommObjectReader | |
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 | |
Additional Inherited Members | |
Protected Attributes inherited from dueca::CommObjectReader | |
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 | |
Introspective access to data in a channel.
The DCOReader accesses the data in a channel. These objects should be created on the stack, and when they go out of scope, the access to the channel is released again.
This variant is for generic, introspective access, using a DataReader is much more efficient when you can program for the data type.
By default, the reader accesses the latest datapoint in the channel that is not newer/later than the time specification (start) or time provided. If that is not what you want, test for the data time specification.
dueca::DCOReader::DCOReader | ( | const char * | classname, |
ChannelReadToken & | token, | ||
const DataTimeSpec & | ts ) |
Constructor.
Note that these objects are light-weight, and meant to be constructed (on the stack) and discarded.
classname | Type of data to be read; must match the data type in the entry accessed with the read token. |
token | Read token. |
ts | Time specification. Accessed data point will not be newer than ts.getValidityStart() |
dueca::DCOReader::DCOReader | ( | const char * | classname, |
ChannelReadToken & | token, | ||
const TimeSpec & | ts ) |
Constructor with TimeSpec.
classname | Type of data to be read; must match the data type in the entry accessed with the read token. |
token | Read token. |
ts | Time specification. Accessed data point will not be newer than ts.getValidityStart() |
dueca::DCOReader::DCOReader | ( | const char * | classname, |
ChannelReadToken & | token, | ||
TimeTickType | ts = MAX_TIMETICK ) |
Constructor with time tick.
classname | Type of data to be read; must match the data type in the entry accessed with the read token. |
token | Read token. |
ts | Time tick. Accessed data point will not be newer than the tick. Note that the default (not specifying this parameter) simply gives you the latest data in the channel if JumpToMatchTime is selected for the read token. |