summaryrefslogtreecommitdiff
path: root/cpp/rubygen/amqpgen.rb
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-11-04 19:52:49 +0000
committerAlan Conway <aconway@apache.org>2008-11-04 19:52:49 +0000
commiteda249ff22edb3726243da81ff48c82e4d88e872 (patch)
tree0939d790e6a1b0d86993c9c3804c1adaa369aeb8 /cpp/rubygen/amqpgen.rb
parent5d2471636928eff8b8031237c54348db0d5c388d (diff)
downloadqpid-python-eda249ff22edb3726243da81ff48c82e4d88e872.tar.gz
constants.rb: generate type code constants for AMQP types. Useful with Array.
framing/Array: - added some std:::vector like functions & typedefs. - use TypeCode enums, human readable ostream << operator. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711365 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/rubygen/amqpgen.rb')
-rwxr-xr-xcpp/rubygen/amqpgen.rb25
1 files changed, 16 insertions, 9 deletions
diff --git a/cpp/rubygen/amqpgen.rb b/cpp/rubygen/amqpgen.rb
index 80542ebc77..b77ab09ac0 100755
--- a/cpp/rubygen/amqpgen.rb
+++ b/cpp/rubygen/amqpgen.rb
@@ -165,7 +165,7 @@ class AmqpElement
# The root <amqp> element.
def root() @root ||=parent ? parent.root : self; end
- def to_s() "#<#{self.class}(#{fqname})>"; end
+ def to_s() "#<#{self.class}(#{fqname})>"; end
def inspect() to_s; end
# Text of doc child if there is one.
@@ -181,6 +181,21 @@ class AmqpElement
return self if is_a? AmqpClass
return parent && parent.containing_class
end
+
+ # 0-10 array domains are missing element type information, add it here.
+ ArrayTypes={
+ "str16-array" => "str-16",
+ "amqp-host-array" => "connection.amqp-host-url",
+ "command-fragments" => "session.command-fragment",
+ "in-doubt" => "dtx.xid",
+ "tx-publish" => "str-8",
+ "queues" => "str-8"
+ }
+
+ def array_type(name)
+ return ArrayTypes[name] if ArrayTypes[name]
+ raise "Missing ArrayType entry for " + name
+ end
end
@@ -204,14 +219,6 @@ class AmqpEnum < AmqpElement
amqp_child_reader :choice
end
-# 0-10 array domains are missing element type information, add it here.
-ArrayTypes={
- "str16-array" => "str-16",
- "amqp-host-array" => "connection.amqp-host-url",
- "command-fragments" => "session.command-fragment",
- "in-doubt" => "dtx.xid"
-}
-
class AmqpDomain < AmqpElement
def initialize(xml, parent)
super