cmil::InputArbitrator Class Reference

registers input devices, and receives event information from InputTranslator(s), notifies InputActor(s) More...

#include <InputArbitrator.h>

Inheritance diagram for cmil::InputArbitrator:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

InputData *const getData (const Ev &event) const
 ~InputArbitrator ()
std::string getDefaultDevice () const
std::string getName () const
void quit ()

Protected Member Functions

void registerDevice (InputDevice &dev)
void registerDevices (DeviceRegistry &dev)
const bool isActionCompatible (int id, InputAction *action) const
const int getID (const Ev &event) const
InputData *const getData (int id) const
int getSize () const
void update (const InputData &input)
void update (const ModData &input)
void attach (InputActor *const actor)

Private Member Functions

 InputArbitrator (DeviceRegistry *reg)
 InputArbitrator ()
 InputArbitrator (const InputArbitrator &)
InputArbitratoroperator= (const InputArbitrator &)

Private Attributes

DeviceRegistrym_registry
InputActorm_pActor

Friends

class InputTranslator
class System

Detailed Description

registers input devices, and receives event information from InputTranslator(s), notifies InputActor(s)

Definition at line 26 of file InputArbitrator.h.


Constructor & Destructor Documentation

cmil::InputArbitrator::~InputArbitrator (  )  [inline]

Definition at line 32 of file InputArbitrator.h.

References cmil::DeviceRegistry::cleanup(), Logger::log_debug(), and m_registry.

00032                          { 
00033         log_debug("dtor");
00034         m_registry->cleanup() ; delete m_registry; 
00035       }; 

Here is the call graph for this function:

cmil::InputArbitrator::InputArbitrator ( DeviceRegistry reg  )  [inline, private]

Definition at line 64 of file InputArbitrator.h.

00064 : m_registry(reg), m_pActor(NULL) {}; 

cmil::InputArbitrator::InputArbitrator (  )  [inline, private]

Definition at line 65 of file InputArbitrator.h.

00065 : m_registry(new DeviceRegistry()), m_pActor(NULL) {}; 

cmil::InputArbitrator::InputArbitrator ( const InputArbitrator  )  [private]


Member Function Documentation

void cmil::InputArbitrator::attach ( InputActor *const   actor  )  [protected]

Definition at line 69 of file InputArbitrator.cpp.

References m_pActor.

Referenced by cmil::System::attach().

00069                                                 {
00070     m_pActor = actor;
00071   }

Here is the caller graph for this function:

InputData *const cmil::InputArbitrator::getData ( int  id  )  const [protected]

Definition at line 46 of file InputArbitrator.cpp.

References cmil::DeviceRegistry::getData(), and m_registry.

00046                                                         {
00047     return m_registry->getData(id);
00048   }

Here is the call graph for this function:

InputData *const cmil::InputArbitrator::getData ( const Ev event  )  const

Definition at line 50 of file InputArbitrator.cpp.

References cmil::DeviceRegistry::getData(), and m_registry.

Referenced by cmil::System::getData(), and isActionCompatible().

00050                                                                  { 
00051     return m_registry->getData(event); 
00052   }

Here is the call graph for this function:

Here is the caller graph for this function:

string cmil::InputArbitrator::getDefaultDevice (  )  const

Definition at line 42 of file InputArbitrator.cpp.

References cmil::DeviceRegistry::getDefaultDevice(), and m_registry.

00042                                                  {
00043     return m_registry->getDefaultDevice();
00044   }

Here is the call graph for this function:

const int cmil::InputArbitrator::getID ( const Ev event  )  const [protected]

Definition at line 54 of file InputArbitrator.cpp.

References cmil::DeviceRegistry::getID(), and m_registry.

Referenced by cmil::System::getID().

00054                                                         {
00055     return m_registry->getID(event);
00056   }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string cmil::InputArbitrator::getName (  )  const [inline, virtual]

Implements Logger.

Definition at line 39 of file InputArbitrator.h.

00039                                 {
00040         return "InputArbitrator";
00041       };

int cmil::InputArbitrator::getSize (  )  const [protected]

Definition at line 58 of file InputArbitrator.cpp.

References cmil::DeviceRegistry::getSize(), and m_registry.

Referenced by cmil::System::getSize().

00058                                      {
00059     return m_registry->getSize();
00060   }

Here is the call graph for this function:

Here is the caller graph for this function:

const bool cmil::InputArbitrator::isActionCompatible ( int  id,
InputAction action 
) const [protected]

Definition at line 62 of file InputArbitrator.cpp.

References getData(), cmil::InputData::getName(), cmil::InputData::isActionCompatible(), and Logger::log_debug().

Referenced by cmil::System::isActionCompatible().

00062                                                                                   {
00063     std::ostringstream debug_ss;
00064     debug_ss << "isActionCompatible() deferring to data with id: " << id << "and name: " << getData(id)->getName();
00065     log_debug(debug_ss.str() );
00066     return getData(id)->isActionCompatible(action); 
00067   }

Here is the call graph for this function:

Here is the caller graph for this function:

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

void cmil::InputArbitrator::quit (  ) 

Definition at line 96 of file InputArbitrator.cpp.

References Logger::log_debug(), m_pActor, and cmil::InputActor::quit().

Referenced by cmil::System::quit().

00096                              {
00097     if(m_pActor)
00098       m_pActor->quit();
00099     else 
00100       log_debug( "update() no InputActor set, can't send quit signal." );
00101   }

Here is the call graph for this function:

Here is the caller graph for this function:

void cmil::InputArbitrator::registerDevice ( InputDevice dev  )  [protected]

Definition at line 78 of file InputArbitrator.cpp.

References m_registry, and cmil::DeviceRegistry::registerDevice().

00078                                                        {
00079     m_registry->registerDevice(dev);
00080   }

Here is the call graph for this function:

void cmil::InputArbitrator::registerDevices ( DeviceRegistry dev  )  [protected]

Definition at line 73 of file InputArbitrator.cpp.

References Logger::log_debug(), m_registry, and cmil::DeviceRegistry::mergeRegistry().

Referenced by cmil::System::registerDevices().

00073                                                            {
00074     log_debug("registerDevices()");
00075     m_registry->mergeRegistry(dev);
00076   }

Here is the call graph for this function:

Here is the caller graph for this function:

void cmil::InputArbitrator::update ( const ModData input  )  [protected]

Definition at line 82 of file InputArbitrator.cpp.

References Logger::log_debug(), m_pActor, and cmil::InputActor::update().

00082                                                    {
00083     if(m_pActor)
00084       m_pActor->update(input);
00085     else 
00086       log_debug("update() no InputActor set, can't update." );
00087   }

Here is the call graph for this function:

void cmil::InputArbitrator::update ( const InputData input  )  [protected]

Definition at line 89 of file InputArbitrator.cpp.

References Logger::log_debug(), m_pActor, and cmil::InputActor::update().

Referenced by cmil::System::update().

00089                                                      {
00090     if(m_pActor)
00091       m_pActor->update(input);
00092     else 
00093       log_debug( "update() no InputActor set, can't update." );
00094   }

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class InputTranslator [friend]

Definition at line 45 of file InputArbitrator.h.

friend class System [friend]

Definition at line 46 of file InputArbitrator.h.


Member Data Documentation

InputActor* cmil::InputArbitrator::m_pActor [private]

Definition at line 68 of file InputArbitrator.h.

Referenced by attach(), quit(), and update().

DeviceRegistry* cmil::InputArbitrator::m_registry [private]

Definition at line 65 of file InputArbitrator.h.

Referenced by getData(), getDefaultDevice(), getID(), getSize(), registerDevice(), registerDevices(), and ~InputArbitrator().


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