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

The normal event class. More...

#include <Event.hxx>

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

Public Member Functions

 Event (const T *data, const GlobalId &sender_id, const TimeTickType &time)
 Constructor with a pointer to the data.
 
 Event (const T &data, const GlobalId &sender_id, const TimeTickType &target_time)
 Constructor that uses a data reference.
 
 Event (AmorphReStore &source)
 Constructor on the basis of an Amorphous storage object.
 
 Event (const Event< T > &o)
 Copy constructor.
 
 ~Event ()
 Destructor.
 
void packData (AmorphStore &s) const
 Conversion routine to net representation.
 
ostreamprint (ostream &s) const
 Overloaded operator for printing of the event to a stream.
 
void setData (const T *data, const GlobalId &sender_id, const TimeTickType &time)
 Insert the corresponding data into the event object.
 
const TgetEventData () const
 Access the data of an event.
 
- Public Member Functions inherited from dueca::GenericEvent
virtual ~GenericEvent ()
 Destructor.
 
const TimeTickTypegetTime () const
 Return the time associated with the event.
 
const GlobalIdgetMaker () const
 Return the ID of the maker of the event.
 
void packData (AmorphStore &target) const
 Packs the data of the GenericEvent into an amorphous storage object.
 
ostreamprint (ostream &os) const
 Print the generic event to stream.
 
bool operator< (const GenericEvent &e2) const
 Returns true if this event is earlier than another one.
 
bool operator> (const GenericEvent &e2) const
 Returns true if this event is later than another one.
 
bool operator== (const GenericEvent &e2) const
 Returns true if this event from the same time as another one.
 
void assumeDataOwnership (const GlobalId &new_owner) const
 This is a very dangerous function.
 

Additional Inherited Members

- Protected Member Functions inherited from dueca::GenericEvent
 GenericEvent (const GlobalId &maker_id, const TimeTickType &time_stamp)
 Constructor.
 
 GenericEvent (const GenericEvent &ev)
 Copy constructor.
 
 GenericEvent (AmorphReStore &source)
 Constructs a GenericEvent from amorphous storage.
 
- Protected Attributes inherited from dueca::GenericEvent
GlobalId maker_id
 the maker of the event
 
TimeTickType time_stamp
 the time at which this event was created
 
bool own_event_data
 A flag to indicate whether event data is owned by this event, if this is so, the event data is deleted upon event deletion.
 

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: