|
| | DataWriter (ChannelWriteToken &token, const TimeSpec &ts) |
| | Constructor.
|
| | DataWriter (ChannelWriteToken &token, const DataTimeSpec &ts) |
| | Constructor.
|
| | DataWriter (ChannelWriteToken &token, const TimeTickType ts=SimTime::getTimeTick()) |
| | Constructor with tick.
|
| template<typename N1> |
| | DataWriter (ChannelWriteToken &token, const TimeSpec &ts, N1 n1) |
| | Constructor.
|
| template<typename N1> |
| | DataWriter (ChannelWriteToken &token, const DataTimeSpec &ts, N1 n1) |
| | Constructor.
|
| template<typename N1> |
| | DataWriter (ChannelWriteToken &token, const TimeTickType &ts, N1 n1) |
| | Constructor.
|
| template<typename N1, typename N2> |
| | DataWriter (ChannelWriteToken &token, const TimeSpec &ts, N1 n1, N2 n2) |
| | Constructor.
|
| template<typename N1, typename N2> |
| | DataWriter (ChannelWriteToken &token, const DataTimeSpec &ts, N1 n1, N2 n2) |
| | Constructor.
|
| template<typename N1, typename N2> |
| | DataWriter (ChannelWriteToken &token, const TimeTickType &ts, N1 n1, N2 n2) |
| | Constructor.
|
| template<typename N1, typename N2, typename N3> |
| | DataWriter (ChannelWriteToken &token, const TimeSpec &ts, N1 n1, N2 n2, N3 n3) |
| | Constructor.
|
| template<typename N1, typename N2, typename N3> |
| | DataWriter (ChannelWriteToken &token, const DataTimeSpec &ts, N1 n1, N2 n2, N3 n3) |
| | Constructor.
|
| template<typename N1, typename N2, typename N3> |
| | DataWriter (ChannelWriteToken &token, const TimeTickType &ts, N1 n1, N2 n2, N3 n3) |
| | Constructor.
|
|
T & | data () |
| | Access the data in the channel, returns a reference to the data.
|
|
| ~DataWriter () |
| | Destructor.
|
template<class T>
class dueca::DataWriter< T >
This is a facilitator for writing multi-stream data.
By creating a "DataWriter", the access token is used to gain access to the data in the channel. When at the end of scope the DataWriter is destroyed, the access is released again, and the actual data is sent.
An example, suppose you have created a ChannelWriteToken for a channel with MyData objects:
{
w.data().a = some_value;
w.data().b = some_other_value;
}
DataTimeSpec ts
Time specification to be used.
Definition DataWriter.hxx:32
DataWriter(ChannelWriteToken &token, const TimeSpec &ts)
Constructor.
Definition DataWriter.hxx:120
The DataWriter template, which will create an object for your modification, but always starts from clean, blank objects. Note that you should provide a proper definition of what is default when you write the .dco file defining your data type.
If you rather update an object you had previously sent, you can use the DataUpdater template. Note that the DataUpdater does not work for initialisation of array sizes.
template<class T>
template<typename N1, typename N2, typename N3>
Constructor.
Gains access to the channel for which the token was made, for initializing objects with three parameters
Note that using only a tick does not make sense with stream data, only use for event data!
- Parameters
-
| token | Write access token. |
| ts | Time tick/moment. |
| n1 | First parameter passed to the constructor of the written object |
| n2 | Second parameter passed to the constructor of the written object |
| n3 | Third parameter passed to the constructor of the written object |