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 00040 #ifndef _GROUPCONNECTION_H_ 00041 #define _GROUPCONNECTION_H_ 00042 #ifdef __sgi 00043 #pragma once 00044 #endif 00045 00046 //--------------------------------------------------------------------------- 00047 // Includes 00048 //--------------------------------------------------------------------------- 00049 00050 #include <string> 00051 #include <set> 00052 #include <OSGBase.h> 00053 #include <OSGBaseTypes.h> 00054 #include <OSGConnection.h> 00055 #include <OSGTime.h> 00056 00057 OSG_BEGIN_NAMESPACE 00058 00059 class OSG_BASE_DLLMAPPING GroupConnection : public Connection 00060 { 00061 /*========================== PUBLIC =================================*/ 00062 public: 00063 00064 /*---------------------------------------------------------------------*/ 00068 GroupConnection ( int zeroCopyThreshold ); 00069 virtual ~GroupConnection ( void ); 00070 00072 /*---------------------------------------------------------------------*/ 00076 virtual const ConnectionType *getType (void) = 0; 00077 00079 /*---------------------------------------------------------------------*/ 00083 virtual void disconnect ( Channel channel ) = 0; 00084 00086 /*---------------------------------------------------------------------*/ 00090 UInt32 getChannelCount (void ); 00091 void addSelection (Channel channel); 00092 void subSelection (Channel channel); 00093 void clearSelection (void ); 00094 void resetSelection (void ); 00095 UInt32 getSelectionCount(void ); 00096 00098 /*---------------------------------------------------------------------*/ 00102 void setDestination(const std::string &destination); 00103 std::string getDestination(void ); 00104 00107 /*========================= PROTECTED ===============================*/ 00108 protected: 00109 /*---------------------------------------------------------------------*/ 00113 std::vector<UInt8> _selection; 00114 std::string _destination; 00115 std::set<Channel> _disconnectedChannel; 00116 00118 /*---------------------------------------------------------------------*/ 00122 typedef Int32 ChannelIndex; 00123 00125 /*---------------------------------------------------------------------*/ 00129 Channel newChannelIndex(ChannelIndex index); 00130 void delChannelIndex(ChannelIndex index); 00131 00133 /*---------------------------------------------------------------------*/ 00137 ChannelIndex channelToIndex (Channel channel ) const; 00138 Channel indexToChannel (ChannelIndex index ) const; 00139 00142 /*========================== PRIVATE ================================*/ 00143 private: 00144 /*---------------------------------------------------------------------*/ 00148 std::vector<ChannelIndex> _channelToIndex; 00149 std::vector<Channel> _indexToChannel; 00150 std::list<Channel> _reuseChannel; 00151 00153 typedef Connection Inherited; 00154 00155 // prohibit default functions (move to 'public' if you need one) 00156 GroupConnection(const GroupConnection &source); 00157 GroupConnection& operator =(const GroupConnection &source); 00158 }; 00159 00160 //--------------------------------------------------------------------------- 00161 // Exported Types 00162 //--------------------------------------------------------------------------- 00163 00164 // class pointer 00165 00166 typedef GroupConnection *GroupConnectionP; 00167 00168 OSG_END_NAMESPACE 00169 00170 #define OSG_GROUPCONNECTION_HEADER_CVSID "@(#)$Id: $" 00171 00172 #endif /* _CONNECTION_H_ */
1.4.3