root/trunk/Source/System/Cluster/Server/OSGClusterServer.h

Revision 1198, 7.9 kB (checked in by vossg, 7 months ago)

changed: interface cleanup, removed ptr typedefs, nullfc

these will be needed for the 1.x compat stuff

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 /*---------------------------------------------------------------------------*\
2  *                                OpenSG                                     *
3  *                                                                           *
4  *                                                                           *
5  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
6  *                                                                           *
7  *                            www.opensg.org                                 *
8  *                                                                           *
9  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
10  *                                                                           *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13  *                                License                                    *
14  *                                                                           *
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.                               *
18  *                                                                           *
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.                          *
23  *                                                                           *
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.                 *
27  *                                                                           *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30  *                                Changes                                    *
31  *                                                                           *
32  *                                                                           *
33  *                                                                           *
34  *                                                                           *
35  *                                                                           *
36  *                                                                           *
37 \*---------------------------------------------------------------------------*/
38
39 #ifndef _CLUSTERSERVER_H_
40 #define _CLUSTERSERVER_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
44
45 #include "OSGClusterDef.h"
46 #include "OSGClusterWindow.h"
47
48 OSG_BEGIN_NAMESPACE
49
50 class PointConnection;
51 class ClusterWindow;
52 class RemoteAspect;
53
54 class OSG_CLUSTER_DLLMAPPING ClusterServer
55 {
56     /*==========================  PUBLIC  =================================*/
57
58   public:
59
60     /*---------------------------------------------------------------------*/
61     /*! \name                   Constructors                               */
62     /*! \{                                                                 */
63
64     ClusterServer(           Window    *window,
65                   const std::string    &serviceName,
66                   const std::string    &connectionType = "StreamSock",
67                   const std::string    &address        = "",
68                              UInt32     servicePort    = 8437,
69                   const std::string    &serviceGroup   = "");
70
71     /*! \}                                                                 */
72     /*---------------------------------------------------------------------*/
73     /*! \name                   Destructor                                 */
74     /*! \{                                                                 */
75
76     virtual ~ClusterServer(void);
77
78     /*! \}                                                                 */
79     /*---------------------------------------------------------------------*/
80     /*! \name                   server actions                             */
81     /*! \{                                                                 */
82
83     void start   (void                               );
84     void stop    (void                               );
85 #ifdef OSG_OLD_RENDER_ACTION
86     void render  (DrawActionBase *action             );
87 #endif
88
89 #ifdef OSG_OLD_RENDER_ACTION
90     void doRender(DrawActionBase *action             );
91 #endif
92
93     void render  (RenderActionBase *action           );
94     void doSync  (bool              applyToChangelist);
95     void doRender(RenderActionBase *action           );
96
97     void doSwap  (void                               );
98
99     /*! \}                                                                 */
100     /*---------------------------------------------------------------------*/
101     /*! \name                   window access                              */
102     /*! \{                                                                 */
103
104     Window       *getClusterWindow(void);
105     Window       *getServerWindow (void);
106
107     RemoteAspect *getRemoteAspect (void) const;
108    
109     /*! \}                                                                 */
110     /*---------------------------------------------------------------------*/
111     /*! \name                   set                                        */
112     /*! \{                                                                 */
113
114     void setInterface(const std::string &interf);
115
116     /*! \}                                                                 */
117     /*=========================  PROTECTED  ===============================*/
118
119   protected:
120
121     /*---------------------------------------------------------------------*/
122     /*! \name            ClusterWindow changed function                    */
123     /*! \{                                                                 */
124
125     bool windowChanged(FieldContainer * const fcp,
126                        RemoteAspect   *          );
127
128     /*! \}                                                                 */
129     /*---------------------------------------------------------------------*/
130     /*! \name                      Member                                  */
131     /*! \{                                                                 */
132
133     WindowUnrecPtr         _window;
134     PointConnection       *_connection;
135     std::string            _requestAddress;
136     std::string            _boundAddress;
137     ClusterWindowUnrecPtr  _clusterWindow;
138     RemoteAspect          *_aspect;
139     std::string            _serviceName;
140     std::string            _connectionType;
141     UInt32                 _servicePort;
142     std::string            _serviceGroup;
143     UInt32                 _serverId;
144     std::string            _interface;
145
146     /*! \}                                                                 */
147     /*==========================  PRIVATE  ================================*/
148
149   private:
150
151     /*---------------------------------------------------------------------*/
152     /*! \name                     helper function                          */
153     /*! \{                                                                 */
154
155     void acceptClient();
156
157     /*! \}                                                                 */
158     /*---------------------------------------------------------------------*/
159
160     /*!\brief prohibit default function (move to 'public' if needed) */
161     ClusterServer(const ClusterServer &source);
162     /*!\brief prohibit default function (move to 'public' if needed) */
163     void operator =(const ClusterServer &source);
164 };
165
166 OSG_END_NAMESPACE
167
168 #include "OSGClusterServer.inl"
169
170 #endif /* _CLUSTERSERVER_H_ */
171
Note: See TracBrowser for help on using the browser.