logog
logger optimized for games
|
#include <target.hpp>
Public Member Functions | |
Target () | |
virtual | ~Target () |
void | SetFormatter (Formatter &formatter) |
Formatter & | GetFormatter () const |
virtual int | Output (const LOGOG_STRING &data)=0 |
virtual int | Receive (const Topic &topic) |
bool | GetNullTerminatesStrings () const |
void | SetNullTerminatesStrings (bool val) |
![]() | |
virtual bool | IsTopic () const |
virtual void | Initialize () |
virtual bool | PublishTo (Node &) |
virtual bool | UnpublishTo (Node &) |
virtual bool | CanPublish () const |
![]() | |
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 |
![]() | |
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 () |
![]() | |
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 Attributes | |
Formatter * | m_pFormatter |
Mutex | m_MutexReceive |
bool | m_bNullTerminatesStrings |
![]() | |
LOGOG_STRING | m_vStringProps [TOPIC_STRING_COUNT] |
int | m_vIntProps [TOPIC_INT_COUNT] |
LOGOG_TIME | m_tTime |
TOPIC_FLAGS | m_TopicFlags |
![]() | |
LockableNodesType | m_Subscribers |
LockableNodesType | m_Publishers |
Friends | |
class | LogBuffer |
Additional Inherited Members | |
![]() | |
static void * | Allocate (size_t nSize) |
static void | Deallocate (void *ptr) |
![]() | |
void * | m_pUserData1 |
void * | m_pUserData2 |
A target is abstraction representing an output stream from logog. cerr, cout, and syslog, and other logging formats are supported. Targets do not validate their received data. Their only job is to render it on a call to Receive() to their supported target type. Targets should generally make sure to handle calls on multiple threads – they should make sure to avoid overlapping outputs from multiple threads correctly. This base class handles this serialization in the Receive() function. Children of this class are expected to implement the Output() function to do the actual output.
Target | ( | ) |
|
virtual |
Formatter& GetFormatter | ( | ) | const |
Returns a reference to the current formatter for this target.
|
inline |
Does this target want its formatter to null terminate its strings?
|
pure virtual |
All targets must implement the Output function. This function outputs the provided string to the output that the target represents.
|
virtual |
Receives a topic on behalf of this target. A mutex prevents race conditions from occurring when multiple threads attempt to write to this target at the same time.
Reimplemented from Topic.
void SetFormatter | ( | Formatter & | formatter | ) |
Sets the current formatter for this target.
|
inline |
Tells this target whether to request its formatter to null terminate its strings.
|
friend |
|
protected |
Does this target cause its formatter to null-terminate its output strings? File and buffer outputs don't require null terminated strings, but line outputs do.
|
protected |
A pointer to the formatter used for this output.