DUECA/DUSIME
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dueca::GenericEvent Class Reference

Generic event class. More...

#include <GenericEvent.hxx>

Inheritance diagram for dueca::GenericEvent:
Inheritance graph
[legend]
Collaboration diagram for dueca::GenericEvent:
Collaboration graph
[legend]

Public Member Functions

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.
 

Protected Member Functions

 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

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

Generic event class.

Defines the generic event data, such as time stamp and originator of the event

Constructor & Destructor Documentation

◆ GenericEvent()

dueca::GenericEvent::GenericEvent ( const GlobalId & maker_id,
const TimeTickType & time_stamp )
protected

Constructor.

Note that making GenericEvent events is not useful, this constructur is usually called from a derived event. Application-level code seldom or never needs to construct events. Instead send (and implicitly create) events by using an EventWriter object.

Member Function Documentation

◆ packData()

void dueca::GenericEvent::packData ( AmorphStore & target) const
inline

Packs the data of the GenericEvent into an amorphous storage object.

Note that a GenericEvent by itself is not useful. Specific event types derived from it are useful, and this function is called by the packData function packing the derived event type.

◆ assumeDataOwnership()

void dueca::GenericEvent::assumeDataOwnership ( const GlobalId & new_owner) const

This is a very dangerous function.

It is used by DUECA itself to avoid copying huge objects (typically activity log data). It can only be used if the calling function is the only user of the event channel. Responsibility for destroying the event data will lie with the caller that took over ownership. Do not consider using this unless you are really really sure of yourself.


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