fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Cluster / Base / OSGClusterNetwork.h
bloba351e577dd8ed3d12427a4f23b54d98f16dd5989
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000,2001,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 \*---------------------------------------------------------------------------*/
39 #ifndef _CLUSTERCONNECTINFO_H_
40 #define _CLUSTERCONNECTINFO_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGClusterDef.h"
46 #include "OSGMemoryObject.h"
47 #include "OSGRefCountPtr.h"
48 #include "OSGTransitPtr.h"
49 #include "OSGGroupConnection.h"
50 #include "OSGPointConnection.h"
52 #include <vector>
53 #include <map>
55 OSG_BEGIN_NAMESPACE
57 class RemoteAspect;
58 class ClusterNetwork;
59 OSG_GEN_MEMOBJPTR(ClusterNetwork);
61 /*! \ingroup GrpClusterBase
62 \ingroup GrpLibOSGCluster
65 class OSG_CLUSTER_DLLMAPPING ClusterNetwork : public MemoryObject
67 /*========================== PUBLIC =================================*/
69 public:
71 typedef std::vector<Connection *> ConnectionsT;
72 typedef std::map <UInt32,
73 ClusterNetwork *> ConnectionInfoMapT;
75 enum
77 ALL_NODES = 0xf00000
80 /*---------------------------------------------------------------------*/
81 /*! \name Get */
82 /*! \{ */
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 );
95 /*! \} */
96 /*---------------------------------------------------------------------*/
97 /*! \name Set */
98 /*! \{ */
100 void setAspect (RemoteAspect *aspect );
101 void setMainConnection(Connection *connection);
102 void setConnection (UInt32 id,
103 Connection *connection);
105 /*! \} */
106 /*---------------------------------------------------------------------*/
107 /*! \name establish connection */
108 /*! \{ */
110 void connectAllPointToPoint( UInt32 thidId,
111 const std::string &connectionType);
112 void connectAllGroupToPoint( UInt32 thidId,
113 const std::string &connectionType);
115 /*! \} */
116 /*---------------------------------------------------------------------*/
117 /*! \name static access */
118 /*! \{ */
120 static ClusterNetwork *getInstance(UInt32 ClusterWindowId);
122 /*! \} */
123 /*========================= PROTECTED ===============================*/
125 protected:
127 typedef MemoryObject Inherited;
129 /*---------------------------------------------------------------------*/
130 /*! \name Constructors */
131 /*! \{ */
133 ClusterNetwork(UInt32 clusterWindowId);
135 /*! \} */
136 /*---------------------------------------------------------------------*/
137 /*! \name Destructor */
138 /*! \{ */
140 virtual ~ClusterNetwork(void);
142 /*! \} */
143 /*---------------------------------------------------------------------*/
144 /*! \name Fields */
145 /*! \{ */
147 RemoteAspect *_aspect;
148 Connection *_mainConnection;
149 ConnectionsT _connection;
150 UInt32 _id;
152 /*! \} */
153 /*========================== PRIVATE ================================*/
155 private:
157 ClusterNetwork(const ClusterNetwork &source);
158 ClusterNetwork &operator =(const ClusterNetwork &source);
160 static ConnectionInfoMapT _map;
163 OSG_END_NAMESPACE
165 #endif /* _CLUSTERCONNECTINFO_H_ */