Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osg::ClusterServer Class Reference
[OpenSG Cluster support]

Cluster rendering server. More...

#include <OSGClusterServer.h>

Collaboration diagram for osg::ClusterServer:

Collaboration graph
[legend]
List of all members.

Public Methods

Constructors
 ClusterServer (WindowPtr window, const string &serviceName, const string &connectionType="StreamSock", const string &address="", UInt32 servicePort=8437)
Destructor
virtual ~ClusterServer (void)
your_category
void start (void)
void stop (void)
void render (RenderAction *action)

Protected Methods

your_category
bool windowChanged (FieldContainerPtr &fcp, RemoteAspect *)

Protected Attributes

Member
WindowPtr _window
Connection_connection
string _address
ClusterWindowPtr _clusterWindow
RemoteAspect_aspect
string _serviceName
UInt32 _servicePort
bool _serviceAvailable
UInt32 _serverId
string _connectionType

Private Methods

 ClusterServer (const ClusterServer &source)
 prohibit default function (move to 'public' if needed)

void operator= (const ClusterServer &source)
 prohibit default function (move to 'public' if needed)


Static Private Methods

Thread
void * serviceProc (void *arg)

Detailed Description

Cluster rendering server.

A ClusterServer is responsible for syncronizing all client changes. Each cluster renderer can offer it's service by a symbolic name. So it is possible to have a server called "left" or "right". The server uses a local Qt or GLUT window for rendering.

 // create a server
 GLUTWindowPtr window=GLUTWindow::create();
 server = new ClusterServer(window,"server1","Multicast");
 // wait for clients to connect
 server->init();
 ...
 // render
 server->render(ract);
 


Constructor & Destructor Documentation

ClusterServer::ClusterServer WindowPtr    window,
const string &    serviceName,
const string &    connectionType = "StreamSock",
const string &    address = "",
UInt32    servicePort = 8437
 

Constructor

Parameters:
window  rendering window. e.g. a Qt or GLUT window
serviceName  wait for connections that request this name
connectionType  network type. e.g. "Multicast"
address  address to wait for connections
servicePort  port to wait for connections

ClusterServer::~ClusterServer void    [virtual]
 

Destructor

Disconnect from all connected rendering servers

osg::ClusterServer::ClusterServer const ClusterServer &    source [private]
 

prohibit default function (move to 'public' if needed)


Member Function Documentation

void ClusterServer::start void   
 

start server

Start cluster server and wait for a client to connect. This method will return after a client connection or an error situation.

void ClusterServer::stop void   
 

start server

Start cluster server and wait for a client to connect. This method will return after a client connection or an error situation.

void ClusterServer::render RenderAction *    action
 

render server window

Synchronize all field containers with the client and call serverInit, serverRender and serverSwap for the cluster window. The cluster server uses the first synced ClusterWindow that contains the name of this server. serverInit is called after the first ClusterWindow sync.

Parameters:
action  RenderAction to use for rendering
Todo:
Sync RenderAciton contents

bool ClusterServer::windowChanged FieldContainerPtr   fcp,
RemoteAspect  
[protected]
 

clusterWindow changed callback

this is a callback functor. It is called for each change of a ClusterWindow.

void * ClusterServer::serviceProc void *    arg [static, private]
 

tell address of server requested over broadcast

serviceProc is a static class function that is processed in a seperate thread. It tells all requesting clients on which network address this server is waiting for connecitons.

We do this in a thread because not all network types are able to set a timeout for accept. The service thread tells clients the address on wich the accept is expected. After a successful connection the service thread will be termnated.

Parameters:
arg  Pointer to the ClusterServer

void osg::ClusterServer::operator= const ClusterServer &    source [private]
 

prohibit default function (move to 'public' if needed)


Member Data Documentation

WindowPtr osg::ClusterServer::_window [protected]
 

Connection* osg::ClusterServer::_connection [protected]
 

string osg::ClusterServer::_address [protected]
 

ClusterWindowPtr osg::ClusterServer::_clusterWindow [protected]
 

RemoteAspect* osg::ClusterServer::_aspect [protected]
 

string osg::ClusterServer::_serviceName [protected]
 

UInt32 osg::ClusterServer::_servicePort [protected]
 

bool osg::ClusterServer::_serviceAvailable [protected]
 

UInt32 osg::ClusterServer::_serverId [protected]
 

string osg::ClusterServer::_connectionType [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Jul 3 16:32:44 2002 for OpenSG by doxygen1.2.16