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

Definition at line 85 of file Gizmo.hpp.


Constructor & Destructor Documentation

Gizmo::Gizmo (  ) 

Serialize Constructor.

Gizmo Serialize Constructor.

Definition at line 66 of file Gizmo.cpp.

Gizmo::Gizmo ( GizmoClass  Class,
const H::DeviceInfo deviceInfo,
int  DeviceID,
int  DeviceClassID 
)

Default Constructor.

Gizmo Default Constructor.

Definition at line 56 of file Gizmo.cpp.

References Gizmod::GIZMO_KEY_MAX, mClass, mDeviceClassID, mDeviceID, and mKeyState.

Gizmo::~Gizmo (  )  [virtual]

Destructor.

Gizmo Destructor.

Definition at line 72 of file Gizmo.cpp.


Member Function Documentation

GizmoClass Gizmo::getClass (  )  [virtual]

Get the class of the Gizmo.

Get the class of 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"

Definition at line 86 of file Gizmo.cpp.

References mClass.

int Gizmo::getDeviceID (  ) 

Get the Device ID.

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

Definition at line 96 of file Gizmo.cpp.

References mDeviceID.

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.

Definition at line 108 of file Gizmo.cpp.

References mDeviceClassID.

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

Get a key state.

Get the class of the Gizmo.

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

Definition at line 117 of file Gizmo.cpp.

References mKeyState.

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

Get the type of the Gizmo.

Get the type of 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.

Definition at line 128 of file Gizmo.cpp.

References GIZMO_TYPE_UNSPECIFIED.

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.

Definition at line 137 of file Gizmo.cpp.

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)

Definition at line 147 of file Gizmo.cpp.

References mKeyState.

Referenced by Gizmod::GizmoStandard::processEvent(), Gizmod::GizmoPowermate::processEvent(), and Gizmod::GizmoATIX10::processEvent().


The documentation for this class was generated from the following files:
Generated on Wed Nov 7 10:07:01 2007 for gizmod by  doxygen 1.5.3