Gizmod::Gizmo Class Reference

Base class of all Gizmos. More...

#include <Gizmo.hpp>

Inheritance diagram for Gizmod::Gizmo:

Inheritance graph
[legend]
Collaboration diagram for Gizmod::Gizmo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual GizmoClass getClass ()
 Get the class of the Gizmo.
int getDeviceID ()
 Get the Device ID.
int getDeviceClassID ()
 Get the Device Class ID.
virtual int getKeyState (GizmoKey Key)
 Get a key state.
virtual std::string getType ()
 Get the type of the Gizmo.
virtual bool processEvent (GizmoEvent *pEvent)
 Process an event.
void setKeyState (GizmoKey Key, int State)
 Set a keystate of the Gizmo.
 Gizmo ()
 Serialize Constructor.
 Gizmo (GizmoClass Class, const H::DeviceInfo &deviceInfo, int DeviceID, int DeviceClassID)
 Default Constructor.
virtual ~Gizmo ()
 Destructor.

Protected Attributes

GizmoClass mClass
 Class of the Gizmo.
int mDeviceID
 Unique ID of the device.
int mDeviceClassID
 ID of the device in its class.
int mKeyState [GIZMO_KEY_MAX]
 Gizmos's key states.

Friends

class boost::serialization::access

Detailed Description

Base class of all Gizmos.

This class is the base of all Gizmos attached to the system. Each Gizmo must inherit this class


Member Function Documentation

GizmoClass Gizmo::getClass (  )  [virtual]

Get the class of the Gizmo.

Returns:
GizmoClass of the Gizmo
Note that this is also implemented in Python as a property so it can be accessed as a variable by referencing ".GizmoClass"

int Gizmo::getDeviceClassID (  ) 

Get the Device Class ID.

Returns:
The Device Class ID
Each Gizmo in this GizmoClass will have an ID that is unique only amongst this class.

Effectively this can be used to find out which Powermate device an event belongs to, and so forth.

int Gizmo::getDeviceID (  ) 

Get the Device ID.

Returns:
The Device ID
This is the unique Device ID of the Gizmo

int Gizmo::getKeyState ( GizmoKey  Key  )  [virtual]

Get a key state.

Parameters:
Key The key to inquire upon
Returns:
The value of the button (0 == off, 1 == on, 2 == repeating)

std::string Gizmo::getType (  )  [virtual]

Get the type of the Gizmo.

Returns:
Type of the Gizmo
Note that this is also implemented in Python as a property so it can be accessed as a variable by referencing ".GizmoType"

Reimplemented in Gizmod::GizmoATIX10, Gizmod::GizmoLIRC, Gizmod::GizmoPowermate, and Gizmod::GizmoStandard.

bool Gizmo::processEvent ( GizmoEvent pEvent  )  [virtual]

Process an event.

Parameters:
pEvent The event to process
Returns:
True on if the event should get passed on to the script

Reimplemented in Gizmod::GizmoATIX10, Gizmod::GizmoLIRC, Gizmod::GizmoPowermate, and Gizmod::GizmoStandard.

void Gizmo::setKeyState ( GizmoKey  Key,
int  State 
)

Set a keystate of the Gizmo.

Parameters:
Key The key to change states
State The new state (0 == off, 1 == on, 2 == repeating)


The documentation for this class was generated from the following files:
Generated on Wed Jun 27 12:43:41 2007 for gizmod by  doxygen 1.4.7