#include <ModuleSelector.h>
Inheritance diagram for ModuleSelector:
Public Member Functions | |
ModuleSelector (SolutionRequest::ModuleID id) | |
Constructor. | |
~ModuleSelector () | |
Destructor. | |
virtual Module * | createSolution (SolutionRequest::ModuleSolutionID id)=0 |
Is called on start and when the selected solution changes to create a specific solution. | |
void | init () |
Creates the default solution. | |
virtual void | selectSolution (SolutionRequest::ModuleSolutionID id) |
Selects a module. | |
SolutionRequest::ModuleSolutionID | getSelectedSolution () const |
Returns the index of the selected solution. | |
virtual void | execute () |
Executes the selected module. | |
virtual bool | handleMessage (InMessage &message) |
Called from a MessageQueue to distribute messages. | |
Protected Attributes | |
SolutionRequest::ModuleSolutionID | selectedSolutionID |
The id of the selected solution. | |
SolutionRequest::ModuleID | moduleID |
The id of the module, needed only for error messages. | |
Module * | selectedSolution |
The selected solution. |
Module selectors allow to switch between different solutions for a modules.
Martin Lötzsch
Definition at line 25 of file ModuleSelector.h.
|
Constructor.
Definition at line 14 of file ModuleSelector.cpp. References SolutionRequest::getDefaultSolution(), and selectedSolutionID. |
Here is the call graph for this function:
|
Destructor.
Definition at line 20 of file ModuleSelector.cpp. References selectedSolution. |
|
Is called on start and when the selected solution changes to create a specific solution.
Implemented in BallLocatorSelector, BehaviorControlSelector, CollisionDetectorSelector, ColorTableModSelector, GetupEngineSelector, HeadControlSelector, ImageProcessorSelector, LEDControlSelector, MotionControlSelector, ObstaclesLocatorSelector, PlayersLocatorSelector, RobotStateDetectorSelector, SelfLocatorSelector, SensorBehaviorControlSelector, SensorDataProcessorSelector, SoundControlSelector, TeamBallLocatorSelector, and WalkingEngineSelector. Referenced by init(). |
|
Creates the default solution. This can not be done in the constructor, as the derived selector class is not created yet. Definition at line 57 of file ModuleSelector.cpp. References createSolution(), idText, moduleID, OUTPUT, selectedSolution, and selectedSolutionID. Referenced by selectSolution(), and ModuleHandler::setModuleSelector(). |
Here is the call graph for this function:
|
Selects a module.
Definition at line 25 of file ModuleSelector.cpp. References ASSERT, init(), selectedSolution, selectedSolutionID, and solutionRequestMaxNumOfSolutions. Referenced by ModuleHandler::selectSolution(). |
Here is the call graph for this function:
|
Returns the index of the selected solution.
Definition at line 39 of file ModuleSelector.cpp. References selectedSolutionID. Referenced by ModuleHandler::getSelectedSolution(), and ModuleHandler::selectSolution(). |
|
Executes the selected module.
Definition at line 44 of file ModuleSelector.cpp. References Module::execute(), and selectedSolution. Referenced by Motion::main(), and Cognition::main(). |
Here is the call graph for this function:
|
Called from a MessageQueue to distribute messages. Use message.getMessageID to decide if the message is relavant for the MesssageHandler derivate.
Implements MessageHandler. Reimplemented in WalkingEngineSelector. Definition at line 49 of file ModuleSelector.cpp. References Module::handleMessage(), and selectedSolution. Referenced by ModuleHandler::handleMessage(), Motion::handleMessage(), and Cognition::handleMessage(). |
Here is the call graph for this function:
|
The id of the selected solution.
Definition at line 29 of file ModuleSelector.h. Referenced by getSelectedSolution(), init(), ModuleSelector(), and selectSolution(). |
|
The id of the module, needed only for error messages.
Definition at line 80 of file ModuleSelector.h. Referenced by init(). |
|
The selected solution.
Definition at line 83 of file ModuleSelector.h. Referenced by execute(), handleMessage(), init(), selectSolution(), and ~ModuleSelector(). |