Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 30, 2010, 10:09:08 PM (14 years ago)
Author:
landauf
Message:

using object stack and function stack together works now

Location:
code/branches/consolecommands3/src/libraries/core/command
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc

    r7270 r7272  
    163163        {
    164164            this->executor_ = executor;
     165            this->objectStack_.clear();
    165166            return true;
    166167        }
     
    180181            else if (functor)
    181182                this->executor_ = createExecutor(functor);
     183            this->objectStack_.clear();
    182184
    183185            return true;
     
    196198        if (command.executor_)
    197199            command.functor_ = this->executor_->getFunctor();
     200        command.objectStack_ = this->objectStack_;
    198201
    199202        if (this->setFunction(executor, bForce))
     
    207210        if (command.executor_)
    208211            command.functor_ = this->executor_->getFunctor();
     212        command.objectStack_ = this->objectStack_;
    209213
    210214        if (this->setFunction(functor, bForce))
     
    232236        if (command.executor_)
    233237            this->executor_->setFunctor(command.functor_);
     238        this->objectStack_ = command.objectStack_;
    234239    }
    235240
     
    238243        if (this->executor_)
    239244            this->executor_->setFunctor(0);
     245        this->objectStack_.clear();
    240246    }
    241247
     
    267273        void* oldobject = this->getObject();
    268274        if (this->setObject(object))
    269             this->objectStack_.push(oldobject);
     275            this->objectStack_.push_back(oldobject);
    270276    }
    271277
     
    275281        if (!this->objectStack_.empty())
    276282        {
    277             newobject = this->objectStack_.top();
    278             this->objectStack_.pop();
     283            newobject = this->objectStack_.back();
     284            this->objectStack_.pop_back();
    279285        }
    280286        this->setObject(newobject);
  • code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h

    r7270 r7272  
    3333
    3434#include <stack>
     35#include <vector>
    3536#include <boost/preprocessor/cat.hpp>
    3637#include <boost/preprocessor/facilities/expand.hpp>
     
    9899            ExecutorPtr executor_;
    99100            FunctorPtr functor_;
     101            std::vector<void*> objectStack_;
    100102        };
    101103
     
    317319            ExecutorPtr executor_;
    318320            std::stack<Command> commandStack_;
    319             std::stack<void*> objectStack_;
     321            std::vector<void*> objectStack_;
    320322
    321323            ArgumentCompleter* argumentCompleter_[5];
Note: See TracChangeset for help on using the changeset viewer.