MachineIntelligenceCore:Toolchain
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mic::application::KeyHandlerRegistry Class Reference

Abstract class responsible for handling the keypressed callbacks. Implements several basic callbacks and offers several mechnisms for callback management. More...

#include <KeyHandlerRegistry.hpp>

Public Member Functions

 KeyHandlerRegistry ()
 
virtual ~KeyHandlerRegistry ()
 
virtual void keyboardHandler (unsigned char key)
 
template<class SlotClass >
void registerKeyhandler (char key_, std::string description_, void(SlotClass::*function_)(void), SlotClass *obj_)
 
std::string changeInputMode (unsigned char finishKey_)
 

Public Attributes

bool extendedInputMode
 
unsigned char finishKey
 
std::string payload
 

Protected Member Functions

void keyhandlerQuit (void)
 
void keyhandlerDisplayOptions (void)
 
void keyhandlerIncrementLoggerLevel (void)
 
void keyhandlerDecrementLoggerLevel (void)
 
void keyhandlerToggleLearning (void)
 
void keyhandlerPause (void)
 
void keyhandlerSingleStep (void)
 
void keyhandlerSlowDown (void)
 
void keyhandlerFastenUp (void)
 
void keyhandlerResetProcessingTime (void)
 
void keyhandlerDisplayAppState (void)
 

Protected Attributes

KeyHandlerMap key_handler_map
 

Detailed Description

Abstract class responsible for handling the keypressed callbacks. Implements several basic callbacks and offers several mechnisms for callback management.

Author
tkornuta

Definition at line 83 of file KeyHandlerRegistry.hpp.

Constructor & Destructor Documentation

mic::application::KeyHandlerRegistry::KeyHandlerRegistry ( )
mic::application::KeyHandlerRegistry::~KeyHandlerRegistry ( )
virtual

Destructor - virtual, empty for now.

Definition at line 54 of file KeyHandlerRegistry.cpp.

Member Function Documentation

std::string mic::application::KeyHandlerRegistry::changeInputMode ( unsigned char  finishKey_)

Definition at line 158 of file KeyHandlerRegistry.cpp.

References extendedInputMode, finishKey, and payload.

void mic::application::KeyHandlerRegistry::keyboardHandler ( unsigned char  key)
virtual

Handles the keypressed event.

Parameters
key_Pressed key.

Definition at line 58 of file KeyHandlerRegistry.cpp.

References extendedInputMode, finishKey, key_handler_map, LOG, LSTATUS, LTRACE, LWARNING, and payload.

void mic::application::KeyHandlerRegistry::keyhandlerDecrementLoggerLevel ( void  )
protected

Keyhandler: decrements the logger severity level.

Definition at line 115 of file KeyHandlerRegistry.cpp.

References LOG, LOGGER, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerDisplayAppState ( void  )
protected

Keyhandler: display application status.

Definition at line 153 of file KeyHandlerRegistry.cpp.

References APP_STATE, LOG, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerDisplayOptions ( void  )
protected

Keyhandler: displays help.

Definition at line 88 of file KeyHandlerRegistry.cpp.

References key_handler_map, LOG, LSTATUS, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerFastenUp ( void  )
protected

Keyhandler: fastens up the processing (divides the sleep interval by 1.5).

Definition at line 143 of file KeyHandlerRegistry.cpp.

References APP_STATE, LOG, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerIncrementLoggerLevel ( void  )
protected

Keyhandler: increments the logger severity level.

Definition at line 110 of file KeyHandlerRegistry.cpp.

References LOG, LOGGER, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerPause ( void  )
protected

Keyhandler: quits the program.

Definition at line 126 of file KeyHandlerRegistry.cpp.

References APP_STATE, LOG, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerQuit ( void  )
protected

Keyhandler: quits the program.

Definition at line 101 of file KeyHandlerRegistry.cpp.

References APP_STATE, LOG, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerResetProcessingTime ( void  )
protected

Keyhandler: resets the processing time (sets the sleep interval to 1s).

Definition at line 148 of file KeyHandlerRegistry.cpp.

References APP_STATE, LOG, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerSingleStep ( void  )
protected

Keyhandler: displays help.

Definition at line 132 of file KeyHandlerRegistry.cpp.

References APP_STATE, LOG, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerSlowDown ( void  )
protected

Keyhandler: slows down the processing (multiplies the sleep interval by 1.5).

Definition at line 138 of file KeyHandlerRegistry.cpp.

References APP_STATE, LOG, and LTRACE.

Referenced by KeyHandlerRegistry().

void mic::application::KeyHandlerRegistry::keyhandlerToggleLearning ( void  )
protected

Keyhandler: toggless learning on/off.

Definition at line 120 of file KeyHandlerRegistry.cpp.

References APP_STATE, LOG, and LTRACE.

Referenced by KeyHandlerRegistry().

template<class SlotClass >
void mic::application::KeyHandlerRegistry::registerKeyhandler ( char  key_,
std::string  description_,
void(SlotClass::*)(void)  function_,
SlotClass *  obj_ 
)
inline

Method for registration of user-defined handlers.

Parameters
key_Key triggering the handler.
description_Handler description.
function_Executed function.
Template Parameters
SlotClassTemplate class defining the class containing the function.

Definition at line 111 of file KeyHandlerRegistry.hpp.

References key_handler_map.

Referenced by KeyHandlerRegistry().

Member Data Documentation

bool mic::application::KeyHandlerRegistry::extendedInputMode

Definition at line 121 of file KeyHandlerRegistry.hpp.

Referenced by changeInputMode(), keyboardHandler(), and KeyHandlerRegistry().

unsigned char mic::application::KeyHandlerRegistry::finishKey

Definition at line 122 of file KeyHandlerRegistry.hpp.

Referenced by changeInputMode(), and keyboardHandler().

KeyHandlerMap mic::application::KeyHandlerRegistry::key_handler_map
protected

Map of <key, description, function>.

Definition at line 130 of file KeyHandlerRegistry.hpp.

Referenced by keyboardHandler(), keyhandlerDisplayOptions(), and registerKeyhandler().

std::string mic::application::KeyHandlerRegistry::payload

Definition at line 123 of file KeyHandlerRegistry.hpp.

Referenced by changeInputMode(), and keyboardHandler().


The documentation for this class was generated from the following files: