Planeshift
Classes | Public Member Functions | Protected Member Functions | Protected Attributes

RemoteDebug Class Reference

Keep track of remote debugging. More...

#include <remotedebug.h>

List of all members.

Classes

struct  DebugClient
 Hold client information for remote debugging clients.

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

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) [protected, pure 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 
) [protected, pure 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.

The next entry to use.

Definition at line 184 of file remotedebug.h.


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