diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-10-16 15:01:08 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-10-16 15:01:08 -0230 |
commit | 667cf6024bbf1950da2eecffe65f00dc2169a9d6 (patch) | |
tree | a6efa0a355f8a2b1fa8f8b15fdf1d26ed91959f1 /rb/src/IceRuby/Proxy.cpp | |
parent | Changed Glacier2 to enable ACM for client connections, bug 3244 and 4298 (diff) | |
download | ice-667cf6024bbf1950da2eecffe65f00dc2169a9d6.tar.bz2 ice-667cf6024bbf1950da2eecffe65f00dc2169a9d6.tar.xz ice-667cf6024bbf1950da2eecffe65f00dc2169a9d6.zip |
Added Ruby implemetation of EndpointInfo and ConnectionInfo
Diffstat (limited to 'rb/src/IceRuby/Proxy.cpp')
-rw-r--r-- | rb/src/IceRuby/Proxy.cpp | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/rb/src/IceRuby/Proxy.cpp b/rb/src/IceRuby/Proxy.cpp index 8d04c382ca2..64f4ce5692a 100644 --- a/rb/src/IceRuby/Proxy.cpp +++ b/rb/src/IceRuby/Proxy.cpp @@ -9,6 +9,7 @@ #include <Proxy.h> #include <Communicator.h> +#include <ConnectionInfo.h> #include <Util.h> #include <Ice/Connection.h> #include <Ice/Locator.h> @@ -105,6 +106,22 @@ IceRuby_Connection_timeout(VALUE self) extern "C" VALUE +IceRuby_Connection_getInfo(VALUE self) +{ + ICE_RUBY_TRY + { + Ice::ConnectionPtr* p = reinterpret_cast<Ice::ConnectionPtr*>(DATA_PTR(self)); + assert(p); + + Ice::ConnectionInfoPtr info = (*p)->getInfo(); + return createConnectionInfo(info); + } + ICE_RUBY_CATCH + return Qnil; +} + +extern "C" +VALUE IceRuby_Connection_toString(VALUE self) { ICE_RUBY_TRY @@ -159,10 +176,6 @@ createEndpoint(const Ice::EndpointPtr& p) return Data_Wrap_Struct(_endpointClass, 0, IceRuby_Endpoint_free, new Ice::EndpointPtr(p)); } - -// -// Ice::Endpoint::toString -// extern "C" VALUE IceRuby_Endpoint_toString(VALUE self) @@ -179,6 +192,22 @@ IceRuby_Endpoint_toString(VALUE self) return Qnil; } +extern "C" +VALUE +IceRuby_Endpoint_getInfo(VALUE self) +{ + ICE_RUBY_TRY + { + Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); + assert(p); + + Ice::EndpointInfoPtr info = (*p)->getInfo(); + return createEndpointInfo(info); + } + ICE_RUBY_CATCH + return Qnil; +} + // ********************************************************************** // ObjectPrx // ********************************************************************** @@ -1316,6 +1345,7 @@ IceRuby::initProxy(VALUE iceModule) rb_define_method(_connectionClass, "flushBatchRequests", CAST_METHOD(IceRuby_Connection_flushBatchRequests), 0); rb_define_method(_connectionClass, "type", CAST_METHOD(IceRuby_Connection_type), 0); rb_define_method(_connectionClass, "timeout", CAST_METHOD(IceRuby_Connection_timeout), 0); + rb_define_method(_connectionClass, "getInfo", CAST_METHOD(IceRuby_Connection_getInfo), 0); rb_define_method(_connectionClass, "toString", CAST_METHOD(IceRuby_Connection_toString), 0); rb_define_method(_connectionClass, "to_s", CAST_METHOD(IceRuby_Connection_toString), 0); rb_define_method(_connectionClass, "inspect", CAST_METHOD(IceRuby_Connection_toString), 0); @@ -1331,6 +1361,9 @@ IceRuby::initProxy(VALUE iceModule) // Instance methods. // rb_define_method(_endpointClass, "toString", CAST_METHOD(IceRuby_Endpoint_toString), 0); + rb_define_method(_endpointClass, "getInfo", CAST_METHOD(IceRuby_Endpoint_getInfo), 0); + rb_define_method(_endpointClass, "to_s", CAST_METHOD(IceRuby_Endpoint_toString), 0); + rb_define_method(_endpointClass, "inspect", CAST_METHOD(IceRuby_Endpoint_toString), 0); // // ObjectPrx. |