Changeset 9733 in orxonox.OLD for branches/new_class_id/src/lib/util/executor/executor.cc
- Timestamp:
- Sep 15, 2006, 3:39:51 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/executor/executor.cc
r9732 r9733 18 18 #include "executor.h" 19 19 20 21 20 template<> MT_Type ExecutorParamType<bool>() { return MT_BOOL; }; 22 21 template<> MT_Type ExecutorParamType<int>() { return MT_INT; }; … … 25 24 template<> MT_Type ExecutorParamType<char>() { return MT_CHAR; }; 26 25 template<> MT_Type ExecutorParamType<const std::string&>() { return MT_STRING; }; 27 28 29 30 /**31 * @brief constructs and registers a new Command32 * @param commandName the name of the Command33 * @param className the name of the class to apply this command to34 * @param paramCount the count of parameters this command takes35 */36 ExecutorBase::ExecutorBase(bool hasRetVal,37 const MultiType& param0,38 const MultiType& param1,39 const MultiType& param2,40 const MultiType& param3,41 const MultiType& param4,42 const MultiType& param5,43 const MultiType& param6)44 : bRetVal(hasRetVal)45 {46 // What Parameters have we got47 this->defaultValue[0] = param0;48 this->defaultValue[1] = param1;49 this->defaultValue[2] = param2;50 this->defaultValue[3] = param3;51 this->defaultValue[4] = param4;52 this->defaultValue[5] = param5;53 this->defaultValue[6] = param6;54 55 this->paramCount = 0;56 for (unsigned int i = 0; i <= EXECUTOR_MAX_ARGUMENTS; i++)57 {58 if (this->defaultValue[i] == MT_NULL || i == EXECUTOR_MAX_ARGUMENTS)59 {60 this->paramCount = i;61 break;62 }63 else64 this->defaultValue[i].storeString();65 }66 }67 68 /**69 * clones this element into executor.70 * @param executor the Executor to clone71 */72 void ExecutorBase::cloning(ExecutorBase* executor) const73 {74 executor->functorType = this->functorType;75 executor->paramCount = this->paramCount;76 for (unsigned int i = 0; i < this->paramCount; i++)77 executor->defaultValue[i] = this->defaultValue[i];78 }79 80 /**81 * @brief set the default values of the executor82 * @param value0 the first default value83 * @param value1 the second default value84 * @param value2 the third default value85 * @param value3 the fourth default value86 * @param value4 the fifth default value87 * @returns itself88 */89 void ExecutorBase::defaultValues(const MultiType& value0,90 const MultiType& value1,91 const MultiType& value2,92 const MultiType& value3,93 const MultiType& value4,94 const MultiType& value5,95 const MultiType& value6)96 {97 const MultiType* value[5];98 value[0] = &value0;99 value[1] = &value1;100 value[2] = &value2;101 value[3] = &value3;102 value[4] = &value4;103 value[5] = &value5;104 value[6] = &value6;105 for (unsigned int i = 0; i < this->paramCount; i++)106 {107 if (*value[i] != MT_NULL)108 {109 this->defaultValue[i].setValueOf(*value[i]);110 this->defaultValue[i].storeString();111 }112 }113 }114 115 /**116 * @brief prints out nice information about the Executor117 */118 void ExecutorBase::debug()119 {120 }
Note: See TracChangeset
for help on using the changeset viewer.