Changeset 7267
- Timestamp:
- Aug 30, 2010, 6:27:59 PM (14 years ago)
- Location:
- code/branches/consolecommands3/src/libraries/core/command
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc
r7236 r7267 43 43 44 44 this->baseName_ = name; 45 this->base Executor_ = executor;45 this->baseFunctor_ = executor->getFunctor(); 46 46 47 47 this->argumentCompleter_[0] = 0; … … 112 112 bool ConsoleCommand::headersMatch(const FunctorPtr& functor) 113 113 { 114 unsigned int minparams = std::min(this->base Executor_->getParamCount(), functor->getParamCount());115 116 if (this->base Executor_->getFunctor()->getHeaderIdentifier(minparams) != functor->getHeaderIdentifier(minparams))114 unsigned int minparams = std::min(this->baseFunctor_->getParamCount(), functor->getParamCount()); 115 116 if (this->baseFunctor_->getHeaderIdentifier(minparams) != functor->getHeaderIdentifier(minparams)) 117 117 return false; 118 else if (functor->getParamCount() <= this->base Executor_->getParamCount())118 else if (functor->getParamCount() <= this->baseFunctor_->getParamCount()) 119 119 return true; 120 120 else if (!this->executor_) … … 122 122 else 123 123 { 124 for (unsigned int i = this->baseExecutor_->getParamCount(); i < functor->getParamCount(); ++i) 124 for (unsigned int i = this->baseFunctor_->getParamCount(); i < functor->getParamCount(); ++i) 125 { 125 126 if (!this->executor_->defaultValueSet(i)) 127 { 128 COUT(2) << "Default value " << i << " is missing" << std::endl; 126 129 return false; 130 } 131 } 127 132 128 133 return true; … … 132 137 bool ConsoleCommand::headersMatch(const ExecutorPtr& executor) 133 138 { 134 unsigned int minparams = std::min(this->base Executor_->getParamCount(), executor->getParamCount());135 136 if (this->base Executor_->getFunctor()->getHeaderIdentifier(minparams) != executor->getFunctor()->getHeaderIdentifier(minparams))139 unsigned int minparams = std::min(this->baseFunctor_->getParamCount(), executor->getParamCount()); 140 141 if (this->baseFunctor_->getHeaderIdentifier(minparams) != executor->getFunctor()->getHeaderIdentifier(minparams)) 137 142 return false; 138 else if (executor->getParamCount() <= this->base Executor_->getParamCount())143 else if (executor->getParamCount() <= this->baseFunctor_->getParamCount()) 139 144 return true; 140 145 else 141 146 { 142 for (unsigned int i = this->baseExecutor_->getParamCount(); i < executor->getParamCount(); ++i) 147 for (unsigned int i = this->baseFunctor_->getParamCount(); i < executor->getParamCount(); ++i) 148 { 143 149 if (!executor->defaultValueSet(i)) 150 { 151 COUT(2) << "Default value " << i << " is missing" << std::endl; 144 152 return false; 153 } 154 } 145 155 146 156 return true; -
code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h
r7239 r7267 223 223 224 224 const ExecutorPtr& getExecutor() const; 225 inline const ExecutorPtr& getBaseExecutor() const226 { return this->base Executor_; }225 inline const FunctorPtr& getBaseFunctor() const 226 { return this->baseFunctor_; } 227 227 228 228 inline ConsoleCommand& setActive(bool bActive) … … 311 311 AccessLevel::Enum accessLevel_; 312 312 std::string baseName_; 313 ExecutorPtr baseExecutor_;313 FunctorPtr baseFunctor_; 314 314 315 315 ExecutorPtr executor_;
Note: See TracChangeset
for help on using the changeset viewer.