event_record Class Reference

A simple record for holding onto event info. More...

#include <event_record.h>

Inheritance diagram for event_record:

Inheritance graph
[legend]
Collaboration diagram for event_record:

Collaboration graph
[legend]
List of all members.

Public Types

enum  events

Public Member Functions

 event_record (int id=0, int event=0)
 event_record (int id, int event, const byte_array &data, const int_set &targets=int_set())
 ~event_record ()
void pack (byte_array &packed_form) const
 Creates a packed form of the packable object in "packed_form".
bool unpack (byte_array &packed_form)
 Restores the packable from the "packed_form".

Public Attributes

int _id
 the program-wide unique id for the object to deliver this to.
int _event
 the numerical identifier of the event that occurred.
byte_array _data
 the data, if any.
int_set _targets
 the list of recipients for this.

Detailed Description

A simple record for holding onto event info.

NOTE: this is a heavy-weight header and it should not be included in other headers. instead, forward define the event_record class.

Definition at line 30 of file event_record.h.


Member Enumeration Documentation

enum event_record::events

Definition at line 44 of file event_record.h.


Constructor & Destructor Documentation

event_record::event_record ( int  id = 0,
int  event = 0 
)

Definition at line 24 of file event_record.cpp.

event_record::event_record ( int  id,
int  event,
const byte_array data,
const int_set targets = int_set() 
)

Definition at line 27 of file event_record.cpp.

event_record::~event_record (  ) 

Definition at line 31 of file event_record.cpp.


Member Function Documentation

void event_record::pack ( byte_array packed_form  )  const [virtual]

Creates a packed form of the packable object in "packed_form".

This must append to the data in "packed_form" rather than clearing prior contents.

Implements packable.

Definition at line 33 of file event_record.cpp.

References _data, _event, _id, _targets, basis::attach(), and basis::pack_simple().

Referenced by zing_table::zing_event().

bool event_record::unpack ( byte_array packed_form  )  [virtual]

Restores the packable from the "packed_form".

This object becomes the unpacked form, and therefore must lose any of its prior contents that depend on the data in "packed_form". This is up to the derived unpack function to figure out. The "packed_form" is modified by extracting all of the pieces that are used for this object; the remainder stays in "packed_form". true is returned if the unpacking was successful.

Implements packable.

Definition at line 41 of file event_record.cpp.

References _data, _event, _id, _targets, basis::detach(), and basis::unpack_simple().


Member Data Documentation

int event_record::_id

the program-wide unique id for the object to deliver this to.

Definition at line 33 of file event_record.h.

Referenced by pack(), and unpack().

int event_record::_event

the numerical identifier of the event that occurred.

Definition at line 34 of file event_record.h.

Referenced by pack(), zing_table::peek_event(), zing_table::pop_event(), and unpack().

byte_array event_record::_data

the data, if any.

Definition at line 35 of file event_record.h.

Referenced by pack(), zing_table::peek_event(), zing_table::pop_event(), and unpack().

int_set event_record::_targets

the list of recipients for this.

Definition at line 36 of file event_record.h.

Referenced by pack(), zing_table::peek_event(), zing_table::pop_event(), and unpack().


The documentation for this class was generated from the following files:
Generated on Thu Aug 28 04:34:58 2008 for HOOPLE Libraries by  doxygen 1.5.1