File missing from last commit #4651

This commit is contained in:
Nick Bolton 2015-05-15 14:44:25 +01:00
parent 2e3769c7a6
commit aac59fbf7e
1 changed files with 35 additions and 1 deletions

View File

@ -43,13 +43,44 @@ public:
virtual void show(bool showIfEmpty); virtual void show(bool showIfEmpty);
virtual bool write(ELevel level, const char* message); virtual bool write(ELevel level, const char* message);
//! @name manipulators
//@{
//! Same as write, but allows message to sidestep anti-recursion mechanism. //! Same as write, but allows message to sidestep anti-recursion mechanism.
bool write(ELevel level, const char* text, bool force); bool write(ELevel level, const char* text, bool force);
//! Notify that the buffer should be sent. //! Notify that the buffer should be sent.
void notifyBuffer(); void notifyBuffer();
//! Set the buffer size.
/*!
Set the maximum size of the buffer to protect memory
from runaway logging.
*/
void bufferMaxSize(UInt16 bufferMaxSize);
//! Close the outputter
/*!
Close the outputter. If \p waitForEmpty is true, it will wait until
the buffer has been sent to the IPC server before closing.
*/
void close(bool waitForEmpty);
//@}
//! @name accessors
//@{
//! Get the buffer size
/*!
Returns the maximum size of the buffer.
*/
UInt16 bufferMaxSize() const;
//@}
private: private:
void init();
void bufferThread(void*); void bufferThread(void*);
String getChunk(size_t count); String getChunk(size_t count);
void sendBuffer(); void sendBuffer();
@ -69,4 +100,7 @@ private:
bool m_bufferWaiting; bool m_bufferWaiting;
IArchMultithread::ThreadID IArchMultithread::ThreadID
m_bufferThreadId; m_bufferThreadId;
UInt16 m_bufferMaxSize;
ArchCond m_bufferEmptyCond;
ArchMutex m_bufferEmptyMutex;
}; };