eq::Client Class Reference

The client represents a network node of the application in the cluster. More...

#include <client.h>

Inheritance diagram for eq::Client:
Inheritance graph
[legend]
Collaboration diagram for eq::Client:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Client ()
 Construct a new client.
virtual ~Client ()
 Destruct the client.
bool connectServer (ServerPtr server)
 Open and connect an Equalizer server to the local client.
bool disconnectServer (ServerPtr server)
 Disconnect and close the connection of an Equalizer server to the local client.
bool hasCommands ()
void processCommand ()
 Get and process one pending command from the node command queue.
CommandQueuegetNodeThreadQueue ()

Protected Member Functions

virtual bool clientLoop ()
 Implements the processing loop for render clients.
virtual bool exitClient ()
 Reimplemented to also call eq::exit() on render clients.
virtual bool listen ()
virtual bool close ()

Detailed Description

The client represents a network node of the application in the cluster.

The methods initLocal() and exitLocal() should be used to set up and exit the listening node instance for each application process.

Definition at line 38 of file lib/client/client.h.


Constructor & Destructor Documentation

eq::Client::Client (  ) 

Construct a new client.

Definition at line 44 of file lib/client/client.cpp.

References EQINFO.

eq::Client::~Client (  )  [virtual]

Destruct the client.

Reimplemented in eqNbody::Client.

Definition at line 51 of file lib/client/client.cpp.

References close(), and EQINFO.

Here is the call graph for this function:


Member Function Documentation

bool eq::Client::connectServer ( ServerPtr  server  ) 

Open and connect an Equalizer server to the local client.

The client has to be in the listening state, see initLocal().

Parameters:
server the server.
Returns:
true if the server was connected, false if not.

Definition at line 78 of file lib/client/client.cpp.

References eq::net::Node::_connect(), eq::net::Node::connect(), EQINFO, EQWARN, eq::base::RefPtr< T >::get(), and eq::Global::getServer().

Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Client::disconnectServer ( ServerPtr  server  ) 

Disconnect and close the connection of an Equalizer server to the local client.

Parameters:
server the server.
Returns:
true if the server was disconnected, false if not.

Definition at line 183 of file lib/client/client.cpp.

References close(), EQWARN, eq::CommandQueue::flush(), and eq::base::RefPtr< T >::get().

Referenced by eVolve::EVolve::run(), and eqPly::EqPly::run().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Client::hasCommands (  ) 
Returns:
true if the client has commands pending, false otherwise.

Definition at line 247 of file lib/client/client.cpp.

References eq::net::CommandQueue::isEmpty().

Referenced by eqPly::EqPly::run().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Client::processCommand (  ) 

Get and process one pending command from the node command queue.

Used internally to run node commands.

Definition at line 252 of file lib/client/client.cpp.

References eq::net::COMMAND_DISCARD, eq::net::COMMAND_ERROR, eq::net::COMMAND_HANDLED, and eq::CommandQueue::pop().

Referenced by clientLoop(), and eqPly::EqPly::run().

Here is the call graph for this function:

Here is the caller graph for this function:

CommandQueue* eq::Client::getNodeThreadQueue (  )  [inline]
Returns:
the command queue to the main node thread.

For internal use only.

Definition at line 77 of file lib/client/client.h.

bool eq::Client::clientLoop (  )  [protected, virtual]

Implements the processing loop for render clients.

As long as the node is running, that is, between initLocal() and an exit send from the server, this method executes received commands using processCommand() and triggers the message pump between commands.

See also:
net::Node::clientLoop(), Pipe::createMessagePump()

Reimplemented from eq::net::Node.

Reimplemented in eqNbody::Client, eqPly::EqPly, and eVolve::EVolve.

Definition at line 227 of file lib/client/client.cpp.

References EQINFO, eq::CommandQueue::flush(), and processCommand().

Referenced by eVolve::EVolve::clientLoop(), eqPly::EqPly::clientLoop(), and eqNbody::Client::clientLoop().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Client::exitClient (  )  [protected, virtual]

Reimplemented to also call eq::exit() on render clients.

See also:
net::Node::exitClient().

Reimplemented from eq::net::Node.

Definition at line 242 of file lib/client/client.cpp.

References eq::exit(), and eq::net::Node::exitClient().

Here is the call graph for this function:

bool eq::Client::listen (  )  [protected, virtual]
See also:
net::Node::listen()

Reimplemented from eq::net::Node.

Definition at line 57 of file lib/client/client.cpp.

References eq::net::Dispatcher::registerCommand().

Here is the call graph for this function:

bool eq::Client::close (  )  [protected, virtual]
See also:
net::Node::close()

Reimplemented from eq::net::Node.

Definition at line 68 of file lib/client/client.cpp.

References eq::net::Node::close().

Referenced by disconnectServer(), and ~Client().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Feb 6 13:03:06 2010 for Equalizer 0.9.1 by  doxygen 1.6.1