|
logog
logger optimized for games
|
#include <target.hpp>
Inheritance diagram for LogBuffer:Public Member Functions | |
| LogBuffer (Target *pTarget=NULL, size_t s=LOGOG_DEFAULT_LOG_BUFFER_SIZE) | |
| virtual | ~LogBuffer () |
| virtual void | SetTarget (Target &t) |
| virtual int | Insert (const LOGOG_CHAR *pChars, size_t size) |
| virtual int | Dump () |
| virtual int | Output (const LOGOG_STRING &data) |
Public Member Functions inherited from Target | |
| Target () | |
| virtual | ~Target () |
| void | SetFormatter (Formatter &formatter) |
| Formatter & | GetFormatter () const |
| virtual int | Receive (const Topic &topic) |
| bool | GetNullTerminatesStrings () const |
| void | SetNullTerminatesStrings (bool val) |
Public Member Functions inherited from TopicSink | |
| virtual bool | IsTopic () const |
| virtual void | Initialize () |
| virtual bool | PublishTo (Node &) |
| virtual bool | UnpublishTo (Node &) |
| virtual bool | CanPublish () const |
Public Member Functions inherited from Topic | |
| Topic (const LOGOG_LEVEL_TYPE level=LOGOG_LEVEL_ALL, const LOGOG_CHAR *sFileName=NULL, const int nLineNumber=0, const LOGOG_CHAR *sGroup=NULL, const LOGOG_CHAR *sCategory=NULL, const LOGOG_CHAR *sMessage=NULL, const double dTimestamp=0.0f) | |
| virtual int | Send (const Topic &node) |
| virtual int | Transmit () |
| virtual bool | CanSubscribeTo (const Node &otherNode) |
| virtual bool | CanSubscribeCheckTopic (const Topic &other) |
| virtual void | Format (const LOGOG_CHAR *cFormatMessage,...) |
| const LOGOG_STRING & | FileName () const |
| void | FileName (const LOGOG_STRING &s) |
| const LOGOG_STRING & | Message () const |
| void | Message (const LOGOG_STRING &s) |
| const LOGOG_STRING & | Category () const |
| void | Category (const LOGOG_STRING &s) |
| const LOGOG_STRING & | Group () const |
| void | Group (const LOGOG_STRING &s) |
| int | LineNumber () const |
| void | LineNumber (const int num) |
| LOGOG_LEVEL_TYPE | Level () const |
| void | Level (LOGOG_LEVEL_TYPE level) |
| LOGOG_TIME | Timestamp () const |
| void | Timestamp (const LOGOG_TIME t) |
| TOPIC_FLAGS | GetTopicFlags () const |
Public Member Functions inherited from Node | |
| Node () | |
| ~Node () | |
| virtual bool | CanSubscribe () const |
| virtual bool | PublishToMultiple (LockableNodesType &nodes) |
| virtual bool | UnpublishToMultiple (LockableNodesType &nodes) |
| virtual bool | SubscribeTo (Node &publisher) |
| virtual bool | SubscribeToMultiple (LockableNodesType &nodes) |
| virtual bool | UnsubscribeTo (Node &publisher) |
| virtual bool | UnsubscribeToMultiple (LockableNodesType &nodes) |
| void | Clear () |
Public Member Functions inherited from Object | |
| Object () | |
| virtual | ~Object () |
| void * | operator new (size_t nSize) |
| void * | operator new[] (size_t nSize) |
| void | operator delete (void *ptr) |
| void | operator delete[] (void *ptr) |
Protected Member Functions | |
| virtual void | Allocate (size_t size) |
| virtual void | Deallocate () |
Protected Attributes | |
| LOGOG_CHAR * | m_pStart |
| LOGOG_CHAR * | m_pCurrent |
| LOGOG_CHAR * | m_pEnd |
| size_t | m_nSize |
| Target * | m_pOutputTarget |
Protected Attributes inherited from Target | |
| Formatter * | m_pFormatter |
| Mutex | m_MutexReceive |
| bool | m_bNullTerminatesStrings |
Protected Attributes inherited from Topic | |
| LOGOG_STRING | m_vStringProps [TOPIC_STRING_COUNT] |
| int | m_vIntProps [TOPIC_INT_COUNT] |
| LOGOG_TIME | m_tTime |
| TOPIC_FLAGS | m_TopicFlags |
Protected Attributes inherited from Node | |
| LockableNodesType | m_Subscribers |
| LockableNodesType | m_Publishers |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
| static void * | Allocate (size_t nSize) |
| static void | Deallocate (void *ptr) |
Public Attributes inherited from Node | |
| void * | m_pUserData1 |
| void * | m_pUserData2 |
A buffering target. Stores up to a fixed buffer size of output and then renders that output to another target. Can be used for buffering log output in memory and then storing it to a log file upon program completion. To use, create another target (such as a LogFile) and then create a LogBuffer, providing the other target as a parameter to the creation function.
| LogBuffer | ( | Target * | pTarget = NULL, |
| size_t | s = LOGOG_DEFAULT_LOG_BUFFER_SIZE |
||
| ) |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Dumps the current contents of the buffer to the output target.
|
virtual |
Inserts a range of LOGOG_CHAR objects into this buffer. The characters should consist of a null-terminated string of length size. Providing anything else as input creates undefined behavior.
|
virtual |
All targets must implement the Output function. This function outputs the provided string to the output that the target represents.
Implements Target.
|
virtual |
Changes the current rendering target. NOTE: This function does no locking on either the target or this object. Program accordingly.
|
protected |
The size of the buffer in LOGOG_CHAR primitives.
|
protected |
The current write offset into the buffer.
|
protected |
The position in the buffer after which no data may be written.
|
protected |
A pointer to the target to which the buffer will be rendered upon calling Dump().
|
protected |
The non-changing pointer to the basic buffer.