Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7721 in orxonox.OLD for trunk/src/lib/util/executor


Ignore:
Timestamp:
May 19, 2006, 4:05:41 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: introduced the absolutely new, much faster, more templated, and easier to look at Executor, and use it directly inside the LoadParam-Class

Location:
trunk/src/lib/util/executor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor.cc

    r7714 r7721  
    3333                   const MultiType& param4)
    3434{
    35 //  this->setClassID(CL_EXECUTOR, "Executor");
     35  this->setClassID(CL_EXECUTOR, "Executor");
    3636
    3737  // What Parameters have we got
  • trunk/src/lib/util/executor/executor_functional.h

    r7720 r7721  
    2323#define __EXECUTOR_FUNCTIONAL_H_
    2424
    25 
     25#include "base_object.h"
     26#include "multi_type.h"
     27#include "executor.h"
    2628
    2729template<typename type> MT_Type ExecutorParamType() { return MT_EXT1; };
    28 template<> MT_Type ExecutorParamType<bool>() { return MT_EXT1; };
    29 template<> MT_Type ExecutorParamType<int>() { return MT_INT; };
    30 template<> MT_Type ExecutorParamType<unsigned int>() { return MT_UINT; };
    31 template<> MT_Type ExecutorParamType<float>() { return MT_FLOAT; };
    32 template<> MT_Type ExecutorParamType<char>() { return MT_CHAR; };
    33 template<> MT_Type ExecutorParamType<const std::string&>() { return MT_STRING; };
     30template<> MT_Type ExecutorParamType<bool>();
     31template<> MT_Type ExecutorParamType<int>();
     32template<> MT_Type ExecutorParamType<unsigned int>();
     33template<> MT_Type ExecutorParamType<float>();
     34template<> MT_Type ExecutorParamType<char>();
     35template<> MT_Type ExecutorParamType<const std::string&>();
    3436
    3537template<typename type> type fromString(const std::string& input, type defaultValue) {return defaultValue; };
    36 template<> bool fromString<bool>(const std::string& input, bool defaultValue) { return isBool(input, defaultValue); };
    37 template<> int fromString<int>(const std::string& input, int defaultValue) { return isInt(input, defaultValue); };
    38 template<> unsigned int fromString<unsigned int>(const std::string& input, unsigned int defaultValue) { return isInt(input, defaultValue); };
    39 template<> float fromString<float>(const std::string& input, float defaultValue) { return isFloat(input, defaultValue); };
    40 template<> char fromString<char>(const std::string& input, char defaultValue) { return isInt(input, defaultValue); };
    41 template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { static std::string retVal = isString(input, defaultValue); return retVal; };
     38template<> bool fromString<bool>(const std::string& input, bool defaultValue);
     39template<> int fromString<int>(const std::string& input, int defaultValue);
     40template<> unsigned int fromString<unsigned int>(const std::string& input, unsigned int defaultValue);
     41template<> float fromString<float>(const std::string& input, float defaultValue);
     42template<> char fromString<char>(const std::string& input, char defaultValue);
     43template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue);
    4244
    4345template<typename type> type getDefault(const MultiType* const defaultValues, unsigned int i) { return (type)0; };
    44 template<> bool getDefault<bool>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getBool(); };
    45 template<> int getDefault<int>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getInt(); };
    46 template<> unsigned int getDefault<unsigned int>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getInt(); };
    47 template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getFloat(); };
    48 template<> char getDefault<char>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getChar(); };
    49 template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i) { static std::string retVal = defaultValues[i].getString(); return retVal; };
     46template<> bool getDefault<bool>(const MultiType* const defaultValues, unsigned int i);
     47template<> int getDefault<int>(const MultiType* const defaultValues, unsigned int i);
     48template<> unsigned int getDefault<unsigned int>(const MultiType* const defaultValues, unsigned int i);
     49template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i);
     50template<> char getDefault<char>(const MultiType* const defaultValues, unsigned int i);
     51template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i);
    5052
    5153#endif /* __EXECUTOR_FUNCTIONAL_H_ */
Note: See TracChangeset for help on using the changeset viewer.