summaryrefslogtreecommitdiff
path: root/cpp/rubygen/generate
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-08-27 12:56:29 +0000
committerAlan Conway <aconway@apache.org>2007-08-27 12:56:29 +0000
commit54b9b8aeb902851cd52825764938e1b012e06a43 (patch)
treeb48f08f56570a857091dcf6b3276372bb0c0e5a4 /cpp/rubygen/generate
parent91b71b5e76868d482a0889758acf0675c871d871 (diff)
downloadqpid-python-54b9b8aeb902851cd52825764938e1b012e06a43.tar.gz
* rubygen/amqpgen.rb: Performance and API improvements.
Added nodes for all amqp.xml elements except doc, assert and rule. (They can easily be added.) In particular AmqpDomain is a proper node, providing a place to do type mapping. Every node has reader methods for AMQP attributes/elements: - attr() for each AMQP attribute "attr" returns the string value. - foos() returns AmqpElements for all the "foo" children. - foo(name) returns AmqpElements for the named "foo" child domain() returns an AmqpDomain rather than the string name. Method names that would clash with Object methods get a trailing "_" So: class_/classes, method_/methods_, type_/types Notes: - no amqp_ prefixes. - AmqpElement does not inherit REXML::Element, AmqpElement#xml() to get the REXML element. Performance: all templates run in 2.8 seconds on my laptop, compared to almost two minutes previously. Main change was to replace xpath searches with simple descent of the Amqp model and cache values selectively based on profiling. * rubygen/cppgen.rb: - Updated for amqpgen changes. - Introduced CppType to manage C++ type information - Moved all type mapping to CppType/AmqpDomain Some templates still do their own type calculations, these should be centralized in CppType so they can be re-used. * rubygen/templates/*: Updated for new API * src/qpid/framing/amqp_types_full.h: Added Uuid.h * xml/cluster.xml: change "type" attribute to "domain" git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@570096 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/rubygen/generate')
-rwxr-xr-xcpp/rubygen/generate4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpp/rubygen/generate b/cpp/rubygen/generate
index 52313186ed..e35a5458ea 100755
--- a/cpp/rubygen/generate
+++ b/cpp/rubygen/generate
@@ -23,12 +23,12 @@ Specs=ARGV.grep(/\.xml$/)
Amqp=AmqpRoot.new(*Specs)
# Run selected templates
-if ARGV.grep("^all$")
+if ARGV.any? { |arg| arg=="all" }
templates=Dir["#{File.dirname __FILE__}/templates/*.rb"]
else
templates=ARGV.grep(/\.rb$/)
end
-templates.each { |t| require t }
+templates.each { |t| load t }
# Generate makefile
makefile=ARGV.grep(/.mk$/)[0]