1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000,2001,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 _CLUSTERCONNECTINFO_H_
40 #define _CLUSTERCONNECTINFO_H_
45 #include "OSGClusterDef.h"
46 #include "OSGMemoryObject.h"
47 #include "OSGRefCountPtr.h"
48 #include "OSGTransitPtr.h"
49 #include "OSGGroupConnection.h"
50 #include "OSGPointConnection.h"
59 OSG_GEN_MEMOBJPTR(ClusterNetwork
);
61 /*! \ingroup GrpClusterBase
62 \ingroup GrpLibOSGCluster
65 class OSG_CLUSTER_DLLMAPPING ClusterNetwork
: public MemoryObject
67 /*========================== PUBLIC =================================*/
71 typedef std::vector
<Connection
*> ConnectionsT
;
72 typedef std::map
<UInt32
,
73 ClusterNetwork
*> ConnectionInfoMapT
;
80 /*---------------------------------------------------------------------*/
84 Connection
*getMainConnection (void);
85 GroupConnection
*getMainGroupConnection (void);
86 PointConnection
*getMainPointConnection (void);
88 Connection
*getConnection (UInt32 id
);
89 GroupConnection
*getGroupConnection (UInt32 id
);
90 PointConnection
*getPointConnection (UInt32 id
);
92 RemoteAspect
*getAspect (void );
93 ConnectionsT
&getConnection (void );
96 /*---------------------------------------------------------------------*/
100 void setAspect (RemoteAspect
*aspect
);
101 void setMainConnection(Connection
*connection
);
102 void setConnection (UInt32 id
,
103 Connection
*connection
);
106 /*---------------------------------------------------------------------*/
107 /*! \name establish connection */
110 void connectAllPointToPoint( UInt32 thidId
,
111 const std::string
&connectionType
);
112 void connectAllGroupToPoint( UInt32 thidId
,
113 const std::string
&connectionType
);
116 /*---------------------------------------------------------------------*/
117 /*! \name static access */
120 static ClusterNetwork
*getInstance(UInt32 ClusterWindowId
);
123 /*========================= PROTECTED ===============================*/
127 typedef MemoryObject Inherited
;
129 /*---------------------------------------------------------------------*/
130 /*! \name Constructors */
133 ClusterNetwork(UInt32 clusterWindowId
);
136 /*---------------------------------------------------------------------*/
137 /*! \name Destructor */
140 virtual ~ClusterNetwork(void);
143 /*---------------------------------------------------------------------*/
147 RemoteAspect
*_aspect
;
148 Connection
*_mainConnection
;
149 ConnectionsT _connection
;
153 /*========================== PRIVATE ================================*/
157 ClusterNetwork(const ClusterNetwork
&source
);
158 ClusterNetwork
&operator =(const ClusterNetwork
&source
);
160 static ConnectionInfoMapT _map
;
165 #endif /* _CLUSTERCONNECTINFO_H_ */