DUECA/DUSIME
|
The normal event class. More...
#include <Event.hxx>
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. | |
ostream & | print (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 T * | getEventData () const |
Access the data of an event. | |
Public Member Functions inherited from dueca::GenericEvent | |
virtual | ~GenericEvent () |
Destructor. | |
const TimeTickType & | getTime () const |
Return the time associated with the event. | |
const GlobalId & | getMaker () 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. | |
ostream & | print (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. | |
The normal event class.
This is a parametrized class, an event may carry an arbitrary data type (but currently only one type)
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.
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.
dueca::Event< T >::Event | ( | AmorphReStore & | source | ) |
Constructor on the basis of an Amorphous storage object.
For events "coming in" from the net
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.
Overloaded operator for printing of the event to a stream.
This is mainly used for debugging purposes.
void dueca::Event< T >::setData | ( | const T * | data, |
const GlobalId & | sender_id, | ||
const TimeTickType & | time ) |
Insert the corresponding data into the event object.
data | DCO object pointer |
sender_id | Identification of origin |
time | Time of event. |