Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 27, 2010, 7:29:49 PM (14 years ago)
Author:
landauf
Message:

re-implemented parameter evaluation in CommandEvaluation and simplified parse() and evaluateParams() in Executor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.h

    r7228 r7230  
    3434#include <string>
    3535
    36 #include "ArgumentCompletionListElement.h"
    3736#include "util/SubString.h"
    3837#include "util/MultiType.h"
     38#include "ArgumentCompletionListElement.h"
     39#include "Functor.h"
    3940
    4041namespace orxonox
     
    4748            CommandEvaluation();
    4849
    49             int execute() const;
    50             MultiType query(int* error = 0) const;
     50            int execute();
     51            MultiType query(int* error = 0);
    5152
    52             std::string complete() const;
    53             std::string hint() const;
     53            std::string complete();
     54            std::string hint();
     55
     56            int evaluateParams(bool bPrintError = false);
    5457
    5558            inline bool isValid() const
     
    5962                { return this->execCommand_; }
    6063
    61 //            void setEvaluatedParameter(unsigned int index, MultiType param);
    62 //            MultiType getEvaluatedParameter(unsigned int index) const;
     64            void setEvaluatedParameter(unsigned int index, const MultiType& param);
     65            MultiType getEvaluatedParameter(unsigned int index) const;
    6366
    6467        private:
     
    6972            const std::string& getToken(unsigned int i) const;
    7073
    71             void retrievePossibleArguments() const;
     74            void retrievePossibleArguments();
    7275
    7376            static void strip(ArgumentCompletionList& list, const std::string& fragment);
     
    8487            unsigned int execArgumentsOffset_;
    8588            unsigned int hintArgumentsOffset_;
    86             mutable bool bPossibleArgumentsRetrieved_;
    87             mutable ArgumentCompletionList possibleArguments_;
     89            bool bPossibleArgumentsRetrieved_;
     90            ArgumentCompletionList possibleArguments_;
     91
     92            bool bEvaluatedParams_;
     93            bool bTriedToEvaluatedParams_;
     94            unsigned int numberOfEvaluatedParams_;
     95            MultiType param_[MAX_FUNCTOR_ARGUMENTS];
    8896    };
    8997}
Note: See TracChangeset for help on using the changeset viewer.