25 #ifndef EVENT_LIST_H__
26 #define EVENT_LIST_H__
37 typedef event* (*new_event)();
184 static new_event instanciate_event[MAX_EVENTS];
193 #define REGISTER_EVENT(type,evt)\
194 event_list::register_event (type, (new_event) &new_ ## evt);
199 #define NEW_EVENT(evt)\
200 event* new_ ## evt () { return (event*) new evt; }
203 #endif // EVENT_LIST_H__
Class to write data from a Gzip compressed file.
void clear()
Unregisters and deletes all events owned by this list.
Class to read data from a Gzip compressed file.
bool is_paused() const
Check whether the event list is temporarily disabled or not.
event *(* new_event)()
Pointer to a function returning a newly allocated event.
#define u_int8
8 bits long unsigned integer
bool get_state(igzstream &in)
Loads the event_list from a file and registers all loaded events.
void put_state(ogzstream &out) const
Save the event_list to a file.
void add_event(event *ev)
Adds an event to this list.
event_list()
Constructor - creates an empty, unpaused event_list.
event * get_event(const string &id)
Try to retrieve the event with given id from the list.
void resume()
Re-enable the events associated with the event_list, thus 'awaking' the object to life again...
std::vector< event * > Events
List of events.
virtual ~event_list()
Destructor - unregisters and deletes all events owned by this list.
Declares the event class.
static void register_event(u_int8 type, new_event e)
Register an event for loading.
void remove_event(event *ev)
Removes an event from the list.
Base class for objects that want to register events.
void pause()
Disable any events associated with this event_list.