Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2009, 12:39:51 PM (15 years ago)
Author:
rgrieder
Message:

De-singletonised Shell so that both consoles have their own Shell instance. However they share the history.
Also modified IOConsole to hopefully work with status lines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/libraries/core/Shell.h

    r5994 r6004  
    3232#include "CorePrereqs.h"
    3333
    34 #include <cassert>
    3534#include <list>
    3635#include <sstream>
     
    3938
    4039#include "util/OutputHandler.h"
    41 #include "input/InputBuffer.h"
    4240#include "OrxonoxClass.h"
    4341#include "ConfigFileManager.h"
     42#include "input/InputBuffer.h"
    4443
    4544namespace orxonox
     
    6261    };
    6362
    64     class _CoreExport Shell : public Singleton<Shell>, virtual public OrxonoxClass, public OutputListener
     63    class _CoreExport Shell : virtual public OrxonoxClass, public OutputListener
    6564    {
    66         friend class Singleton<Shell>;
    6765        public:
    68             Shell();
     66            Shell(const std::string& consoleName, bool bScrollable);
    6967            virtual ~Shell();
    70 
    71             static void clearShell();
    72             static void history();
    7368
    7469            void setConfigValues();
     
    10095
    10196            inline unsigned int getNumLines() const
    102                 { return this->lines_.size(); }
     97                { return this->outputLines_.size(); }
    10398            inline unsigned int getScrollPosition() const
    10499                { return this->scrollPosition_; }
     
    115110            std::string getFromHistory() const;
    116111
    117             virtual void outputChanged();
     112            virtual void outputChanged(int level);
    118113
    119114            void inputChanged();
     
    146141            std::stringstream outputBuffer_;
    147142            bool finishedLastLine_;
    148             std::list<std::string> lines_;
     143            std::list<std::string> outputLines_;
    149144            std::list<std::string>::const_iterator scrollIterator_;
    150145            unsigned int scrollPosition_;
     146            unsigned int historyPosition_;
     147            bool bAddOutputLevel_;
     148            ConfigFileType commandHistoryConfigFileType_;
     149            const std::string consoleName_;
     150            const bool bScrollable_;
     151
     152            // Config values
     153            unsigned int maxHistoryLength_;
     154            unsigned int historyOffset_;
    151155            std::vector<std::string> commandHistory_;
    152             unsigned int maxHistoryLength_;
    153             unsigned int historyPosition_;
    154             unsigned int historyOffset_;
    155             bool bAddOutputLevel_;
    156156            int softDebugLevel_;
    157 
    158             ConfigFileType commandHistoryConfigFileType_;
    159 
    160             static Shell* singletonPtr_s;
    161157    };
    162158}
Note: See TracChangeset for help on using the changeset viewer.