cmil::InputData Class Reference

#include <InputData.h>

Inheritance diagram for cmil::InputData:

Inheritance graph
[legend]
Collaboration diagram for cmil::InputData:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InputData (const std::string &name)
virtual ~InputData ()
bool operator== (const InputData &other)
std::string getName () const
bool getState () const
unsigned long getTime () const
unsigned int getID () const
virtual Ev createEv () const
virtual InputDataclone ()=0
virtual bool isActionCompatible (InputAction *const action) const =0
virtual void run (InputAction *const action) const =0

Protected Member Functions

void setDevice (const std::string &device)
void setName (const std::string &name)
void setWhichDevice (int num_device)
void setID (const int id)

Protected Attributes

bool m_state

Private Member Functions

void setTime (unsigned long time)
InputDataoperator= (const InputData &)

Private Attributes

std::string m_name
 Non-const to allow for future modification by custom devices.
unsigned long m_time
unsigned int m_id
 An id useful for indexing.
std::string m_device
 These provide reverse lookup of the device information from InputData.
unsigned int m_num_device

Friends

class DeviceRegistry
class DeviceInputs
class SDL::Relay

Detailed Description

This class provides the base interface for Input Data. General speaking, it's used by CMIL to communicate the kind of event that has occured.

Definition at line 39 of file InputData.h.


Constructor & Destructor Documentation

cmil::InputData::InputData ( const std::string &  name  )  [inline]

Definition at line 41 of file InputData.h.

00041 : m_state(true), m_name(name), m_id(0) {}; 

virtual cmil::InputData::~InputData (  )  [inline, virtual]

Definition at line 43 of file InputData.h.

00043 {}


Member Function Documentation

virtual InputData* cmil::InputData::clone (  )  [pure virtual]

Implemented in cmil::ModData, cmil::Press, cmil::Axis, cmil::Motion, cmil::Coord, and cmil::Hat.

Referenced by cmil::DeviceInputs::DeviceInputs().

Here is the caller graph for this function:

Ev cmil::InputData::createEv (  )  const [virtual]

Definition at line 38 of file InputData.cpp.

References m_device, m_name, and m_num_device.

Referenced by cmil::NodeSequencer::capture().

00038                                {
00040     return Ev(m_num_device, m_device, m_name);
00041   } 

Here is the caller graph for this function:

unsigned int cmil::InputData::getID (  )  const [inline]

Definition at line 56 of file InputData.h.

References m_id.

Referenced by cmil::NormalHandler::canHandle(), cmil::DeviceRegistry::getID(), cmil::ComboHandler::handle(), cmil::NormalHandler::handle(), and cmil::NormalHandler::HandleActivity().

00056 { return m_id; }

Here is the caller graph for this function:

std::string cmil::InputData::getName (  )  const [virtual]

Implements Logger.

Reimplemented in cmil::Motion.

Definition at line 34 of file InputData.cpp.

References m_name.

Referenced by cmil::DeviceInputs::add(), cmil::NormalHandler::canHandle(), cmil::ComboHandler::handle(), cmil::NormalHandler::handle(), cmil::NormalHandler::HandleActivity(), and cmil::InputArbitrator::isActionCompatible().

00034                                      {
00035     return m_name;
00036   } 

Here is the caller graph for this function:

bool cmil::InputData::getState (  )  const [inline]

Definition at line 54 of file InputData.h.

References m_state.

Referenced by cmil::NodeSequencer::capture(), cmil::ComboHandler::handle(), and cmil::NormalHandler::handle().

00054 { return m_state; }

Here is the caller graph for this function:

unsigned long cmil::InputData::getTime (  )  const [inline]

Definition at line 55 of file InputData.h.

References m_time.

Referenced by cmil::ComboHandler::handle().

00055 { return m_time; };

Here is the caller graph for this function:

virtual bool cmil::InputData::isActionCompatible ( InputAction *const   action  )  const [pure virtual]

Implemented in cmil::tInputData< ActionType >, cmil::tInputData< cmil::HatAction >, cmil::tInputData< cmil::CoordAction >, cmil::tInputData< cmil::AxisAction >, cmil::tInputData< cmil::MotionAction >, and cmil::tInputData< cmil::ModAction >.

Referenced by cmil::InputArbitrator::isActionCompatible(), cmil::ComboHandler::isCombo(), and cmil::NormalHandler::isNormal().

Here is the caller graph for this function:

InputData& cmil::InputData::operator= ( const InputData  )  [private]

bool cmil::InputData::operator== ( const InputData other  )  [inline]

Definition at line 45 of file InputData.h.

References m_name.

00045                                               {
00046         if(m_name == other.m_name) {
00047           return true;
00048         }
00049         else  { return false; }
00050       } 

virtual void cmil::InputData::run ( InputAction *const   action  )  const [pure virtual]

Implemented in cmil::tInputData< ActionType >, cmil::tInputData< cmil::HatAction >, cmil::tInputData< cmil::CoordAction >, cmil::tInputData< cmil::AxisAction >, cmil::tInputData< cmil::MotionAction >, and cmil::tInputData< cmil::ModAction >.

Referenced by cmil::ComboHandler::handle(), and cmil::NormalHandler::handle().

Here is the caller graph for this function:

void cmil::InputData::setDevice ( const std::string &  device  )  [inline, protected]

Definition at line 74 of file InputData.h.

References m_device.

Referenced by cmil::DeviceInputs::add().

00074 { m_device = device; }

Here is the caller graph for this function:

void cmil::InputData::setID ( const int  id  )  [inline, protected]

Definition at line 82 of file InputData.h.

References m_id.

00082 { m_id = id; }

void cmil::InputData::setName ( const std::string &  name  )  [inline, protected]

Definition at line 76 of file InputData.h.

References m_name.

00076                                           { 
00077         m_name = name; 
00078       }

void cmil::InputData::setTime ( unsigned long  time  )  [inline, private]

Definition at line 87 of file InputData.h.

References m_time.

Referenced by cmil::SDL::Relay::UpdateSystem().

00087 { m_time = time; };

Here is the caller graph for this function:

void cmil::InputData::setWhichDevice ( int  num_device  )  [inline, protected]

Definition at line 80 of file InputData.h.

References m_num_device.

00080 { m_num_device = num_device; }


Friends And Related Function Documentation

friend class DeviceInputs [friend]

Definition at line 66 of file InputData.h.

friend class DeviceRegistry [friend]

Definition at line 65 of file InputData.h.

friend class SDL::Relay [friend]

Definition at line 86 of file InputData.h.


Member Data Documentation

std::string cmil::InputData::m_device [private]

These provide reverse lookup of the device information from InputData.

Definition at line 97 of file InputData.h.

Referenced by createEv(), and setDevice().

unsigned int cmil::InputData::m_id [private]

An id useful for indexing.

Definition at line 94 of file InputData.h.

Referenced by getID(), and setID().

std::string cmil::InputData::m_name [private]

Non-const to allow for future modification by custom devices.

Definition at line 87 of file InputData.h.

Referenced by createEv(), getName(), operator==(), and setName().

unsigned int cmil::InputData::m_num_device [private]

Definition at line 98 of file InputData.h.

Referenced by createEv(), and setWhichDevice().

bool cmil::InputData::m_state [protected]

State information should be provided irrigardless of the InputData implementations, This allows functions to treat this property of InputData uniformly. See ComboHandler::handle(InputData).

Definition at line 72 of file InputData.h.

Referenced by cmil::Press::do_run(), getState(), and cmil::ModData::setState().

unsigned long cmil::InputData::m_time [private]

Definition at line 91 of file InputData.h.

Referenced by getTime(), and setTime().


The documentation for this class was generated from the following files:
(c) 2006-2007 John P. Feltz
Generated on Wed Jul 25 16:08:02 2007 for Common Media Input Layer by doxygen 1.4.7

SourceForge.net Logo