Nebula
Loading...
Searching...
No Matches
historyconsolehandler.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
13#include "io/consolehandler.h"
14#include "util/ringbuffer.h"
15
16//------------------------------------------------------------------------------
17namespace IO
18{
20{
22public:
25
27 void SetHistorySize(SizeT numLines);
29 SizeT GetHistorySize() const;
32
34 virtual void Print(const Util::String& s);
36 virtual void Error(const Util::String& s);
38 virtual void Warning(const Util::String& s);
40 virtual void DebugOut(const Util::String& s);
41
42private:
44};
45
46//------------------------------------------------------------------------------
49inline void
51{
52 this->history.SetCapacity(numLines);
53}
54
55//------------------------------------------------------------------------------
58inline SizeT
60{
61 return this->history.Size();
62}
63
64//------------------------------------------------------------------------------
69{
70 return this->history;
71}
72
73} // namespace IO
74//------------------------------------------------------------------------------
Base class for all console handlers.
Definition consolehandler.h:22
A console handler which stores the last N log messages in a Util::RingBuffer<String>.
Definition historyconsolehandler.h:20
virtual void Warning(const Util::String &s)
called by console to output warning
Definition historyconsolehandler.cc:48
__DeclareClass(HistoryConsoleHandler)
const Util::RingBuffer< Util::String > & GetHistory() const
get accumulated log messages
Definition historyconsolehandler.h:68
virtual void Error(const Util::String &s)
called by console with serious error
Definition historyconsolehandler.cc:37
virtual void DebugOut(const Util::String &s)
called by console to output debug string
Definition historyconsolehandler.cc:59
virtual void Print(const Util::String &s)
called by console to output data
Definition historyconsolehandler.cc:28
Util::RingBuffer< Util::String > history
Definition historyconsolehandler.h:43
HistoryConsoleHandler()
constructor
Definition historyconsolehandler.cc:18
void SetHistorySize(SizeT numLines)
set history size
Definition historyconsolehandler.h:50
SizeT GetHistorySize() const
get history size
Definition historyconsolehandler.h:59
A ring buffer stores up to a maximum number of elements in a circular fashion.
Definition ringbuffer.h:21
void SetCapacity(SizeT newCapacity)
set capacity (clear previous content)
Definition ringbuffer.h:288
SizeT Size() const
get number of elements in ring buffer
Definition ringbuffer.h:307
Instances of wrapped stream classes.
Definition orientation.cc:10
Nebula's universal string class.
Definition String.cs:8
int SizeT
Definition types.h:49