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

# Modules/GetupEngine/GetupEngineSelector.h

Go to the documentation of this file.

    00001 /**
    00002 * @file GetupEngineSelector.h
    00003 *
    00004 * Declares the GetupEngine selection module
    00005 * @author Max Risler
    00006 */
    00007
    00008 #ifndef __GetupEngineSelector_h_
    00009 #define __GetupEngineSelector_h_
    00010
    00011 #include "Tools/Module/ModuleHandler.h"
    00012 #include "GT2005GetupEngine.h"
    00013
    00014 /**
    00015 * @class GetupEngineSelector
    00016 *
    00017 * A module selector for GetupEngine modules.
    00018 */
    00019 class GetupEngineSelector : public ModuleSelector, public GetupEngineInterfaces
    00020 {
    00021 public:
    00022 /**
    00023 * Constructor.
    00024 * @param handler The module handler of the process.
    00025 * @param interfaces The paramters of the GetupEngine module.
    00026   */
    00027   GetupEngineSelector(ModuleHandler &handler, const GetupEngineInterfaces& interfaces)
    00028     : ModuleSelector(SolutionRequest::getupEngine),
    00029     GetupEngineInterfaces(interfaces)
    00030   {
    00031     handler.setModuleSelector(SolutionRequest::getupEngine,this);
    00032   }
    00033
    00034   /**
    00035   * Is called on start and when the selected solution changes
    00036   * to create a specific solution.
    00037   * @param id The id of the solution to create
    00038   * @return The created solution or 0
    00039   */
    00040   virtual Module* createSolution(SolutionRequest::ModuleSolutionID id)
    00041   {
    00042     switch (id)
    00043     {
    00044     case SolutionRequest::gt2005GetupEngine:
    00045       return new GT2005GetupEngine(*this);
    00046     default:
    00047       return 0;
    00048     }
    00049   }
    00050
    00051   /** Executes the module*/
    00052   bool executeParameterized(JointData& jointData)
    00053   {
    00054     if (selectedSolution!=0)
    00055       return ((GetupEngine*)selectedSolution)->executeParameterized(jointData);
    00056     else
    00057       return false;
    00058   }
    00059 };
    00060
    00061 #endif // __GetupEngineSelector_h_