Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5174 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.h


Ignore:
Timestamp:
Sep 11, 2005, 10:30:38 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ShellBuffer is extern to Shell now… (But NOT used in Shell yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_buffer.h

    r5173 r5174  
    1414template<class T> class tList;
    1515template<class T> class tIterator;
    16 class Text;
    1716
    1817//! A class for ...
     
    2019
    2120 public:
    22   ShellBuffer();
    2321  virtual ~ShellBuffer();
    24 
     22  /** @returns a Pointer to the only object of this Class */
     23  inline static ShellBuffer* getInstance() { if (!ShellBuffer::singletonRef) ShellBuffer::singletonRef = new ShellBuffer();  return ShellBuffer::singletonRef; };
    2524
    2625  // BUFFER //
    2726  /** @param bufferSize the new Buffer-Size */
    2827  void setBufferSize(unsigned int bufferSize) { this->bufferSize = bufferSize; };
    29   void setBufferDisplaySize(unsigned int bufferDisplaySize);
    3028  void flushBuffers();
    3129  static bool addBufferLineStatic(const char* line, ...);
    3230  void addBufferLine(const char* line, va_list arg);
    33   void printToDisplayBuffer(const char* text);
    3431  void moveBuffer(unsigned int lineCount);
    3532//    void moveBufferTo(unsigned int lineNumber);
    3633  const char* getBufferLine(unsigned int lineNumber);
    3734
     35  private:
     36    ShellBuffer();
    3837
    39  private:
    40    unsigned int             bufferSize;             //!< The Size of the buffer
    41    unsigned int             bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters)
    42    tList<char>*             buffer;                 //!< A list of stored char-arrays(strings) to store the history
    43    tIterator<char>*         bufferIterator;         //!< An iterator for the Shells main buffer.
    4438
    45    Text**                   bufferText;             //!< A list of stored bufferTexts for the display of the buffer
     39  private:
     40   static ShellBuffer*      singletonRef;                       //!< The singleton-reference to the only memeber of this class.
     41   unsigned int             bufferSize;                         //!< The Size of the buffer
     42   tList<char>*             buffer;                             //!< A list of stored char-arrays(strings) to store the history
     43   tIterator<char>*         bufferIterator;                     //!< An iterator for the Shells main buffer.
     44
    4645   char                     bufferArray[SHELL_BUFFER_SIZE];     //!< a BUFFER for fast writing
    4746   char                     keepBufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER to have multi-non-newLine commands be copied into the shell.
    48    bool                     keepBuffer;             //!< if the keepbuffer contains unfinished lines.
     47   bool                     keepBuffer;                         //!< if the keepbuffer contains unfinished lines.
    4948
     49   unsigned long            lineCount;                          //!< how many Lines have been written out so far.
    5050};
    5151
Note: See TracChangeset for help on using the changeset viewer.