DUECA/DUSIME
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dueca::DCOReader Class Reference

Introspective access to data in a channel. More...

#include <CommObjectReader.hxx>

Inheritance diagram for dueca::DCOReader:
Inheritance graph
[legend]
Collaboration diagram for dueca::DCOReader:
Collaboration graph
[legend]

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 DataTimeSpectimeSpec () const
 Return the time specification of the data.
 
const GlobalIdorigin () 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 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
 

Additional Inherited Members

- Protected Attributes inherited from dueca::CommObjectReader
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

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.

Constructor & Destructor Documentation

◆ DCOReader() [1/3]

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.

Parameters
classnameType of data to be read; must match the data type in the entry accessed with the read token.
tokenRead token.
tsTime specification. Accessed data point will not be newer than ts.getValidityStart()

◆ DCOReader() [2/3]

dueca::DCOReader::DCOReader ( const char * classname,
ChannelReadToken & token,
const TimeSpec & ts )

Constructor with TimeSpec.

Parameters
classnameType of data to be read; must match the data type in the entry accessed with the read token.
tokenRead token.
tsTime specification. Accessed data point will not be newer than ts.getValidityStart()

◆ DCOReader() [3/3]

dueca::DCOReader::DCOReader ( const char * classname,
ChannelReadToken & token,
TimeTickType ts = MAX_TIMETICK )

Constructor with time tick.

Parameters
classnameType of data to be read; must match the data type in the entry accessed with the read token.
tokenRead token.
tsTime 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.

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