source: osgVisual/include/cluster/dataIO_clusterUDP.h @ 80

Last change on this file since 80 was 59, checked in by Torben Dannhauer, 14 years ago

updated cluster functionality to allow build with any cluster module selected.

File size: 2.2 KB
RevLine 
[32]1#pragma once
2/* -*-c++-*- osgVisual - Copyright (C) 2009-2010 Torben Dannhauer
3 *
4 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6 * (at your option) any later version.  The full license is in LICENSE file
7 * included with this distribution, and on the openscenegraph.org website.
8 *
9 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
10 * You have to aquire licenses for all used proprietary modules.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * OpenSceneGraph Public License for more details.
16*/
17
18#include "dataIO_cluster.h"
19
20#include <osg/notify>
21#include <osg/ArgumentParser>
22#include <osgDB/Registry>
23#include <osgDB/ReaderWriter>
24#include <iostream>
[57]25#include <winsock2.h>
26#pragma comment ( lib, "WSock32.lib" )
[32]27
28#include "dataIO_clusterUDP_Transmission.h"
29
30namespace osgVisual
31{
32
33/**
34 * \brief This is a UDP implementation of dataIO_cluster..
35 *
36 * This class uses UDP to fullfil the functions of dataIO_cluster.
37 * It sends the clusterdata via UDP Broadcast into the network to any listening client.
38 *
39 *
40 * \todo Add getHorizonColor to transport it to slave for consistent fog.
41 * @author Torben Dannhauer
42 * @date  Feb 2010
43 */ 
44class dataIO_clusterUDP :       public dataIO_cluster
45{
46public:
47        dataIO_clusterUDP();
48        virtual ~dataIO_clusterUDP(void);
49
[59]50        void init( osg::ArgumentParser& arguments_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ );
[32]51        void shutdown();
52
53        bool sendTO_OBJvaluesToSlaves();
54        bool readTO_OBJvaluesFromMaster();
55        void reportAsReadyToSwap();
56        bool waitForSwap();
57        bool waitForAllReadyToSwap();
58        bool sendSwapCommand();
59
60private:
61        bool compressionEnabled;
62        osg::ref_ptr<osgDB::Options> readOptions;
63        osg::ref_ptr<osgDB::Options> writeOptions;
64        osg::ref_ptr<osgDB::ReaderWriter> rw;
65        osg::ref_ptr<osgVisual::Broadcaster> broadcaster;
66        osg::ref_ptr<osgVisual::Receiver> receiver;
67};
68
69}       // END NAMESPACE
Note: See TracBrowser for help on using the repository browser.