Changeset 8408 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- Jun 14, 2006, 5:50:18 PM (19 years ago)
- Location:
- trunk/src/lib/util
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/executor/executor.h
r8271 r8408 33 33 * Objects of any Class (Templated) 34 34 * Default Values 35 * Functions with up to 5 parameters (more seems useless)35 * Functions with up to 5 parameters (more seems overhead, split up the function) 36 36 * Functions with many types (@see functor_list.h) 37 37 */ -
trunk/src/lib/util/executor/executor_functional.cc
r8035 r8408 15 15 16 16 #include "executor.h" 17 18 std::string ExecutorFunctional_returningString_from; 19 std::string ExecutorFunctional_returningString_default; 17 std::string ExecutorFunctional_returningString_from[5]; 20 18 21 19 … … 32 30 template<> float fromString<float>(const std::string& input, float defaultValue) { return isFloat(input, defaultValue); }; 33 31 template<> char fromString<char>(const std::string& input, char defaultValue) { return isInt(input, defaultValue); }; 34 template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { return ExecutorFunctional_returningString_from = isString(input, defaultValue); };32 template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { return (input.size() > 0) ? input : defaultValue; }; 35 33 36 34 … … 48 46 template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getFloat(); }; 49 47 template<> char getDefault<char>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getChar(); }; 50 template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i) { return ExecutorFunctional_returningString_ default= defaultValues[i].getString(); };48 template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i) { return ExecutorFunctional_returningString_from[i] = defaultValues[i].getString(); }; 51 49 52 50 -
trunk/src/lib/util/executor/executor_lua.cc
r8271 r8408 18 18 #include "executor_lua.h" 19 19 20 std::string temp; 20 #include "lunar.h" 21 21 22 std::string temp[5]; 23 24 template<typename type> type* fromLua(lua_State* state, int index) { type *obj = Lunar<type>::check(state, 1); lua_remove(state, 1); return obj;}; 22 25 template<> bool fromLua<bool>(lua_State* state, int index) { return lua_toboolean(state, index); }; 23 26 template<> int fromLua<int>(lua_State* state, int index) { return (int)lua_tonumber(state, index); }; … … 25 28 template<> float fromLua<float>(lua_State* state, int index) { return (float)lua_tonumber(state, index); }; 26 29 template<> char fromLua<char>(lua_State* state, int index) { return (char)lua_tonumber(state, index); }; 27 template<> const std::string& fromLua<const std::string&>(lua_State* state, int index) { temp = lua_tostring(state, index); return temp; };30 template<> const std::string& fromLua<const std::string&>(lua_State* state, int index) { temp[index] = lua_tostring(state, index); return temp[index]; }; 28 31 29 32 30 33 template<typename type> void toLua(lua_State* state, type value) { Lunar<type>::push(state, value, false); }; 31 34 template<> void toLua<bool>(lua_State* state, bool value) { lua_pushboolean(state, (int) value); }; 32 35 template<> void toLua<int>(lua_State* state, int value) { lua_pushnumber(state, (lua_Number) value); }; -
trunk/src/lib/util/executor/executor_lua.h
r8271 r8408 14 14 15 15 16 template<typename type> type fromLua(lua_State* state, int index) { PRINTF(1)("NOT IMPLEMENTED\n"); };16 template<typename type> type fromLua(lua_State* state, int index); 17 17 template<> bool fromLua<bool>(lua_State* state, int index); 18 18 template<> int fromLua<int>(lua_State* state, int index); … … 23 23 24 24 25 template<typename type> void toLua(lua_State* state, type value) { PRINTF(1)("NOT IMPLEMENTED\n"); };25 template<typename type> void toLua(lua_State* state, type value); 26 26 template<> void toLua<bool>(lua_State* state, bool value); 27 27 template<> void toLua<int>(lua_State* state, int value); … … 339 339 }; 340 340 341 342 343 344 345 346 347 341 #endif /* _EXECUTOR_LUA_H */ -
trunk/src/lib/util/loading/load_param.cc
r8316 r8408 31 31 : object(object), paramName(paramName) 32 32 { 33 this->object = object;34 33 this->inLoadCycle = inLoadCycle; 35 34 -
trunk/src/lib/util/substring.h
r7477 r8408 70 70 inline unsigned int size() const { return this->strings.size(); }; 71 71 /** @param i the i'th String @returns the i'th string from the subset of Strings */ 72 const std::string& operator[](unsigned int i) const { return (i < this->strings.size()) ? this->strings[i] : emptyString;return this->getString(i); };72 inline const std::string& operator[](unsigned int i) const { return (i < this->strings.size()) ? this->strings[i] : emptyString; }; 73 73 /** @param i the i'th String @returns the i'th string from the subset of Strings */ 74 const std::string& getString(unsigned int i) const { return (*this)[i]; };74 inline const std::string& getString(unsigned int i) const { return (*this)[i]; }; 75 75 76 76 // the almighty algorithm.
Note: See TracChangeset
for help on using the changeset viewer.