DUECA/DUSIME
|
This is a light weight (on the stack) object to facilitate for writing stream data. More...
#include <StreamWriter.hxx>
Additional Inherited Members | |
Protected Member Functions inherited from dueca::DataWriterBase | |
DataWriterBase (ChannelWriteToken &token, const DataTimeSpec &ts) | |
Constructor. | |
void | releaseAccess (void *data_ptr) |
Releasing the read access means that the data will be made accessible for reading. | |
void | baseCheckAccess (uint32_t magic) |
Verify the magic number and validity for access. | |
Protected Attributes inherited from dueca::DataWriterBase | |
ChannelWriteToken & | token |
Access to the channel. | |
DataTimeSpec | ts |
Time specification to be used. | |
This is a light weight (on the stack) object to facilitate for writing stream data.
By creating a "StreamWriter", the access token is used to gain access to the data in the channel. The data() member of the StreamWriter can be used to write the proper data. When at the end of scope the StreamWriter is destroyed, the actual data is sent.
T | Data type of the channel |
init | If false, the newly written variable is not initialised using the default constructor. Default is true. Note that, to have any positive effect from this, the default values for the data type need to be specified in the dco file. |
An example, suppose you have created a StreamChannelWriteToken for a channel with MyData objects:
|
inline |
Constructor.
Gains access to the channel for which the token was made.
token | Read access token. |
ts | Time specification. |
|
inline |
Destructor.
Releases the access again with a token.
Check that the stream writing is OK.
Only applicable in code without exceptions.