Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5176 in orxonox.OLD


Ignore:
Timestamp:
Sep 12, 2005, 12:18:25 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: More clean-up

Location:
trunk/src/lib/shell
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell.cc

    r5175 r5176  
    433433  }
    434434}
    435 
    436435/**
    437436 * displays the Shell
  • trunk/src/lib/shell/shell.h

    r5175 r5176  
    4040    inline static Shell* getInstance() { if (!Shell::singletonRef) Shell::singletonRef = new Shell();  return Shell::singletonRef; };
    4141    /** @returns true if this class is instanciated, false otherwise */
    42     inline static bool isInstanciated() { return (Shell::singletonRef == NULL)?true:false; };
     42    inline static bool isInstanciated() { return (Shell::singletonRef == NULL)?false:true; };
    4343
    4444    void activate();
    4545    void deactivate();
     46    inline bool isActive() const { return this->bActive; };
    4647
    4748    void setTextSize(unsigned int textSize, unsigned int lineSpacing = 1);
     
    4950
    5051    // BUFFERS
     52    void flush();
    5153    void setBufferDisplaySize(unsigned int bufferDisplaySize);
    52     void flush();
    5354    void printToDisplayBuffer(const char* text);
    5455
  • trunk/src/lib/shell/shell_buffer.cc

    r5175 r5176  
    7070  {
    7171    delete charElem;
    72 
    7372    charElem = bufferIterator->nextElement();
    7473  }
     
    149148    strcpy(addLine, newLineBegin);
    150149
     150    this->lineCount++;
    151151    this->buffer->add(addLine);
    152     this->lineCount++;
     152    if (Shell::isInstanciated() && Shell::getInstance()->isActive())
     153      Shell::getInstance()->printToDisplayBuffer(addLine);
    153154
    154155    if (this->buffer->getSize() > this->bufferSize)
  • trunk/src/lib/shell/shell_buffer.h

    r5175 r5176  
    2626  inline static ShellBuffer* getInstance() { if (!ShellBuffer::singletonRef) ShellBuffer::singletonRef = new ShellBuffer();  return ShellBuffer::singletonRef; };
    2727  /** @returns true if this class is instanciated, false otherwise */
    28   inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?true:false; };
     28  inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?false:true; };
    2929
    3030  // BUFFER //
     
    3737// void moveBufferTo(unsigned int lineNumber);
    3838  const char* getBufferLine(unsigned int lineNumber);
    39   inline tIterator<char>*  getBufferIterator() const { return bufferIterator; };
     39  /** @returns the Buffer Iterator, that enables externals to walk through the Buffer */
     40  inline tIterator<char>* getBufferIterator() const { return bufferIterator; };
     41  /** @returns the Count of lines processed by the Shell.
     42  inline long getLineCount() const { return this->lineCount; };
    4043
    4144  private:
Note: See TracChangeset for help on using the changeset viewer.