#include <_src_input_device.hh>
Public Types | |
| typedef base::Event::ListenerFunctor | ListenerFunctor |
Public Member Functions | |
| bool | Enable (const bool enable=true) |
| bool | IfEnabled (void) const |
| void | Enqueue (const DeviceEvent &event) |
| bool | PeekQueue (DeviceEvent &event) const |
| bool | Dequeue (DeviceEvent &event) |
| uint | QueueSize (void) const |
| void | SetQueueOverflow (const uint overflow) |
| void | RegisterListener (shptr< ListenerFunctor > listener) |
| void | UnregisterListener (shptr< ListenerFunctor > listener) |
Protected Member Functions | |
| Device (void) | |
| virtual | ~Device () |
| virtual bool | EnableDevice (void)=0 |
Private Types | |
| typedef std::deque< DeviceEvent > | Queue |
Private Member Functions | |
| void | VentQueue (void) |
Private Attributes | |
| bool | mEnabledLogical |
| if device and input queue are both enabled | |
| bool | mEnabledDevice |
| if EnableDevice() succeeded (assigned only once) | |
| bool | mTriedToEnableDevice |
| if tried to call EnableDevice() | |
| Queue | mQueue |
| queue of events | |
| uint | mQueueOverflow |
| vent if more than this many events | |
| base::Event | mBroadcaster |
| object used to broadcast input events to listeners | |
Device base class.
A concrete Device class will consist of:
All Devices shall be initially disabled to let program become ready.
Implementation:
| typedef base::Event ::ListenerFunctor input::Device< DeviceEvent >::ListenerFunctor |
typedef std::deque<DeviceEvent> input::Device< DeviceEvent >::Queue [private] |
| input::Device< DeviceEvent >::Device | ( | void | ) | [protected] |
ctor/dtor.
| input::Device< DeviceEvent >::~Device | ( | ) | [protected, virtual] |
| bool input::Device< DeviceEvent >::Dequeue | ( | DeviceEvent & | event | ) |
Dequeue next event.
| bool input::Device< DeviceEvent >::Enable | ( | const bool | enable = true |
) |
Template Method pattern.
| virtual bool input::Device< DeviceEvent >::EnableDevice | ( | void | ) | [protected, pure virtual] |
Implemented in input::JoystickDeviceNop, input::JoystickDeviceSDL, input::KeyboardDeviceOSG, and input::MouseDeviceOSG.
| void input::Device< DeviceEvent >::Enqueue | ( | const DeviceEvent & | event | ) |
Enqueue an event.
| bool input::Device< DeviceEvent >::IfEnabled | ( | void | ) | const |
| bool input::Device< DeviceEvent >::PeekQueue | ( | DeviceEvent & | event | ) | const |
Peek next event without dequeueing it.
| uint input::Device< DeviceEvent >::QueueSize | ( | void | ) | const |
| void input::Device< DeviceEvent >::RegisterListener | ( | shptr< ListenerFunctor > | listener | ) |
Register functor to be called when an event is enqueued.
| void input::Device< DeviceEvent >::SetQueueOverflow | ( | const uint | overflow | ) |
Set the maximum amount of events that can be queued at one time. 0 : disable overflowing
| void input::Device< DeviceEvent >::UnregisterListener | ( | shptr< ListenerFunctor > | listener | ) |
Unregister listener.
| void input::Device< DeviceEvent >::VentQueue | ( | void | ) | [private] |
Begin dropping events if queue is overflowing. The joystick is more prone to causing this problem than the keyboard.
base::Event input::Device< DeviceEvent >::mBroadcaster [private] |
object used to broadcast input events to listeners
bool input::Device< DeviceEvent >::mEnabledDevice [private] |
if EnableDevice() succeeded (assigned only once)
bool input::Device< DeviceEvent >::mEnabledLogical [private] |
if device and input queue are both enabled
Queue input::Device< DeviceEvent >::mQueue [private] |
queue of events
uint input::Device< DeviceEvent >::mQueueOverflow [private] |
vent if more than this many events
bool input::Device< DeviceEvent >::mTriedToEnableDevice [private] |
if tried to call EnableDevice()
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:11