Models an actual OSDL input device, instead of an abstract Ceylan input device. More...
#include <OSDLInputDevice.h>
Public Member Functions | |
InputDevice () | |
Constructs an actual input device not linked to any OSDL controller. | |
InputDevice (OSDL::MVC::Controller &actualController) | |
Constructs an actual input device that will send events to the specified OSDL controller. | |
virtual | ~InputDevice () throw () |
Basic virtual destructor. | |
virtual OSDL::MVC::Controller & | getActualController () const |
Returns the actual (OSDL) controller this input device should be linked to. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns an user-friendly description of the state of this object. | |
Private Member Functions | |
InputDevice (const InputDevice &source) | |
Copy constructor made private to ensure that it will never be called. | |
InputDevice & | operator= (const InputDevice &source) |
Assignment operator made private to ensure that it will never be called. |
Models an actual OSDL input device, instead of an abstract Ceylan input device.
The difference lies in the fact that OSDL controllers have to be aware of all the low level events that can occur, therefore they cannot be basic Ceylan::Controller. These last ones cannot be extended with low level events since it would make Ceylan depend on multimedia back-end (namely SDL).
The result is that input devices such as joysticks cannot be linked with abstract Ceylan::Controller instances, which as such would be useless. In order to have access to the specialized controllers we need, an OSDL input device linked with an OSDL controller is an interesting solution, insofar as it ensures that all actual input devices (ex: joysticks) can call, say, the axisChanged method of their controller: each actual input device will have to implement the getActualController method.
Definition at line 84 of file OSDLInputDevice.h.
InputDevice::InputDevice | ( | ) |
Constructs an actual input device not linked to any OSDL controller.
Definition at line 40 of file OSDLInputDevice.cc.
InputDevice::InputDevice | ( | OSDL::MVC::Controller & | actualController | ) | [explicit] |
Constructs an actual input device that will send events to the specified OSDL controller.
Definition at line 48 of file OSDLInputDevice.cc.
InputDevice::~InputDevice | ( | ) | throw () [virtual] |
Basic virtual destructor.
Definition at line 56 of file OSDLInputDevice.cc.
OSDL::Events::InputDevice::InputDevice | ( | const InputDevice & | source | ) | [explicit, private] |
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
OSDL::MVC::Controller & InputDevice::getActualController | ( | ) | const [virtual] |
Returns the actual (OSDL) controller this input device should be linked to.
EventException | if this input device is not linked to any controller, or if the controller is not an OSDL one. |
Definition at line 63 of file OSDLInputDevice.cc.
Referenced by OSDL::Events::Joystick::axisChanged(), OSDL::Events::ClassicalJoystick::axisChanged(), OSDL::Events::Mouse::buttonPressed(), OSDL::Events::Joystick::buttonPressed(), OSDL::Events::ClassicalJoystick::buttonPressed(), OSDL::Events::Mouse::buttonReleased(), OSDL::Events::Joystick::buttonReleased(), OSDL::Events::ClassicalJoystick::buttonReleased(), OSDL::Events::Mouse::focusGained(), OSDL::Events::Mouse::focusLost(), OSDL::Events::Joystick::hatChanged(), OSDL::Events::Mouse::mouseMoved(), and OSDL::Events::Joystick::trackballChanged().
InputDevice& OSDL::Events::InputDevice::operator= | ( | const InputDevice & | source | ) | [private] |
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
const string InputDevice::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Reimplemented in OSDL::Events::ClassicalJoystick, OSDL::Events::Joystick, and OSDL::Events::Mouse.
Definition at line 72 of file OSDLInputDevice.cc.