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

OSGClusterServer.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _CLUSTERSERVER_H_
00040 #define _CLUSTERSERVER_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include <OSGBaseTypes.h>
00046 #include <OSGSystemDef.h>
00047 #include <OSGFieldContainerPtr.h>
00048 #include <OSGRemoteAspect.h>
00049 #include <OSGClusterWindow.h>
00050 #include <OSGWindow.h>
00051 
00052 OSG_BEGIN_NAMESPACE
00053 
00054 class PointConnection;
00055 class ClusterWindow;
00056 class RemoteAspect;
00057 class RenderActionBase;
00058 
00059 class OSG_SYSTEMLIB_DLLMAPPING ClusterServer
00060 {
00061     /*==========================  PUBLIC  =================================*/
00062   public:
00063 
00064     /*---------------------------------------------------------------------*/
00068     ClusterServer(           WindowPtr  window,
00069                   const std::string    &serviceName,
00070                   const std::string    &connectionType = "StreamSock",
00071                   const std::string    &address        = "",
00072                              UInt32     servicePort    = 8437,
00073                   const std::string    &serviceGroup   = "");
00074 
00076     /*---------------------------------------------------------------------*/
00080     virtual ~ClusterServer(void);
00081 
00083     /*---------------------------------------------------------------------*/
00087     void start             ( void                     );
00088     void stop              ( void                     );
00089     void render            ( RenderActionBase *action );
00090     void doSync            ( bool applyToChangelist   );
00091     void doRender          ( RenderActionBase *action );
00092     void doSwap            ( void                     );
00093 
00095     /*---------------------------------------------------------------------*/
00099     WindowPtr getClusterWindow (void);
00100     WindowPtr getServerWindow  (void);
00101 
00102     inline RemoteAspect *getRemoteAspect   (void)                   const;
00103     
00105     /*---------------------------------------------------------------------*/
00109     void setInterface(const std::string &interf);
00110 
00112     /*=========================  PROTECTED  ===============================*/
00113   protected:
00114 
00115     /*---------------------------------------------------------------------*/
00119     bool windowChanged(FieldContainerPtr& fcp,
00120                        RemoteAspect *);
00121 
00123     /*---------------------------------------------------------------------*/
00127     WindowPtr         _window;
00128     PointConnection  *_connection;
00129     std::string       _requestAddress;
00130     std::string       _boundAddress;
00131     ClusterWindowPtr  _clusterWindow;
00132     RemoteAspect     *_aspect;
00133     std::string       _serviceName;
00134     std::string       _connectionType;
00135     UInt32            _servicePort;
00136     std::string       _serviceGroup;
00137     UInt32            _serverId;
00138     std::string       _interface;
00139 
00141     /*==========================  PRIVATE  ================================*/
00142   private:
00143 
00144     /*---------------------------------------------------------------------*/
00148     void acceptClient();
00149 
00153     ClusterServer(const ClusterServer &source);
00155     void operator =(const ClusterServer &source);
00156 };
00157 
00158 OSG_END_NAMESPACE
00159 
00160 #include <OSGClusterServer.inl>
00161 
00162 #define OSG_CLUSTERSERVERHEADER_CVSID "@(#)$Id:$"
00163 
00164 #endif /* _CLUSTERSERVER_H_ */
00165 

Generated on Thu Aug 25 04:01:54 2005 for OpenSG by  doxygen 1.4.3