#include <SDLSystem.h>
Inheritance diagram for cmil::SDL::SDLSystem:
Public Member Functions | |
SDLSystem () | |
SDLSystem (const SDLSystem::Parameters ¶ms, InputArbitrator *const arbitrator) | |
SDLSystem (const SDLSystem::Parameters ¶ms) | |
virtual | ~SDLSystem () |
virtual std::string | getName () const |
virtual void | poll () |
This is an expensive polling operation. | |
Private Member Functions | |
void | init () |
void | init (const SDLSystem::Parameters ¶ms) |
Private Attributes | |
SDLTranslator * | m_default_translator |
Classes | |
class | Parameters |
Definition at line 33 of file SDLSystem.h.
cmil::SDL::SDLSystem::SDLSystem | ( | ) |
Definition at line 53 of file SDLSystem.cpp.
References init().
00053 : m_default_translator(new SDLTranslator(this)) { init(); }
Here is the call graph for this function:
cmil::SDL::SDLSystem::SDLSystem | ( | const SDLSystem::Parameters & | params, | |
InputArbitrator *const | arbitrator | |||
) |
Definition at line 55 of file SDLSystem.cpp.
References init().
00055 : 00056 System(arbitrator), 00057 m_default_translator(new SDLTranslator(this)) 00058 { init(params); }
Here is the call graph for this function:
cmil::SDL::SDLSystem::SDLSystem | ( | const SDLSystem::Parameters & | params | ) |
Definition at line 60 of file SDLSystem.cpp.
References init().
00060 : 00061 m_default_translator(new SDLTranslator(this)) 00062 { init(params); }
Here is the call graph for this function:
virtual cmil::SDL::SDLSystem::~SDLSystem | ( | ) | [inline, virtual] |
virtual std::string cmil::SDL::SDLSystem::getName | ( | ) | const [inline, virtual] |
void cmil::SDL::SDLSystem::init | ( | const SDLSystem::Parameters & | params | ) | [private] |
By default if an invalid custom device was passed, this will create support for the default type.
Since it's a valid device translator, check for added custom devices.
Iterate over the custom device list.
No valid parameters were passed, initialize the system via the default function.
Definition at line 81 of file SDLSystem.cpp.
References cmil::SDL::DeviceTranslator::addCustomDevice(), cmil::SDL::SDLTranslator::addTranslated(), cmil::TranslatorRegistry::addTranslator(), cmil::SDL::SupportedFactory::create(), init(), Logger::log_debug(), Logger::log_error(), m_default_translator, cmil::SDL::SDLSystem::Parameters::m_index, cmil::System::m_translators, and cmil::System::registerDevices().
00081 { 00082 DeviceTranslator* dev_translated = NULL; 00083 bool valid_param = false; 00084 00085 for(Parameters::MapList::const_iterator i = params.m_index.begin(); i != params.m_index.end(); ++i) { 00086 dev_translated = SupportedFactory::create(i->first, this); 00087 00088 if(dev_translated) { 00089 valid_param = true; 00091 00092 if(!(i->second.empty())) 00094 for(Parameters::InputDeviceList::const_iterator j = i->second.begin() ; j != i->second.end() ; ++j) { 00095 if (*j) { 00096 log_debug(std::string("init() attempted to add custom device named: ").append((*j)->getName()) 00097 .append(" to device translator. ")); 00098 dev_translated->addCustomDevice(*j); 00099 } 00100 else 00101 log_debug("init() Null custom device set in parameter device translator, no custom device will be provided for this iteration."); 00102 } 00103 00104 log_debug("init() adding device translator "); 00105 m_default_translator->addTranslated(dev_translated); 00106 } 00107 else 00108 log_error("init() invalid translated device type passed to init()"); 00109 } 00110 00111 if(valid_param) { 00112 m_translators.addTranslator(m_default_translator); 00113 registerDevices(m_default_translator->getDevices()); 00114 } 00115 else { 00117 init(); 00118 } 00119 }
Here is the call graph for this function:
void cmil::SDL::SDLSystem::init | ( | ) | [private] |
Definition at line 64 of file SDLSystem.cpp.
References cmil::SDL::SDLTranslator::addTranslated(), cmil::TranslatorRegistry::addTranslator(), cmil::SDL::SupportedFactory::create(), cmil::SDL::SDLTranslator::getDevices(), cmil::SDL::Keyboards, m_default_translator, cmil::System::m_translators, cmil::SDL::Mice, and cmil::System::registerDevices().
Referenced by init(), and SDLSystem().
00064 { 00065 m_translators.addTranslator(m_default_translator); 00066 00067 m_default_translator->addTranslated(SupportedFactory::create(Mice, this)); 00068 00069 00070 m_default_translator->addTranslated(SupportedFactory::create(Keyboards, this)); 00071 00072 //TODO debug support for these 00073 //m_default_translator->addTranslated(SupportedFactory::create(Controllers, this)); 00074 00075 registerDevices(m_default_translator->getDevices()); 00076 }
Here is the call graph for this function:
Here is the caller graph for this function:
void cmil::SDL::SDLSystem::poll | ( | ) | [virtual] |
This is an expensive polling operation.
Reimplemented from cmil::System.
Definition at line 121 of file SDLSystem.cpp.
References m_default_translator, and cmil::SDL::SDLTranslator::poll().
00121 { 00122 m_default_translator->poll(); 00123 }
Here is the call graph for this function: