DUECA/DUSIME
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dueca::EventWriter< T > Class Template Reference

This is a facilitator for writing event data. More...

#include <EventWriter.hxx>

Inheritance diagram for dueca::EventWriter< T >:
Inheritance graph
[legend]
Collaboration diagram for dueca::EventWriter< T >:
Collaboration graph
[legend]

Public Member Functions

 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts=DataTimeSpec::now())
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1)
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1, unsigned int n2)
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1, unsigned int n2, unsigned int n3)
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4)
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4, unsigned int n5)
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4, unsigned int n5, unsigned int n6)
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4, unsigned int n5, unsigned int n6, unsigned int n7)
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4, unsigned int n5, unsigned int n6, unsigned int n7, unsigned int n8)
 Constructor.
 
 EventWriter (EventChannelWriteToken< T > &token, const DataTimeSpec &ts, unsigned int n1, unsigned int n2, unsigned int n3, unsigned int n4, unsigned int n5, unsigned int n6, unsigned int n7, unsigned int n8, unsigned int n9)
 Constructor.
 
 ~EventWriter ()
 Destructor.
 
- Public Member Functions inherited from dueca::DataWriter< T >
 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.
 
Tdata ()
 Access the data in the channel, returns a reference to the data.
 
 ~DataWriter ()
 Destructor.
 

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
ChannelWriteTokentoken
 Access to the channel.
 
DataTimeSpec ts
 Time specification to be used.
 

Detailed Description

template<class T>
class dueca::EventWriter< T >

This is a facilitator for writing event data.

By creating a "EventWriter", an event data object is created. When at the end of scope the EventWriter is destroyed, the data object is sent over the channel.

Template Parameters
Datatype of the event channel, normally a dco (DUECA Comunication Object), generated from a .dco file.

An example, suppose you have created an EventChannelWriteToken for a channel with MyData objects:

// create the writer
// put the proper data in
w.data().a = some_value;
// etc. Note that you get cryptic error messages if you forget
// that data() is a function, and type "w.data.a"
// Another note: unless you specify defaults for the data in
// your MyData.dco file, the stuff that is in the MyData event
// is initially undefined. So do not forget to assign values to
// all members of your event.
} // <-- This closing bracket ends the "scope", in which
// EventWriter<MyData> w was created. That means that at this
// point the EventWriter<MyData> destructor is called. The
// destructor actually sends the data over the channel.
const T & data()
Access to the data.
Definition DataReader.hxx:456
DataTimeSpec ts
Time specification to be used.
Definition DataWriter.hxx:32
This is a "light weight object" that enables you to read the latest set of data on a StreamChannelEnd...
Definition StreamReaderLatest.hxx:43

Constructor & Destructor Documentation

◆ EventWriter() [1/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts = DataTimeSpec::now() )

Constructor.

Gains access to the channel for which the token was made.

Parameters
tokenRead access token.
tsTime specification. If not supplied, the current time will be taken.

◆ EventWriter() [2/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1 )

Constructor.

Gains access to the channel for which the token was made, one variable-size array.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.

◆ EventWriter() [3/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1,
unsigned int n2 )

Constructor.

Gains access to the channel for which the token was made, two variable-size arrays.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.
n2Size of the second variable-size array.

◆ EventWriter() [4/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1,
unsigned int n2,
unsigned int n3 )

Constructor.

Gains access to the channel for which the token was made, three variable-size arrays.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.
n2Size of the second variable-size array.
n3Size of the third variable-size array.

◆ EventWriter() [5/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1,
unsigned int n2,
unsigned int n3,
unsigned int n4 )

Constructor.

Gains access to the channel for which the token was made, four variable-size arrays.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.
n2Size of the second variable-size array.
n3Size of the third variable-size array
n4Size of the fourth variable-size array.

◆ EventWriter() [6/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1,
unsigned int n2,
unsigned int n3,
unsigned int n4,
unsigned int n5 )

Constructor.

Gains access to the channel for which the token was made, five variable-size arrays.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.
n2Size of the second variable-size array.
n3Size of the third variable-size array
n4Size of the fourth variable-size array
n5Size of the fifth variable-size array.

◆ EventWriter() [7/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1,
unsigned int n2,
unsigned int n3,
unsigned int n4,
unsigned int n5,
unsigned int n6 )

Constructor.

Gains access to the channel for which the token was made, six variable-size arrays.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.
n2Size of the second variable-size array.
n3Size of the third variable-size array
n4Size of the fourth variable-size array
n5Size of the fifth variable-size array
n6Size of the sixth variable-size array.

◆ EventWriter() [8/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1,
unsigned int n2,
unsigned int n3,
unsigned int n4,
unsigned int n5,
unsigned int n6,
unsigned int n7 )

Constructor.

Gains access to the channel for which the token was made, seven variable-size arrays.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.
n2Size of the second variable-size array.
n3Size of the third variable-size array
n4Size of the fourth variable-size array
n5Size of the fifth variable-size array
n6Size of the sixth variable-size array
n7Size of the seventh variable-size array.

◆ EventWriter() [9/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1,
unsigned int n2,
unsigned int n3,
unsigned int n4,
unsigned int n5,
unsigned int n6,
unsigned int n7,
unsigned int n8 )

Constructor.

Gains access to the channel for which the token was made, eight variable-size arrays.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.
n2Size of the second variable-size array.
n3Size of the third variable-size array
n4Size of the fourth variable-size array
n5Size of the fifth variable-size array
n6Size of the sixth variable-size array
n7Size of the seventh variable-size array
n8Size of the eighth variable-size array.

◆ EventWriter() [10/10]

template<class T >
dueca::EventWriter< T >::EventWriter ( EventChannelWriteToken< T > & token,
const DataTimeSpec & ts,
unsigned int n1,
unsigned int n2,
unsigned int n3,
unsigned int n4,
unsigned int n5,
unsigned int n6,
unsigned int n7,
unsigned int n8,
unsigned int n9 )

Constructor.

Gains access to the channel for which the token was made, nine variable-size arrays.

Parameters
tokenRead access token.
tsTime specification.
n1Size of the variable-size array.
n2Size of the second variable-size array.
n3Size of the third variable-size array
n4Size of the fourth variable-size array
n5Size of the fifth variable-size array
n6Size of the sixth variable-size array
n7Size of the seventh variable-size array
n8Size of the eighth variable-size array
n9Size of the ninth variable-size array.

◆ ~EventWriter()

template<class T >
dueca::EventWriter< T >::~EventWriter ( )
inline

Destructor.

Releases the access again with a token. This initiates the actual sending of the data.


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