FCam::EventGenerator Class Reference

A base class for things that generate events. More...

#include <Event.h>

Inheritance diagram for FCam::EventGenerator:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual std::string getEventString (const Event &) const
 Event generators must implement this, which returns a string describing an event that they generated.

Protected Member Functions

void postEvent (Event)
 Event generators can call this to post their event to the event queue.

Friends

bool getNextEvent (Event *)
 Copies the next pending event into the pointer given.


Detailed Description

A base class for things that generate events.

Inherit from EventGenerator to post events to the event queue. This interface is a contract - if you want the ability to post events to the queue, you must also implement the method which describes those events.

Definition at line 68 of file Event.h.


Friends And Related Function Documentation

bool getNextEvent ( Event  )  [friend]

Copies the next pending event into the pointer given.

Returns false if there are no outstanding events. You should periodically process all pending events like so:

FCam::Event event;
while (getNextEvent(&event)) {
    switch(event.type) {
    case FCam::Event::Error:
        ...
        break;
    case FCam::Event::Warning:
        ...
        break;
    case FCam::Event::ShutterPressed:
        ...
        break;
    ...
    default:
        cerr << "Unknown event: " << event.description();
    }
}

Definition at line 8 of file Event.cpp.


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

Generated on Mon Jan 18 20:48:13 2010 for FCam by  doxygen 1.5.6