diff options
author | Alan Conway <aconway@apache.org> | 2008-04-07 21:16:48 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-04-07 21:16:48 +0000 |
commit | 3acc5c719c147ee0122855ef767432cb8c2c6700 (patch) | |
tree | b9d11dbeeb7a3c9d8fe6105351ae209c8472fdbd /qpid/cpp/rubygen | |
parent | e8ddc00951f58635b05030c50180a23c02e44664 (diff) | |
download | qpid-python-3acc5c719c147ee0122855ef767432cb8c2c6700.tar.gz |
rubygen/0-10/specification.rb
- operator << for generated types.
- src/tests/amqp_0_10/serialize.cpp
src/qpid/BoundedIterator.h, .cpp
- removed unused file
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@645699 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/rubygen')
-rwxr-xr-x | qpid/cpp/rubygen/0-10/specification.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/qpid/cpp/rubygen/0-10/specification.rb b/qpid/cpp/rubygen/0-10/specification.rb index 549a51fba0..83a7da07a2 100755 --- a/qpid/cpp/rubygen/0-10/specification.rb +++ b/qpid/cpp/rubygen/0-10/specification.rb @@ -86,9 +86,10 @@ class Specification < CppGen end genl scope("std::ostream& operator << (std::ostream& o, const #{x.classname}&#{"x" unless x.fields.empty?}) {") { - genl "return o << \"[#{x.fqname}\";"; + genl "o << \"[#{x.fqname}\";"; x.fields.each{ |f| genl "o << \" #{f.name}=\" << x.#{f.cppname};" } genl "o << \"];\";" + genl "return o;" } end @@ -158,7 +159,7 @@ class Specification < CppGen # Structs that must be generated early because # they are used by other definitions: each_class_ns { |c| - c.collect_all(AmqpStruct).each { |s| struct_h s if pregenerate? s } + c.collect_all(AmqpStruct).each { |s| struct_h s if pregenerate? s } } # Now dependent domains/structs and actions each_class_ns { |c| @@ -272,7 +273,11 @@ class Specification < CppGen genl "template <class T> #{name}(const T& t) : #{holder_base}(t) {}" genl "using #{holder_base}::operator=;" genl "void set(uint8_t classCode, uint8_t code);" - }}} + } + genl + genl "std::ostream& operator<<(std::ostream& o, const #{name}& h);" + } + } cpp_file("#{@dir}/#{name}") { include "#{@dir}/#{name}" @@ -286,7 +291,11 @@ class Specification < CppGen genl "case 0x#{s.full_code.to_s(16)}: *this=in_place<#{s.fqclassname}>(); break;" } genl "default: assert(0);" - }}}} + }} + genl + genl "std::ostream& operator<<(std::ostream& o, const #{name}& h) { return h.get() ? (o << *h.get()) : (o << \"<empty #{name}>\"); }" + } + } end def gen_visitable(base, subs) |