diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-10-14 12:50:24 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-10-14 12:50:24 -0230 |
commit | 0d3f5c27312df723bb6682cca48dbb18c9f874b9 (patch) | |
tree | f9ad7e4126cbfd50c698a1d73fc6fd14e33a15bc /rb/src/IceRuby/Proxy.cpp | |
parent | Merge branch 'master' of ssh://git.zeroc.com/home/git/ice (diff) | |
download | ice-0d3f5c27312df723bb6682cca48dbb18c9f874b9.tar.bz2 ice-0d3f5c27312df723bb6682cca48dbb18c9f874b9.tar.xz ice-0d3f5c27312df723bb6682cca48dbb18c9f874b9.zip |
Fixed py and rb to compile again with Enpoint changes
Diffstat (limited to 'rb/src/IceRuby/Proxy.cpp')
-rw-r--r-- | rb/src/IceRuby/Proxy.cpp | 241 |
1 files changed, 1 insertions, 240 deletions
diff --git a/rb/src/IceRuby/Proxy.cpp b/rb/src/IceRuby/Proxy.cpp index c52385c0b89..8d04c382ca2 100644 --- a/rb/src/IceRuby/Proxy.cpp +++ b/rb/src/IceRuby/Proxy.cpp @@ -21,9 +21,6 @@ using namespace IceRuby; static VALUE _connectionClass; static VALUE _endpointClass; -static VALUE _tcpEndpointClass; -static VALUE _udpEndpointClass; -static VALUE _opaqueEndpointClass; static VALUE _proxyClass; // ********************************************************************** @@ -159,24 +156,7 @@ IceRuby_Endpoint_free(Ice::EndpointPtr* p) static VALUE createEndpoint(const Ice::EndpointPtr& p) { - volatile VALUE type; - if(Ice::TcpEndpointPtr::dynamicCast(p)) - { - type = _tcpEndpointClass; - } - else if(Ice::UdpEndpointPtr::dynamicCast(p)) - { - type = _udpEndpointClass; - } - else if(Ice::OpaqueEndpointPtr::dynamicCast(p)) - { - type = _opaqueEndpointClass; - } - else - { - type = _endpointClass; - } - return Data_Wrap_Struct(type, 0, IceRuby_Endpoint_free, new Ice::EndpointPtr(p)); + return Data_Wrap_Struct(_endpointClass, 0, IceRuby_Endpoint_free, new Ice::EndpointPtr(p)); } @@ -199,187 +179,6 @@ IceRuby_Endpoint_toString(VALUE self) return Qnil; } -// -// Ice::Endpoint::timeout -// -extern "C" -VALUE -IceRuby_Endpoint_timeout(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - - Ice::Int t = (*p)->timeout(); - return INT2FIX(t); - } - ICE_RUBY_CATCH - return Qnil; -} - -// -// Ice::Endpoint::compress -// -extern "C" -VALUE -IceRuby_Endpoint_compress(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - - return (*p)->compress() ? Qtrue : Qfalse; - } - ICE_RUBY_CATCH - return Qnil; -} - -// -// Ice::TcpEndpoint::host -// -extern "C" -VALUE -IceRuby_TcpEndpoint_host(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - Ice::TcpEndpointPtr q = Ice::TcpEndpointPtr::dynamicCast(*p); - assert(q); - - string s = q->host(); - return createString(s); - } - ICE_RUBY_CATCH - return Qnil; -} - -extern "C" -VALUE -IceRuby_TcpEndpoint_port(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - Ice::TcpEndpointPtr q = Ice::TcpEndpointPtr::dynamicCast(*p); - assert(q); - - Ice::Int t = q->port(); - return INT2FIX(t); - } - ICE_RUBY_CATCH - return Qnil; -} - -// -// Ice::UdpEndpoint::host -// -extern "C" -VALUE -IceRuby_UdpEndpoint_host(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - Ice::UdpEndpointPtr q = Ice::UdpEndpointPtr::dynamicCast(*p); - assert(q); - - string s = q->host(); - return createString(s); - } - ICE_RUBY_CATCH - return Qnil; -} - -// -// Ice::UdpEndpoint::port -// -extern "C" -VALUE -IceRuby_UdpEndpoint_port(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - Ice::UdpEndpointPtr q = Ice::UdpEndpointPtr::dynamicCast(*p); - assert(q); - - Ice::Int t = q->port(); - return INT2FIX(t); - } - ICE_RUBY_CATCH - return Qnil; -} - -// -// Ice::UdpEndpoint::mcastInterface -// -extern "C" -VALUE -IceRuby_UdpEndpoint_mcastInterface(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - Ice::UdpEndpointPtr q = Ice::UdpEndpointPtr::dynamicCast(*p); - assert(q); - - string s = q->mcastInterface(); - return createString(s); - } - ICE_RUBY_CATCH - return Qnil; -} - -// -// Ice::UdpEndpoint::mcastTtl -// -extern "C" -VALUE -IceRuby_UdpEndpoint_mcastTtl(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - Ice::UdpEndpointPtr q = Ice::UdpEndpointPtr::dynamicCast(*p); - assert(q); - - Ice::Int t = q->mcastTtl(); - return INT2FIX(t); - } - ICE_RUBY_CATCH - return Qnil; -} - -// -// Ice::OpaqueEndpoint::rawBytes -// -extern "C" -VALUE -IceRuby_OpaqueEndpoint_rawBytes(VALUE self) -{ - ICE_RUBY_TRY - { - Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)); - assert(p); - Ice::OpaqueEndpointPtr q = Ice::OpaqueEndpointPtr::dynamicCast(*p); - assert(q); - - Ice::ByteSeq b = q->rawBytes(); - return callRuby(rb_str_new, reinterpret_cast<const char*>(&b[0]), static_cast<long>(b.size())); - } - ICE_RUBY_CATCH - return Qnil; -} - // ********************************************************************** // ObjectPrx // ********************************************************************** @@ -1532,44 +1331,6 @@ IceRuby::initProxy(VALUE iceModule) // Instance methods. // rb_define_method(_endpointClass, "toString", CAST_METHOD(IceRuby_Endpoint_toString), 0); - rb_define_method(_endpointClass, "timeout", CAST_METHOD(IceRuby_Endpoint_timeout), 0); - rb_define_method(_endpointClass, "compress", CAST_METHOD(IceRuby_Endpoint_compress), 0); - rb_define_method(_endpointClass, "to_s", CAST_METHOD(IceRuby_Endpoint_toString), 0); - rb_define_method(_endpointClass, "inspect", CAST_METHOD(IceRuby_Endpoint_toString), 0); - - // - // TcpEndpoint. - // - _tcpEndpointClass = rb_define_class_under(iceModule, "TcpEndpoint", _endpointClass); - - // - // Instance methods. - // - rb_define_method(_tcpEndpointClass, "host", CAST_METHOD(IceRuby_TcpEndpoint_host), 0); - rb_define_method(_tcpEndpointClass, "port", CAST_METHOD(IceRuby_TcpEndpoint_port), 0); - - // - // UdpEndpoint. - // - _udpEndpointClass = rb_define_class_under(iceModule, "UdpEndpoint", _endpointClass); - - // - // Instance methods. - // - rb_define_method(_udpEndpointClass, "host", CAST_METHOD(IceRuby_UdpEndpoint_host), 0); - rb_define_method(_udpEndpointClass, "port", CAST_METHOD(IceRuby_UdpEndpoint_port), 0); - rb_define_method(_udpEndpointClass, "mcastInterface", CAST_METHOD(IceRuby_UdpEndpoint_mcastInterface), 0); - rb_define_method(_udpEndpointClass, "mcastTtl", CAST_METHOD(IceRuby_UdpEndpoint_mcastTtl), 0); - - // - // OpaqueEndpoint. - // - _opaqueEndpointClass = rb_define_class_under(iceModule, "OpaqueEndpoint", _endpointClass); - - // - // Instance methods. - // - rb_define_method(_opaqueEndpointClass, "rawBytes", CAST_METHOD(IceRuby_OpaqueEndpoint_rawBytes), 0); // // ObjectPrx. |