1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _CLUSTERSERVER_H_
40 #define _CLUSTERSERVER_H_
45 #include "OSGClusterDef.h"
46 #include "OSGClusterWindow.h"
50 class PointConnection
;
54 /*! \ingroup GrpClusterBase
55 \ingroup GrpLibOSGCluster
58 class OSG_CLUSTER_DLLMAPPING ClusterServer
60 /*========================== PUBLIC =================================*/
64 /*---------------------------------------------------------------------*/
65 /*! \name Constructors */
68 ClusterServer( Window
*window
,
69 const std::string
&serviceName
,
70 const std::string
&connectionType
= "StreamSock",
71 const std::string
&address
= "",
72 UInt32 servicePort
= 8437,
73 const std::string
&serviceGroup
= "");
76 /*---------------------------------------------------------------------*/
77 /*! \name Destructor */
80 virtual ~ClusterServer(void);
83 /*---------------------------------------------------------------------*/
84 /*! \name server actions */
89 #ifdef OSG_OLD_RENDER_ACTION
90 void render (DrawActionBase
*action
);
93 #ifdef OSG_OLD_RENDER_ACTION
94 void doRender(DrawActionBase
*action
);
97 void render (RenderActionBase
*action
);
98 void doSync (bool applyToChangelist
);
99 void doRender(RenderActionBase
*action
);
104 /*---------------------------------------------------------------------*/
105 /*! \name window access */
108 Window
*getClusterWindow(void);
109 Window
*getServerWindow (void);
111 RemoteAspect
*getRemoteAspect (void) const;
112 UInt32
getServerId (void) const;
115 /*---------------------------------------------------------------------*/
119 void setInterface(const std::string
&interf
);
122 /*---------------------------------------------------------------------*/
123 /*! \name cluster server app init */
126 static void addInitFunction (InitFuncF initFunc
);
127 static void addExitFunction (ExitFuncF exitFunc
);
128 static bool init (Int32 argc
,
130 static bool exit (void );
133 /*========================= PROTECTED ===============================*/
137 static std::vector
<InitFuncF
> *osgInitFunctions
;
138 static std::vector
<ExitFuncF
> *osgExitFunctions
;
140 /*---------------------------------------------------------------------*/
141 /*! \name ClusterWindow changed function */
144 bool windowChanged(FieldContainer
* const fcp
,
148 /*---------------------------------------------------------------------*/
152 WindowUnrecPtr _window
;
153 PointConnection
*_connection
;
154 std::string _requestAddress
;
155 std::string _boundAddress
;
156 ClusterWindowUnrecPtr _clusterWindow
;
157 RemoteAspect
*_aspect
;
158 std::string _serviceName
;
159 std::string _connectionType
;
161 std::string _serviceGroup
;
163 std::string _interface
;
166 /*========================== PRIVATE ================================*/
170 /*---------------------------------------------------------------------*/
171 /*! \name helper function */
177 /*---------------------------------------------------------------------*/
179 /*!\brief prohibit default function (move to 'public' if needed) */
180 ClusterServer(const ClusterServer
&source
);
181 /*!\brief prohibit default function (move to 'public' if needed) */
182 void operator =(const ClusterServer
&source
);
187 #include "OSGClusterServer.inl"
189 #endif /* _CLUSTERSERVER_H_ */