DUECA/DUSIME
Public Member Functions | List of all members
dueca::Event< T > Class Template Reference

The normal event class. More...

Public Member Functions

 Event (const T *data, const GlobalId &sender_id, const TimeTickType &time)
 Constructor with a pointer to the data. More...
 
 Event (const T &data, const GlobalId &sender_id, const TimeTickType &target_time)
 Constructor that uses a data reference. More...
 
 Event (AmorphReStore &source)
 Constructor on the basis of an Amorphous storage object. More...
 
 Event (const Event< T > &o)
 Copy constructor.
 
 ~Event ()
 Destructor.
 
void packData (AmorphStore &s) const
 Conversion routine to net representation. More...
 
ostream & print (ostream &s) const
 Overloaded operator for printing of the event to a stream. More...
 
void setData (const T *data, const GlobalId &sender_id, const TimeTickType &time)
 Insert the corresponding data into the event object. More...
 
const T * getEventData () const
 Access the data of an event.
 

Detailed Description

template<class T>
class dueca::Event< T >

The normal event class.

This is a parametrized class, an event may carry an arbitrary data type (but currently only one type)

Constructor & Destructor Documentation

◆ Event() [1/3]

template<class T >
dueca::Event< T >::Event ( const T *  data,
const GlobalId sender_id,
const TimeTickType &  time 
)

Constructor with a pointer to the data.

The calling object must make the data object, and pass it to the new Event. After use (everyone has received the event), data and event are destroyed. the target_time is the model time for the event.

Note that this function is not called by application programs, use an EventWrite instead.

◆ Event() [2/3]

template<class T >
dueca::Event< T >::Event ( const T &  data,
const GlobalId sender_id,
const TimeTickType &  target_time 
)

Constructor that uses a data reference.

Safer, but more expensive in the absence of optimization. In other aspects this constructor is equal to the above one.

◆ Event() [3/3]

template<class T >
dueca::Event< T >::Event ( AmorphReStore source)

Constructor on the basis of an Amorphous storage object.

For events "coming in" from the net

Member Function Documentation

◆ packData()

template<class T >
void dueca::Event< T >::packData ( AmorphStore s) const

Conversion routine to net representation.

Converts both the data and the event-specific stuff, such as timing, etc.

◆ print()

template<class T >
ostream& dueca::Event< T >::print ( ostream &  s) const

Overloaded operator for printing of the event to a stream.

This is mainly used for debugging purposes.

◆ setData()

template<class T >
void dueca::Event< T >::setData ( const T *  data,
const GlobalId sender_id,
const TimeTickType &  time 
)

Insert the corresponding data into the event object.

Parameters
dataDCO object pointer
sender_idIdentification of origin
timeTime of event.

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