logog
logger optimized for games
Socket Class Referenceabstract

#include <socket.hpp>

+ Inheritance diagram for Socket:

Public Member Functions

 Socket (int type=SOCK_STREAM, int port=LOGOG_DEFAULT_PORT)
 
virtual void Close ()
 
virtual int SetNonBlocking ()
 
virtual int Output (const LOGOG_STRING &output)=0
 
- 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 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)
 

Static Public Member Functions

static int Initialize ()
 
static void Shutdown ()
 
- Static Public Member Functions inherited from Object
static void * Allocate (size_t nSize)
 
static void Deallocate (void *ptr)
 

Static Public Attributes

static const int MAXHOSTNAME = 255
 

Protected Attributes

int m_Socket
 
int m_nType
 
int m_nPort
 
- 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

- Public Attributes inherited from Node
void * m_pUserData1
 
void * m_pUserData2
 

Detailed Description

A sending or receiving socket to be used as a target.

Constructor & Destructor Documentation

Socket ( int  type = SOCK_STREAM,
int  port = LOGOG_DEFAULT_PORT 
)
inline

Member Function Documentation

virtual void Close ( )
inlinevirtual
static int Initialize ( )
inlinestaticvirtual

Sinks do not add themselves to the list of interested subscribers. That's up to intermediate topics to decide.

Reimplemented from TopicSink.

virtual int Output ( const LOGOG_STRING &  data)
pure virtual

All targets must implement the Output function. This function outputs the provided string to the output that the target represents.

Returns
Zero if no error has occurred; an error code (generally propagated from the operating system) if an error has occurred.

Implements Target.

virtual int SetNonBlocking ( )
inlinevirtual
static void Shutdown ( )
inlinestatic

Member Data Documentation

int m_nPort
protected
int m_nType
protected
int m_Socket
protected
const int MAXHOSTNAME = 255
static

The documentation for this class was generated from the following file: