diff options
| author | Alan Conway <aconway@apache.org> | 2008-11-04 19:52:49 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-11-04 19:52:49 +0000 |
| commit | b816ea849a29d5dd41a64efd45fd32f3f74c41f3 (patch) | |
| tree | 3c1a29943bc73a1dceb19ccf0f4bf7c87a91e640 /qpid/cpp/rubygen/amqpgen.rb | |
| parent | 23981f0433d66bf6677bdea612d734a2bdb7ba45 (diff) | |
| download | qpid-python-b816ea849a29d5dd41a64efd45fd32f3f74c41f3.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@711365 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/rubygen/amqpgen.rb')
| -rwxr-xr-x | qpid/cpp/rubygen/amqpgen.rb | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/qpid/cpp/rubygen/amqpgen.rb b/qpid/cpp/rubygen/amqpgen.rb index 80542ebc77..b77ab09ac0 100755 --- a/qpid/cpp/rubygen/amqpgen.rb +++ b/qpid/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 |
