Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 1, 2006, 1:37:36 PM (18 years ago)
Author:
bensch
Message:

Changed the ShellBuffer to DebugBuffer, as the dependency is only one way, and it makes no sense for the rest of Orxonox Modules to know the Shell

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/debug_buffer.h

    r9859 r9861  
    11/*!
    2  * @file shell_buffer.h
    3  * @brief The Shell buffer Tasks
     2 * @file debug_buffer.h
     3 * @brief The Debug buffer Tasks
    44 * @see debug.h
    55*/
    66
    7 #ifndef _SHELL_BUFFER_H
    8 #define _SHELL_BUFFER_H
     7#ifndef _DEBUG_BUFFER_H
     8#define _DEBUG_BUFFER_H
    99
    1010#include <string>
    1111#include <list>
    12 #include <stdarg.h>
    1312
    14 #define      SHELL_BUFFER_SIZE       16384         //!< The Size of the input-buffers (should be large enough to carry any kind of input)
     13#define      DEBUG_BUFFER_SIZE       16384         //!< The Size of the input-buffers (should be large enough to carry any kind of input)
    1514
    16 namespace OrxShell
    17 {
    1815  //! A class handling output from orxonox via debug.h
    1916  /**
    20    * the ShellBuffer redirects output from PRINTF(x) to the Shell and STDOUT
    21    * the ShellBuffer is a front-filling queue of limited length, that has the
     17   * the DebugBuffer redirects output from PRINTF(x) to the Debug and STDOUT
     18   * the DebugBuffer is a front-filling queue of limited length, that has the
    2219   * youngest added Entry at the beginning, and the oldest at the end.
    2320   */
    24   class ShellBuffer
     21  class DebugBuffer
    2522  {
    2623  public:
    27     virtual ~ShellBuffer();
     24    virtual ~DebugBuffer();
    2825    /** @returns a Pointer to the only object of this Class */
    29     inline static ShellBuffer* getInstance() { if (!ShellBuffer::singletonRef) ShellBuffer::singletonRef = new ShellBuffer();  return ShellBuffer::singletonRef; };
     26    inline static DebugBuffer* getInstance() { if (!DebugBuffer::singletonRef) DebugBuffer::singletonRef = new DebugBuffer();  return DebugBuffer::singletonRef; };
    3027    /** @returns true if this class is instanciated, false otherwise */
    31     inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?false:true; };
     28    inline static bool isInstanciated() { return (DebugBuffer::singletonRef == NULL)?false:true; };
    3229
    3330    static void addBufferLineStatic(const char* line, ...);
     
    4138    /** @returns the List of stings from the Buffer */
    4239    const std::list<std::string>& getBuffer() const { return this->buffer; };
    43     /** @returns the Count of lines processed by the Shell. */
     40    /** @returns the Count of lines processed by the Debug. */
    4441    inline unsigned long getLineCount() const { return this->lineCount; };
    4542    /** @returns the Current Buffer Size. */
     
    4946
    5047  private:
    51     ShellBuffer();
     48    DebugBuffer();
    5249
    5350  private:
    54     static ShellBuffer*           singletonRef;                       //!< The singleton-reference to the only memeber of this class.
    55     unsigned int                  maxBufferSize;                         //!< The Size of the buffer
     51    static DebugBuffer*           singletonRef;                       //!< The singleton-reference to the only memeber of this class.
     52    unsigned int                  maxBufferSize;                      //!< The Size of the buffer
    5653
    57     std::string                   keepBuffer;                         //!< a BUFFER to have multi-non-newLine commands be copied into the shell.
     54    std::string                   keepBuffer;                         //!< a BUFFER to have multi-non-newLine commands be copied into the debug.
    5855
    5956    unsigned long                 lineCount;                          //!< how many Lines have been written out so far.
    6057
    6158    // The Beginning of buffer (buffer.front()) is the last added line.
    62     static char                   bufferArray[SHELL_BUFFER_SIZE];     //!< a BUFFER for fast writing
     59    static char                   bufferArray[DEBUG_BUFFER_SIZE];     //!< a BUFFER for fast writing
    6360    static std::list<std::string> buffer;                             //!< A list of stored char-arrays(strings) to store the history
    6461  };
    6562
    66 }
    67 
    68 #endif /* _SHELL_BUFFER_H */
     63#endif /* _DEBUG_BUFFER_H */
Note: See TracChangeset for help on using the changeset viewer.