lib/net/connectionDescription.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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