NLNET::CNetDisplayer Class Reference

Net Displayer. More...

#include <net_displayer.h>

Inherits NLMISC::IDisplayer.

List of all members.

Public Member Functions

 CNetDisplayer (bool autoConnect=true)
 Constructor.
void setLogServer (const CInetAddress &logServerAddr)
 Sets logging server address.
void setLogServer (CCallbackClient *server)
 Sets logging server with an already connected server.
bool connected ()
 Returns true if the displayer is connected to a Logging Service.
virtual ~CNetDisplayer ()
 Destructor.

Protected Member Functions

virtual void doDisplay (const NLMISC::CLog::TDisplayInfo &args, const char *message)
 Sends the string to the logging server.
void findAndConnect ()
 Find the server (using the NS) and connect.

Private Attributes

CInetAddress _ServerAddr
CCallbackClient_Server
bool _ServerAllocated

Detailed Description

Net Displayer.

Sends the strings to a logger server (LOGS). log_howto

Bug:
When nlerror is called in a catch block, a connected NetDisplayer becomes an IDisplayer => pure virtual call
Author:
Olivier Cado
Nevrax France
Date:
2000

Definition at line 43 of file net_displayer.h.


Constructor & Destructor Documentation

NLNET::CNetDisplayer::CNetDisplayer ( bool  autoConnect = true  ) 

Constructor.

Definition at line 46 of file net_displayer.cpp.

References findAndConnect().

NLNET::CNetDisplayer::~CNetDisplayer (  )  [virtual]

Destructor.

Definition at line 106 of file net_displayer.cpp.

References _Server, _ServerAllocated, and NLNET::CCallbackClient::disconnect().


Member Function Documentation

bool NLNET::CNetDisplayer::connected (  )  [inline]

Returns true if the displayer is connected to a Logging Service.

Definition at line 60 of file net_displayer.h.

References _Server, and NLNET::CCallbackClient::connected().

void NLNET::CNetDisplayer::doDisplay ( const NLMISC::CLog::TDisplayInfo args,
const char *  message 
) [protected, virtual]

Sends the string to the logging server.

Warning:
If not connected, tries to connect to the logging server each call. It can slow down your program a lot.

Implements NLMISC::IDisplayer.

Definition at line 121 of file net_displayer.cpp.

References _Server, NLNET::CCallbackClient::connected(), NLMISC::CLog::TDisplayInfo::Date, NLMISC::IDisplayer::dateToHumanString(), NLMISC::CLog::TDisplayInfo::LogType, NLMISC::IDisplayer::logTypeToString(), NLNET::msg, NLMISC::CLog::TDisplayInfo::ProcessName, NLNET::CCallbackClient::send(), and NLMISC::CMemStream::serial().

void NLNET::CNetDisplayer::findAndConnect (  )  [protected]

Find the server (using the NS) and connect.

Definition at line 56 of file net_displayer.cpp.

References _Server, _ServerAllocated, NLNET::CNamingClient::lookupAndConnect(), and nldebug.

Referenced by CNetDisplayer().

void NLNET::CNetDisplayer::setLogServer ( CCallbackClient server  ) 

Sets logging server with an already connected server.

Definition at line 95 of file net_displayer.cpp.

References _Server, and NLNET::CCallbackClient::connected().

void NLNET::CNetDisplayer::setLogServer ( const CInetAddress logServerAddr  ) 

Sets logging server address.

Call this method from outside only if you want to use a LOGS not registered within the NS. It does nothing if the displayer is already connected to a server.

Definition at line 73 of file net_displayer.cpp.

References _Server, _ServerAddr, _ServerAllocated, NLNET::CCallbackClient::connect(), and NLNET::CCallbackClient::connected().


Member Data Documentation

Definition at line 79 of file net_displayer.h.

Referenced by connected(), doDisplay(), findAndConnect(), setLogServer(), and ~CNetDisplayer().

Definition at line 77 of file net_displayer.h.

Referenced by setLogServer().

Definition at line 80 of file net_displayer.h.

Referenced by findAndConnect(), setLogServer(), and ~CNetDisplayer().


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

Generated on Thu Jan 7 08:30:20 2010 for NeL by  doxygen 1.6.1