Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7762 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.cc


Ignore:
Timestamp:
May 22, 2006, 6:20:35 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ShellBuffer gets polled from the Shell, and does not put the other way round

File:
1 edited

Legend:

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

    r7761 r7762  
    3232  {
    3333    ShellBuffer::singletonRef = this;
    34     this->shell = NULL;
    3534
    3635    this->lineCount = 0;
    3736    this->bufferArray[0] = '\0';
    3837
    39     this->setBufferSize(100);
     38    this->setMaxBufferSize(100);
    4039  }
    4140
     
    4847  ShellBuffer::~ShellBuffer ()
    4948  {
    50     if (this->shell != NULL)
    51       delete this->shell;
    52 
    5349    ShellBuffer::singletonRef = NULL;
    54   }
    55 
    56   /**
    57    * @brief registers the Shell to the Buffer
    58    * @param shell the Shell to register.
    59    */
    60   void ShellBuffer::registerShell(Shell* shell)
    61   {
    62     if (this->shell == NULL)
    63       this->shell = shell;
    64     else
    65       PRINTF(1)("already registered a Shell to the ShellBuffer\n");
    66   }
    67 
    68   /**
    69    * @brief unregisters the Shell from the Buffer
    70    * @param shell the Shell to unregister.
    71    */
    72   void ShellBuffer::unregisterShell(Shell* shell)
    73   {
    74     if (this->shell == shell)
    75       this->shell = NULL;
    76     else
    77       PRINTF(1)("cannot unregister shell, because it is not registered to the ShellBuffer\n");
    7850  }
    7951
     
    136108      {
    137109        this->lineCount++;
    138 
    139         printf("Test:: %s \n", inputBuffer.substr(lineBegin, lineEnd - lineBegin).c_str());
    140110        this->buffer.push_front(inputBuffer.substr(lineBegin, lineEnd - lineBegin));
    141         if (likely (this->shell != NULL) && unlikely (this->shell->isActive()))
    142           this->shell->printToDisplayBuffer(this->buffer.front());
    143111      }
    144112      else      // No end of Line reached.
     
    148116      }
    149117
    150 
    151 
    152       if (this->buffer.size() > this->bufferSize)
     118      if (this->buffer.size() > this->maxBufferSize)
    153119        this->buffer.pop_back();
    154120    }
Note: See TracChangeset for help on using the changeset viewer.