Changeset 7721 in orxonox.OLD for trunk/src/lib/util/executor
- Timestamp:
- May 19, 2006, 4:05:41 AM (19 years ago)
- Location:
- trunk/src/lib/util/executor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/executor/executor.cc
r7714 r7721 33 33 const MultiType& param4) 34 34 { 35 //this->setClassID(CL_EXECUTOR, "Executor");35 this->setClassID(CL_EXECUTOR, "Executor"); 36 36 37 37 // What Parameters have we got -
trunk/src/lib/util/executor/executor_functional.h
r7720 r7721 23 23 #define __EXECUTOR_FUNCTIONAL_H_ 24 24 25 25 #include "base_object.h" 26 #include "multi_type.h" 27 #include "executor.h" 26 28 27 29 template<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; };30 template<> MT_Type ExecutorParamType<bool>(); 31 template<> MT_Type ExecutorParamType<int>(); 32 template<> MT_Type ExecutorParamType<unsigned int>(); 33 template<> MT_Type ExecutorParamType<float>(); 34 template<> MT_Type ExecutorParamType<char>(); 35 template<> MT_Type ExecutorParamType<const std::string&>(); 34 36 35 37 template<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; };38 template<> bool fromString<bool>(const std::string& input, bool defaultValue); 39 template<> int fromString<int>(const std::string& input, int defaultValue); 40 template<> unsigned int fromString<unsigned int>(const std::string& input, unsigned int defaultValue); 41 template<> float fromString<float>(const std::string& input, float defaultValue); 42 template<> char fromString<char>(const std::string& input, char defaultValue); 43 template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue); 42 44 43 45 template<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; };46 template<> bool getDefault<bool>(const MultiType* const defaultValues, unsigned int i); 47 template<> int getDefault<int>(const MultiType* const defaultValues, unsigned int i); 48 template<> unsigned int getDefault<unsigned int>(const MultiType* const defaultValues, unsigned int i); 49 template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i); 50 template<> char getDefault<char>(const MultiType* const defaultValues, unsigned int i); 51 template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i); 50 52 51 53 #endif /* __EXECUTOR_FUNCTIONAL_H_ */
Note: See TracChangeset
for help on using the changeset viewer.