lib/net/connectionDescription.h

00001 
00002 /* Copyright (c) 2005-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQNET_CONNECTIONDESCRIPTION_H
00019 #define EQNET_CONNECTIONDESCRIPTION_H
00020 
00021 #include <eq/net/connectionType.h>
00022 
00023 #include <eq/base/base.h>
00024 #include <eq/base/referenced.h>
00025 
00026 namespace eq
00027 {
00028 namespace net
00029 {
00035     class ConnectionDescription : public base::Referenced
00036     {
00037     public:
00038         ConnectionDescription() 
00039                 : type( CONNECTIONTYPE_TCPIP )
00040                 , bandwidth( 0 )
00041                 , launchTimeout( 10000 )
00042                 , launchCommandQuote( '\'' )
00043             {
00044                 TCPIP.port = 0;
00045             }
00046 
00048         ConnectionType type;
00049 
00051         int32_t bandwidth;
00052 
00057         int32_t launchTimeout;
00058 
00060         union
00061         {
00063             struct
00064             {
00066                 uint16_t port;
00067 
00068             } TCPIP, SDP;
00069         };
00070 
00072         char launchCommandQuote;
00073 
00075         EQ_EXPORT std::string toString() const;
00076         EQ_EXPORT void serialize( std::ostream& os ) const;
00077 
00087         EQ_EXPORT bool fromString( std::string& data );
00088 
00094         EQ_EXPORT void setHostname( const std::string& hostname );
00095         EQ_EXPORT const std::string& getHostname() const;
00096         EQ_EXPORT void setLaunchCommand( const std::string& launchCommand );
00097         EQ_EXPORT const std::string& getLaunchCommand() const;
00098         EQ_EXPORT void setFilename( const std::string& filename );
00099         EQ_EXPORT const std::string& getFilename() const;
00101 
00102     protected:
00103         EQ_EXPORT virtual ~ConnectionDescription() {}
00104 
00105     private:
00114         std::string _launchCommand; 
00115 
00117         std::string _hostname;
00118 
00120         std::string _filename;
00121     };
00122 
00123     EQ_EXPORT std::ostream& operator << ( std::ostream&,
00124                                           const ConnectionDescription* );
00125 }
00126 }
00127 
00128 #endif // EQNET_CONNECTION_DESCRIPTION_H
Generated on Mon Aug 10 18:58:32 2009 for Equalizer 0.9 by  doxygen 1.5.8