Changeset 7762 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.cc
- Timestamp:
- May 22, 2006, 6:20:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_buffer.cc
r7761 r7762 32 32 { 33 33 ShellBuffer::singletonRef = this; 34 this->shell = NULL;35 34 36 35 this->lineCount = 0; 37 36 this->bufferArray[0] = '\0'; 38 37 39 this->set BufferSize(100);38 this->setMaxBufferSize(100); 40 39 } 41 40 … … 48 47 ShellBuffer::~ShellBuffer () 49 48 { 50 if (this->shell != NULL)51 delete this->shell;52 53 49 ShellBuffer::singletonRef = NULL; 54 }55 56 /**57 * @brief registers the Shell to the Buffer58 * @param shell the Shell to register.59 */60 void ShellBuffer::registerShell(Shell* shell)61 {62 if (this->shell == NULL)63 this->shell = shell;64 else65 PRINTF(1)("already registered a Shell to the ShellBuffer\n");66 }67 68 /**69 * @brief unregisters the Shell from the Buffer70 * @param shell the Shell to unregister.71 */72 void ShellBuffer::unregisterShell(Shell* shell)73 {74 if (this->shell == shell)75 this->shell = NULL;76 else77 PRINTF(1)("cannot unregister shell, because it is not registered to the ShellBuffer\n");78 50 } 79 51 … … 136 108 { 137 109 this->lineCount++; 138 139 printf("Test:: %s \n", inputBuffer.substr(lineBegin, lineEnd - lineBegin).c_str());140 110 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());143 111 } 144 112 else // No end of Line reached. … … 148 116 } 149 117 150 151 152 if (this->buffer.size() > this->bufferSize) 118 if (this->buffer.size() > this->maxBufferSize) 153 119 this->buffer.pop_back(); 154 120 }
Note: See TracChangeset
for help on using the changeset viewer.