- Timestamp:
- Aug 19, 2010, 4:57:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/Executor.h
r7188 r7189 45 45 virtual ~Executor(); 46 46 47 inline voidoperator()() const48 { (*this->functor_)(this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }49 inline voidoperator()(const MultiType& param1) const50 { (*this->functor_)(param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }51 inline voidoperator()(const MultiType& param1, const MultiType& param2) const52 { (*this->functor_)(param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }53 inline voidoperator()(const MultiType& param1, const MultiType& param2, const MultiType& param3) const54 { (*this->functor_)(param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }55 inline voidoperator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const56 { (*this->functor_)(param1, param2, param3, param4, this->defaultValue_[4]); }57 inline voidoperator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const58 { (*this->functor_)(param1, param2, param3, param4, param5); }59 60 bool parse(const std::string& params, const std::string& delimiter = " ") const;47 inline MultiType operator()() const 48 { return (*this->functor_)(this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 49 inline MultiType operator()(const MultiType& param1) const 50 { return (*this->functor_)(param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 51 inline MultiType operator()(const MultiType& param1, const MultiType& param2) const 52 { return (*this->functor_)(param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 53 inline MultiType operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3) const 54 { return (*this->functor_)(param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); } 55 inline MultiType operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const 56 { return (*this->functor_)(param1, param2, param3, param4, this->defaultValue_[4]); } 57 inline MultiType operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const 58 { return (*this->functor_)(param1, param2, param3, param4, param5); } 59 60 MultiType parse(const std::string& params, bool* success = 0, const std::string& delimiter = " ") const; 61 61 62 62 bool evaluate(const std::string& params, MultiType param[5], const std::string& delimiter = " ") const; … … 70 70 inline Functor::Type::Enum getType() const 71 71 { return this->functor_->getType(); } 72 inline const MultiType& getReturnvalue() const73 { return this->functor_->getReturnvalue(); }74 72 inline std::string getTypenameParam(unsigned int param) const 75 73 { return this->functor_->getTypenameParam(param); } … … 128 126 using Executor::operator(); 129 127 130 inline voidoperator()(T* object) const131 { (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }132 inline voidoperator()(T* object, const MultiType& param1) const133 { (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }134 inline voidoperator()(T* object, const MultiType& param1, const MultiType& param2) const135 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }136 inline voidoperator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3) const137 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }138 inline voidoperator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const139 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); }140 inline voidoperator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const141 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); }142 143 144 inline voidoperator()(const T* object) const145 { (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }146 inline voidoperator()(const T* object, const MultiType& param1) const147 { (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }148 inline voidoperator()(const T* object, const MultiType& param1, const MultiType& param2) const149 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); }150 inline voidoperator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3) const151 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); }152 inline voidoperator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const153 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); }154 inline voidoperator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const155 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); }128 inline MultiType operator()(T* object) const 129 { return (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 130 inline MultiType operator()(T* object, const MultiType& param1) const 131 { return (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 132 inline MultiType operator()(T* object, const MultiType& param1, const MultiType& param2) const 133 { return (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 134 inline MultiType operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3) const 135 { return (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); } 136 inline MultiType operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const 137 { return (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); } 138 inline MultiType operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const 139 { return (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); } 140 141 142 inline MultiType operator()(const T* object) const 143 { return (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 144 inline MultiType operator()(const T* object, const MultiType& param1) const 145 { return (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 146 inline MultiType operator()(const T* object, const MultiType& param1, const MultiType& param2) const 147 { return (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 148 inline MultiType operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3) const 149 { return (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); } 150 inline MultiType operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const 151 { return (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); } 152 inline MultiType operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const 153 { return (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); } 156 154 157 155 inline void setObject(T* object) const … … 162 160 using Executor::parse; 163 161 164 bool parse(T* object, const std::string& params, const std::string& delimiter = " ") const162 MultiType parse(T* object, const std::string& params, bool* success = 0, const std::string& delimiter = " ") const 165 163 { 166 164 FunctorMember<T>* functorMember = static_cast<FunctorMember<T>*>(this->functor_); … … 169 167 170 168 functorMember->setObject(object); 171 bool result = Executor::parse(params, delimiter);169 const MultiType& result = Executor::parse(params, success, delimiter); 172 170 functorMember->setObjects(objects); 173 171 … … 175 173 } 176 174 177 bool parse(const T* object, const std::string& params, const std::string& delimiter = " ") const175 MultiType parse(const T* object, const std::string& params, bool* success = 0, const std::string& delimiter = " ") const 178 176 { 179 177 FunctorMember<T>* functorMember = static_cast<FunctorMember<T>*>(this->functor_); … … 182 180 183 181 functorMember->setObject(object); 184 bool result = Executor::parse(params, delimiter);182 const MultiType& result = Executor::parse(params, success, delimiter); 185 183 functorMember->setObjects(objects); 186 184
Note: See TracChangeset
for help on using the changeset viewer.