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

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

#include <CommObjectWriter.hxx>

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

Public Member Functions

 DCOWriter (const char *classname, ChannelWriteToken &token, const DataTimeSpec &ts)
 Constructor.
 
 DCOWriter (ChannelWriteToken &token, const DataTimeSpec &ts)
 Constructor.
 
 DCOWriter (ChannelWriteToken &token, TimeTickType ts=SimTime::getTimeTick())
 Constructor with time tick, for event writing.
 
 ~DCOWriter ()
 Destructor.
 
void failed ()
 Flag a failure or error.
 
- Public Member Functions inherited from dueca::CommObjectWriter
 CommObjectWriter (const char *classname, void *obj=NULL)
 Constructor.
 
ElementWriter operator[] (const char *ename)
 Return an element accessor based on the element name.
 
ElementWriter operator[] (unsigned i)
 Return an element accessor based on index.
 
 ~CommObjectWriter ()
 Destructor.
 
CommObjectWriteroperator= (const CommObjectWriter &o)
 assignment, needed for temporary copy MSGPACKtoDCO
 
- 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::CommObjectWriter
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 DCOWriter 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.

A DCOWriter is an alternative to using a DataWriter. This variant is for generic, introspective access, using a DataWriter is much more efficient when you can program for the data type.

Constructor & Destructor Documentation

◆ DCOWriter() [1/3]

dueca::DCOWriter::DCOWriter ( const char * classname,
ChannelWriteToken & 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 write token.
tokenRead token.
tsTime specification.

◆ DCOWriter() [2/3]

dueca::DCOWriter::DCOWriter ( ChannelWriteToken & token,
const DataTimeSpec & ts )

Constructor.

Note that these objects are light-weight, and meant to be constructed (on the stack) and discarded. This version assumes the data type from the channel entry.

Parameters
tokenWrite token.
tsTime specification.

◆ DCOWriter() [3/3]

dueca::DCOWriter::DCOWriter ( ChannelWriteToken & token,
TimeTickType ts = SimTime::getTimeTick() )

Constructor with time tick, for event writing.

Note that these objects are light-weight, and meant to be constructed (on the stack) and discarded. This version assumes the data type from the channel entry.

Parameters
tokenWrite token.
tsTime specification, if omitted, takes current tick.

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