summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf2
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2011-01-11 16:02:23 +0000
committerTed Ross <tross@apache.org>2011-01-11 16:02:23 +0000
commit5ab4ca01eb76291567c9f148882cd25ebdc5cce7 (patch)
tree505652128855de02c2860f99de19242c0cf0e0fe /cpp/bindings/qmf2
parente00055d161bf4203332ce86a58cfdbcccd01b785 (diff)
downloadqpid-python-5ab4ca01eb76291567c9f148882cd25ebdc5cce7.tar.gz
QMFv2 API change:
1) Added public constructor for DataAddr(Variant::Map) 2) Fixed Python and Ruby typemaps to support Variant::Map& and Variant::List& with const 3) Added support for building Queries based on object-id maps in both Python and Ruby wrappers git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1057709 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qmf2')
-rw-r--r--cpp/bindings/qmf2/python/qmf2.py14
-rw-r--r--cpp/bindings/qmf2/ruby/qmf2.rb14
2 files changed, 19 insertions, 9 deletions
diff --git a/cpp/bindings/qmf2/python/qmf2.py b/cpp/bindings/qmf2/python/qmf2.py
index 28e40d59ca..911b080dfd 100644
--- a/cpp/bindings/qmf2/python/qmf2.py
+++ b/cpp/bindings/qmf2/python/qmf2.py
@@ -311,7 +311,7 @@ class Agent(object):
"""
"""
if q.__class__ == Query:
- q_arg = Query._impl
+ q_arg = q._impl
else:
q_arg = q
dur = cqpid.Duration(cqpid.Duration.SECOND.getMilliseconds() * timeout)
@@ -366,10 +366,11 @@ class Query(object):
"""
"""
- def __init__(self, *kwargs):
+ def __init__(self, arg1, arg2=None, arg3=None, *kwargs):
"""
"""
- pass
+ if arg1.__class__ == DataAddr:
+ self._impl = cqmf2.Query(arg1._impl)
#===================================================================================================
# DATA
@@ -518,8 +519,11 @@ class DataAddr(object):
"""
"""
- def __init__(self, impl):
- self._impl = impl
+ def __init__(self, arg):
+ if arg.__class__ == dict:
+ self._impl = cqmf2.DataAddr(arg)
+ else:
+ self._impl = arg
def __repr__(self):
return "%s:%s" % (self.getAgentName(), self.getName())
diff --git a/cpp/bindings/qmf2/ruby/qmf2.rb b/cpp/bindings/qmf2/ruby/qmf2.rb
index 6c6dbf357d..65cc695c45 100644
--- a/cpp/bindings/qmf2/ruby/qmf2.rb
+++ b/cpp/bindings/qmf2/ruby/qmf2.rb
@@ -233,8 +233,10 @@ module Qmf2
class Query
attr_reader :impl
- def initialize
- @impl = nil
+ def initialize(arg1, arg2=nil, arg3=nil)
+ if arg1.class == Qmf2::DataAddr
+ @impl = Cqmf2::Query.new(arg1.impl)
+ end
end
end
@@ -390,8 +392,12 @@ module Qmf2
class DataAddr
attr_reader :impl
- def initialize(impl)
- @impl = impl
+ def initialize(arg)
+ if arg.class == Hash
+ @impl = Cqmf2::DataAddr.new(arg)
+ else
+ @impl = arg
+ end
end
def ==(other)