summaryrefslogtreecommitdiff
path: root/qpid/cpp/bindings/qmf/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/bindings/qmf/ruby')
-rw-r--r--qpid/cpp/bindings/qmf/ruby/qmf.rb7
-rw-r--r--qpid/cpp/bindings/qmf/ruby/ruby.i33
2 files changed, 38 insertions, 2 deletions
diff --git a/qpid/cpp/bindings/qmf/ruby/qmf.rb b/qpid/cpp/bindings/qmf/ruby/qmf.rb
index f3915e9c02..79b18423db 100644
--- a/qpid/cpp/bindings/qmf/ruby/qmf.rb
+++ b/qpid/cpp/bindings/qmf/ruby/qmf.rb
@@ -174,12 +174,19 @@ module Qmf
@impl = Qmfengine::ObjectId.new
end
end
+
def object_num_high
return @impl.getObjectNumHi
end
+
def object_num_low
return @impl.getObjectNumLo
end
+
+ def ==(other)
+ return (@impl.getObjectNumHi == other.impl.getObjectNumHi) &&
+ (@impl.getObjectNumLo == other.impl.getObjectNumLo)
+ end
end
class Arguments
diff --git a/qpid/cpp/bindings/qmf/ruby/ruby.i b/qpid/cpp/bindings/qmf/ruby/ruby.i
index a8a2a87a97..8c2da1b494 100644
--- a/qpid/cpp/bindings/qmf/ruby/ruby.i
+++ b/qpid/cpp/bindings/qmf/ruby/ruby.i
@@ -43,7 +43,10 @@
%typemap (in) uint32_t
{
- $1 = NUM2UINT ($input);
+ if (TYPE($input) == T_BIGNUM)
+ $1 = NUM2UINT($input);
+ else
+ $1 = FIX2UINT($input);
}
%typemap (out) uint32_t
@@ -51,6 +54,19 @@
$result = UINT2NUM((unsigned int) $1);
}
+%typemap (in) int32_t
+{
+ if (TYPE($input) == T_BIGNUM)
+ $1 = NUM2INT($input);
+ else
+ $1 = FIX2INT($input);
+}
+
+%typemap (out) int32_t
+{
+ $result = INT2NUM((int) $1);
+}
+
%typemap (typecheck, precedence=SWIG_TYPECHECK_INTEGER) uint32_t {
$1 = FIXNUM_P($input);
}
@@ -62,7 +78,20 @@
%typemap (out) uint64_t
{
- $result = ULONG2NUM((unsigned long) $1);
+ $result = ULONG2NUM((long) $1);
+}
+
+%typemap (in) int64_t
+{
+ if (TYPE($input) == T_BIGNUM)
+ $1 = NUM2LONG($input);
+ else
+ $1 = FIX2LONG($input);
+}
+
+%typemap (out) int64_t
+{
+ $result = LONG2NUM((long) $1);
}
%typemap (typecheck, precedence=SWIG_TYPECHECK_INTEGER) uint64_t {