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 <osg/notify> |
---|
19 | #include <osg/ArgumentParser> |
---|
20 | #include <osgDB/Registry> |
---|
21 | #include <osgDB/ReaderWriter> |
---|
22 | #include <iostream> |
---|
23 | |
---|
24 | #include <dataIO_cluster.h> |
---|
25 | #include <dataIO_clusterENet_implementation.h> |
---|
26 | |
---|
27 | namespace osgVisual |
---|
28 | { |
---|
29 | |
---|
30 | /** |
---|
31 | * \brief This class is a ENet based cluster implementation class for osgVisuals cluster capabilities. |
---|
32 | * |
---|
33 | * All functions which are called always return true and send a debug string to stdout to announce that they were called. |
---|
34 | * |
---|
35 | * @author Torben Dannhauer |
---|
36 | * @date July 2010 |
---|
37 | */ |
---|
38 | class dataIO_clusterENet : public dataIO_cluster |
---|
39 | { |
---|
40 | public: |
---|
41 | dataIO_clusterENet(); |
---|
42 | virtual ~dataIO_clusterENet(void); |
---|
43 | |
---|
44 | void init( osg::ArgumentParser& arguments_, osgViewer::Viewer* viewer_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ ); |
---|
45 | void shutdown(); |
---|
46 | |
---|
47 | void init(); |
---|
48 | bool sendTO_OBJvaluesToSlaves(); |
---|
49 | bool readTO_OBJvaluesFromMaster(); |
---|
50 | void reportAsReadyToSwap(); |
---|
51 | bool waitForSwap(); |
---|
52 | bool waitForAllReadyToSwap(); |
---|
53 | bool sendSwapCommand(); |
---|
54 | |
---|
55 | private: |
---|
56 | osg::ref_ptr<osgVisual::dataIO_clusterENet_implementation> enet_impl; |
---|
57 | std::string serverToConnect; |
---|
58 | osgVisual::dataIO_cluster::clustermode clusterMode; |
---|
59 | std::string receivedTransportContainer; |
---|
60 | |
---|
61 | osg::ref_ptr<osgDB::Options> readOptions; |
---|
62 | osg::ref_ptr<osgDB::Options> writeOptions; |
---|
63 | osg::ref_ptr<osgDB::ReaderWriter> rw; |
---|
64 | }; |
---|
65 | |
---|
66 | } //END NAMESPACE |
---|