Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
May 20, 2006, 6:09:17 PM (18 years ago)
Author:
bensch
Message:

trunk: the Buffer is moving pretty smoothly :)

File:
1 edited

Legend:

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

    r7737 r7744  
    1818
    1919  //! A class handling output from orxonox via debug.h
     20  /**
     21   * the ShellBuffer redirects output from PRINTF(x) to the Shell and STDOUT
     22   * the ShellBuffer is a front-filling queue of limited length, that has the
     23   * youngest added Entry at the beginning, and the oldest at the end.
     24   */
    2025  class ShellBuffer
    2126  {
     
    2631    inline static ShellBuffer* getInstance() { if (!ShellBuffer::singletonRef) ShellBuffer::singletonRef = new ShellBuffer();  return ShellBuffer::singletonRef; };
    2732    /** @returns true if this class is instanciated, false otherwise */
    28 inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?false:true; };
     33    inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?false:true; };
    2934
    3035    void registerShell(Shell* shell);
    3136    void unregisterShell(Shell* shell);
     37
     38    static bool addBufferLineStatic(const char* line, ...);
     39    void addBufferLine(const char* line, va_list arg);
    3240
    3341    // BUFFER //
     
    3543    void setBufferSize(unsigned int bufferSize) { this->bufferSize = bufferSize; };
    3644    void flush();
    37     static bool addBufferLineStatic(const char* line, ...);
    38     void addBufferLine(const char* line, va_list arg);
     45
    3946    /** @returns the List of stings from the Buffer */
    4047    const std::list<std::string>& getBuffer() const { return this->buffer; };
    4148    /** @returns the Count of lines processed by the Shell. */
    42     inline long getLineCount() const { return this->lineCount; };
     49    inline unsigned long getLineCount() const { return this->lineCount; };
    4350
    4451    void debug() const;
     
    5865    unsigned long                 lineCount;                          //!< how many Lines have been written out so far.
    5966
     67    // The Beginning of buffer (buffer.front()) is the last added line.
    6068    static std::list<std::string> buffer;                             //!< A list of stored char-arrays(strings) to store the history
    6169  };
Note: See TracChangeset for help on using the changeset viewer.