Planeshift
RemoteDebug Class Referenceabstract

Keep track of remote debugging. More...

#include <remotedebug.h>

Public Member Functions

void AddDebugClient (uint clientNum, int debugLevel)
 Add a client to receive debug information. More...
 
int GetDebugging () const
 Get the local debugging level. More...
 
csString GetRemoteDebugClientsString () const
 Utility function to retrive a string with all remote debugging clients for debug outputs. More...
 
bool IsDebugging ()
 Check if debugging is enabled. More...
 
bool IsDebugging (int debugLevel)
 Check if this NPC is debugging at the given level. More...
 
void Printf (int debugLevel, const char *msg,...)
 Function to generate a debug print. More...
 
 RemoteDebug ()
 Constructor. More...
 
void RemoveDebugClient (uint clientNum)
 Remove client from list of debug receivers. More...
 
void SetDebugging (int debugLevel)
 Set a new debug level. More...
 
bool SwitchDebugging ()
 Switch the local debuging state. More...
 
virtual ~RemoteDebug ()
 Destructor. More...
 

Protected Member Functions

virtual void LocalDebugReport (const csString &debugString)=0
 Callback function to report local debug. More...
 
virtual void RemoteDebugReport (uint32_t clientNum, const csString &debugString)=0
 Callback function to report remote debug. More...
 

Protected Attributes

csArray< csString > debugLog
 Local debug log of last n print statments. More...
 
int nextDebugLogEntry
 The next entry to use. More...
 

Detailed Description

Keep track of remote debugging.

Track debugging clients and debug levels.

Definition at line 58 of file remotedebug.h.

Constructor & Destructor Documentation

RemoteDebug::RemoteDebug ( )

Constructor.

virtual RemoteDebug::~RemoteDebug ( )
virtual

Destructor.

Member Function Documentation

void RemoteDebug::AddDebugClient ( uint  clientNum,
int  debugLevel 
)

Add a client to receive debug information.

Parameters
clientNumThe client to add.
debugLevelThe debug level for this client.
int RemoteDebug::GetDebugging ( ) const

Get the local debugging level.

csString RemoteDebug::GetRemoteDebugClientsString ( ) const

Utility function to retrive a string with all remote debugging clients for debug outputs.

bool RemoteDebug::IsDebugging ( )
inline

Check if debugging is enabled.

Definition at line 74 of file remotedebug.h.

bool RemoteDebug::IsDebugging ( int  debugLevel)
inline

Check if this NPC is debugging at the given level.

Parameters
debugLevelThe debug level.

Definition at line 84 of file remotedebug.h.

virtual void RemoteDebug::LocalDebugReport ( const csString &  debugString)
protectedpure virtual

Callback function to report local debug.

void RemoteDebug::Printf ( int  debugLevel,
const char *  msg,
  ... 
)

Function to generate a debug print.

The text will be distributed to all clients currently debugging at the debug level given.

virtual void RemoteDebug::RemoteDebugReport ( uint32_t  clientNum,
const csString &  debugString 
)
protectedpure virtual

Callback function to report remote debug.

void RemoteDebug::RemoveDebugClient ( uint  clientNum)

Remove client from list of debug receivers.

Parameters
clientNumThe client to remove.
void RemoteDebug::SetDebugging ( int  debugLevel)

Set a new debug level.

Parameters
debugNew debug level, 0 is no debugging
bool RemoteDebug::SwitchDebugging ( )

Switch the local debuging state.

Member Data Documentation

csArray<csString> RemoteDebug::debugLog
protected

Local debug log of last n print statments.

Definition at line 183 of file remotedebug.h.

int RemoteDebug::nextDebugLogEntry
protected

The next entry to use.

Definition at line 184 of file remotedebug.h.


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