Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# ModuleHandler Class Reference

Manages runtime exhangeable modules. More...

`#include <ModuleHandler.h>`

Inheritance diagram for ModuleHandler:

[legend]
Collaboration diagram for ModuleHandler:

[legend]
List of all members.

## Public Member Functions
| ModuleHandler ()
| Constructor.
ModuleSelector * | pGetModuleSelector (SolutionRequest::ModuleID id) const
| Returns pointer to selector module.
void | setModuleSelector (SolutionRequest::ModuleID id, ModuleSelector *module)
| Set pointer to selector module.
SolutionRequest::ModuleSolutionID | getSelectedSolution (SolutionRequest::ModuleID id) const
| Returns the id of the selected solution for a module id.
void | selectSolution (SolutionRequest::ModuleID id, SolutionRequest::ModuleSolutionID solution)
| Selects solution defined by solution in module id.
void | selectSolutions (SolutionRequest request)
| Selects solutions as defined by a solution request.
virtual bool | handleMessage (InMessage &message)
| Called from a MessageQueue to distribute messages.
## Private Attributes
ModuleSelector * | pModuleSelectors [SolutionRequest::numOfModules]
| Pointers to all module selectors.

## Detailed Description

Manages runtime exhangeable modules.

Author:
  Max Risler

  Martin Lötzsch

Definition at line 23 of file ModuleHandler.h.

## Constructor & Destructor Documentation

ModuleHandler::ModuleHandler | ( |  | ) |

| Constructor. Definition at line 13 of file ModuleHandler.cpp. References pModuleSelectors.

## Member Function Documentation

ModuleSelector * ModuleHandler::pGetModuleSelector | ( | SolutionRequest::ModuleID | id | ) | const

  | Returns pointer to selector module. Parameters:
  id | id of module.
Definition at line 19 of file ModuleHandler.cpp. References pModuleSelectors. Referenced by Process::processMain().

void ModuleHandler::setModuleSelector | ( | SolutionRequest::ModuleID | id,
|  | ModuleSelector * | module
| ) |

  | Set pointer to selector module. Parameters:
  id | id of module.
  module | a pointer to the module selector
Definition at line 41 of file ModuleHandler.cpp. References ModuleSelector::init(), and pModuleSelectors. Referenced by BallLocatorSelector::BallLocatorSelector(), BehaviorControlSelector::BehaviorControlSelector(), CollisionDetectorSelector::CollisionDetectorSelector(), ColorTableModSelector::ColorTableModSelector(), GetupEngineSelector::GetupEngineSelector(), GTCamSelector::GTCamSelector(), HeadControlSelector::HeadControlSelector(), ImageProcessorSelector::ImageProcessorSelector(), LEDControlSelector::LEDControlSelector(), MotionControlSelector::MotionControlSelector(), ObstaclesLocatorSelector::ObstaclesLocatorSelector(), PlayersLocatorSelector::PlayersLocatorSelector(), RobotStateDetectorSelector::RobotStateDetectorSelector(), SelfLocatorSelector::SelfLocatorSelector(), SensorBehaviorControlSelector::SensorBehaviorControlSelector(), SensorDataProcessorSelector::SensorDataProcessorSelector(), SoundControlSelector::SoundControlSelector(), TeamBallLocatorSelector::TeamBallLocatorSelector(), WalkingEngineSelector::WalkingEngineSelector(), and GT2005MotionControl::~GT2005MotionControl().

Here is the call graph for this function:

SolutionRequest::ModuleSolutionID ModuleHandler::getSelectedSolution | ( | SolutionRequest::ModuleID | id | ) | const

| Returns the id of the selected solution for a module id. Definition at line 47 of file ModuleHandler.cpp. References ModuleSelector::getSelectedSolution(), and pModuleSelectors. Referenced by Process::processMain(), and selectSolution().

Here is the call graph for this function:

void ModuleHandler::selectSolution | ( | SolutionRequest::ModuleID | id,
|  | SolutionRequest::ModuleSolutionID | solution
| ) |

| Selects solution defined by solution in module id. Definition at line 55 of file ModuleHandler.cpp. References getSelectedSolution(), ModuleSelector::getSelectedSolution(), idText, OUTPUT, pModuleSelectors, and ModuleSelector::selectSolution(). Referenced by selectSolutions().

Here is the call graph for this function:

void ModuleHandler::selectSolutions | ( | SolutionRequest | request | ) |

| Selects solutions as defined by a solution request. Definition at line 67 of file ModuleHandler.cpp. References selectSolution(), and SolutionRequest::solutions. Referenced by Process::handleMessage().

Here is the call graph for this function:

bool ModuleHandler::handleMessage | ( | InMessage & | message | ) | `[virtual]`

  | Called from a MessageQueue to distribute messages. Use message.getMessageID to decide if the message is relavant for the MesssageHandler derivate. Use message.bin, message.text or message.config as In streams to get the data from. Parameters:
  message | The message that can be read.
Returns: true if the message was read (handled). Implements MessageHandler. Definition at line 24 of file ModuleHandler.cpp. References ModuleSelector::handleMessage(), pModuleSelectors, and InMessage::resetReadPosition(). Referenced by Process::handleMessage().

Here is the call graph for this function:

## Member Data Documentation

ModuleSelector* ModuleHandler::pModuleSelectors[SolutionRequest::numOfModules]`[private]`

| Pointers to all module selectors. Definition at line 27 of file ModuleHandler.h. Referenced by getSelectedSolution(), handleMessage(), ModuleHandler(), pGetModuleSelector(), selectSolution(), and setModuleSelector().

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

- Tools/Module/ModuleHandler.h
- Tools/Module/ModuleHandler.cpp