00001
00002
00003
00004
00005 #ifndef EQNET_CONNECTIONDESCRIPTION_H
00006 #define EQNET_CONNECTIONDESCRIPTION_H
00007
00008 #include <eq/net/connectionType.h>
00009
00010 #include <eq/base/base.h>
00011 #include <eq/base/referenced.h>
00012
00013 namespace eq
00014 {
00015 namespace net
00016 {
00022 class EQ_EXPORT ConnectionDescription : public base::Referenced
00023 {
00024 public:
00025 ConnectionDescription()
00026 : type( CONNECTIONTYPE_TCPIP )
00027 , bandwidth( 0 )
00028 , launchTimeout( 10000 )
00029 , launchCommandQuote( '\'' )
00030 {
00031 TCPIP.port = 0;
00032 }
00033
00035 ConnectionType type;
00036
00038 int32_t bandwidth;
00039
00044 int32_t launchTimeout;
00045
00047 union
00048 {
00050 struct
00051 {
00053 uint16_t port;
00054
00055 } TCPIP, SDP;
00056 };
00057
00059 char launchCommandQuote;
00060
00062 std::string toString() const;
00063 void serialize( std::ostream& os ) const;
00064
00074 bool fromString( std::string& data );
00075
00080
00081 void setHostname( const std::string& hostname );
00082 const std::string& getHostname() const;
00083 void setLaunchCommand( const std::string& launchCommand );
00084 const std::string& getLaunchCommand() const;
00085
00086 protected:
00087 virtual ~ConnectionDescription() {}
00088
00089 private:
00098 std::string _launchCommand;
00099
00101 std::string _hostname;
00102 };
00103
00104 std::ostream& operator << ( std::ostream&, const ConnectionDescription* );
00105 }
00106 }
00107
00108 #endif // EQNET_CONNECTION_DESCRIPTION_H