summaryrefslogtreecommitdiff
path: root/cpp/rubygen/cppgen.rb
Commit message (Collapse)AuthorAgeFilesLines
* QPID-3186 - Import Export generalization to support a larger set of ↵Ted Ross2011-05-171-0/+3
| | | | | | compilers and run time environments git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1104559 13f79535-47bb-0310-9956-ffa450edef68
* Code cleanup in broker directory.Alan Conway2010-10-141-8/+8
| | | | | | | | - Removed un-necessary #includes for broker/Queue.h - Removed "using std::string" in header files. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1022679 13f79535-47bb-0310-9956-ffa450edef68
* constants.rb: generate type code constants for AMQP types. Useful with Array.Alan Conway2008-11-041-1/+1
| | | | | | | | | 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
* Simplified cluster updates.Alan Conway2008-09-161-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@695696 13f79535-47bb-0310-9956-ffa450edef68
* Only override default value for accept-mode field in message.transfer (not ↵Gordon Sim2008-07-041-2/+2
| | | | | | message.subscribe) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@674003 13f79535-47bb-0310-9956-ffa450edef68
* rubygen: Change default for client API accept-mode parameters to 1.Alan Conway2008-07-031-0/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@673725 13f79535-47bb-0310-9956-ffa450edef68
* Generate c++ code from final 0-10 specGordon Sim2008-04-241-72/+96
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@651423 13f79535-47bb-0310-9956-ffa450edef68
* QPID-920: converted c++ client to use final 0-10 protocolGordon Sim2008-04-201-4/+31
| | | | | | | | | | * connection handler converted to using invoker & proxy and updated to final method defs * SessionCore & ExecutionHandler replace by SessionImpl * simplified handling of completion & results, removed handling of responses git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@649915 13f79535-47bb-0310-9956-ffa450edef68
* amqp_0_10: Encoding for packed structs.Alan Conway2008-04-101-2/+10
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@646943 13f79535-47bb-0310-9956-ffa450edef68
* Invocation handlers, see src/tests/amqp_0_10/handlers.cpp for example.Alan Conway2008-04-101-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@646778 13f79535-47bb-0310-9956-ffa450edef68
* Encoding/decoding for new types: amqp_0_10::Map, amqp_0_10:UnknownTypeAlan Conway2008-04-021-3/+8
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@643995 13f79535-47bb-0310-9956-ffa450edef68
* Completed holders, visitors and serialization for 0-10 commands and controls.Alan Conway2008-03-041-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@633533 13f79535-47bb-0310-9956-ffa450edef68
* A further step to final 0-10 spec.Gordon Sim2008-03-031-0/+9
| | | | | | | | | The extra.xml fragment adds class defs for connection in session that are in line with latest spec but use old schema. The preview codepath (99-0) remains unaltered. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@633108 13f79535-47bb-0310-9956-ffa450edef68
* Template visitors for amqp_0_10::Command, Control and Struct.Alan Conway2008-02-291-7/+15
| | | | | | | Serialization for all str/vbin types. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@632457 13f79535-47bb-0310-9956-ffa450edef68
* amqp_0_10::ProxyTemplate - tested & functional.Alan Conway2008-02-281-33/+60
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@632075 13f79535-47bb-0310-9956-ffa450edef68
* Generating domains, structs, commands and controls for 0-10 final spec.Alan Conway2008-02-271-12/+18
| | | | | | | Not yet generating: holders, visitors. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@631740 13f79535-47bb-0310-9956-ffa450edef68
* Generate code for both 0-99 preview and 0-10 final specs .Alan Conway2008-02-271-11/+62
| | | | | | | 0-10 final: extended code generation and non-generated support classes. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@631638 13f79535-47bb-0310-9956-ffa450edef68
* Fixed rubygen to skip unchanged generated files, prevents needlessAlan Conway2008-02-221-2/+23
| | | | | | | | | rebuilding every time the code generator changes. Start of amqp 0-10 mapping, work in progress. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@630353 13f79535-47bb-0310-9956-ffa450edef68
* Add support for array type to c++ (and python, decode only for now)Gordon Sim2007-11-061-0/+1
| | | | | | | | Change the type of the in-doubt field in dtx-coordination.recover to an array (to bring in line with amqp spec) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592494 13f79535-47bb-0310-9956-ffa450edef68
* Generate doxygen comments for Session_0_10 using AMQP <doc> elements.Alan Conway2007-10-301-0/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@590512 13f79535-47bb-0310-9956-ffa450edef68
* Client API: fix keyword parameter ambiguities for beta client API.Alan Conway2007-10-301-2/+11
| | | | | | | | | | | | | | Classes: - client::no_keyword::Session_0_10 - plain defaulted signatures - client::Session_0_10 - keyword API. Keyword API changes: - keywords in client::arg namespace, user says: s.bind(arg::queue="x"...) - user can omit with: using namespace client::arg; s.bind(queue="x"...) - No trailing "_" required on session functions. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@590498 13f79535-47bb-0310-9956-ffa450edef68
* * Summary: generalized Invoker visitor to all *Operations andAlan Conway2007-10-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | *Handler classes, client and broker. Single template free function invoke(Invocable, const AMQBody&); works for all invocable handlers. * rubygen/templates/OperationsInvoker.rb: Generates invoker visitors for all Operations classes, client and server. * src/qpid/framing/Invoker.h: Invoker base class and template invoke() function. * rubygen/templates/structs.rb: add generic invoke method template to invoke an arbitrary object with the correct memeber function. * src/qpid/framing/AMQMethodBody.cpp, .h: Removed invoke(), replaced by qpid::framing::invoke() * src/qpid/broker/SemanticHandler.cpp, ConnectionHandler.cpp: Replace AMQMethodBody::invoke with invoke() free function. * src/qpid/framing/StructHelper.h: Avoid un-necessary alloc and copy in encode/decode. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@585223 13f79535-47bb-0310-9956-ffa450edef68
* Implementation of 0-10 field tablesAndrew Stitcher2007-10-161-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@585097 13f79535-47bb-0310-9956-ffa450edef68
* Some revisions to rubygen for packed structs and execution header (changes ↵Gordon Sim2007-09-271-0/+5
| | | | | | not yet enabled) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580094 13f79535-47bb-0310-9956-ffa450edef68
* Support for keyword args in session interfaceGordon Sim2007-09-101-6/+11
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@574323 13f79535-47bb-0310-9956-ffa450edef68
* * rubygen/cppgen.rb: Use class Uuid for AMQP uuids.Alan Conway2007-08-291-3/+1
| | | | | | | * rubygen/templates/structs.rb: Use class Uuid for AMQP uuids. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@570595 13f79535-47bb-0310-9956-ffa450edef68
* * src/qpid/framing/FrameDefaultVisitor.h:Alan Conway2007-08-271-0/+6
| | | | | | | | | | | | | | | A visitor for all concrete frame body types. * src/qpid/broker/SessionState.h: 3 states - closed, active, suspended. * src/qpid/broker/SessionAdapter.h, .cpp: Session handler, implements session class commands. In progres.. * rubygen/templates/MethodBodyDefaultVisitor.rb: A visitor for all method body types. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@570236 13f79535-47bb-0310-9956-ffa450edef68
* * rubygen/cppgen.rb: Use uint rather than u_int form for consistency.Alan Conway2007-08-271-7/+8
| | | | | | | * rubygen/amqpgen.rb: Removed unnecessary sorting. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@570111 13f79535-47bb-0310-9956-ffa450edef68
* * rubygen/amqpgen.rb: Performance and API improvements.Alan Conway2007-08-271-78/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Refresh of transitional xml to more closely reflect latest specificationGordon Sim2007-08-211-1/+30
| | | | | | | | | Initial execution-result support (not yet handled on c++ client) Generation is now all done through the ruby code (it is a little slower at present I'm afraid, will try to speed it up over the next weeks) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568174 13f79535-47bb-0310-9956-ffa450edef68
* AMQBodies are no longer allocated on the heap and passed with shared_ptr.Alan Conway2007-08-161-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | AMQFrame contains a boost::variant of AMQHeaderBody,AMQContentBody, AMQHeatbeatBody, and MethodHolder. A variant is basically a type-safe union, it can allocate any of the types in-place. MethodHolder contains a Blob, a less sophisticated kind of variant, which can contain any of the concrete method body types. Using variants for all the method types causes outrageous compile times and bloated library symbol names. Blob lacks some of the finer features of variant and needs help from generated code. For now both are hidden to the rest of the code base behind AMQFrame and MethodBody classes so if/when we decide to settle on just one "variant" type solution we can do so. This commit touches nearly 100 files, mostly converting method signatures with shared_ptr<FooBody> to FooBody* or FooBody&, and converting stored shared_ptr<AMQBody> to AMQFrame and share_ptr<AMQMethodBody> to MethodHolder. There is one outstanding client memory leak, which I will fix in my next commit. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@566822 13f79535-47bb-0310-9956-ffa450edef68
* Removed unused types: RequestId, ResponseId, MethodContext.Alan Conway2007-08-141-1/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@565821 13f79535-47bb-0310-9956-ffa450edef68
* * src/qpid/framing/MethodHolder.h, .cpp:Alan Conway2007-08-091-3/+5
| | | | | | | | | | | Replace boost::variant with Blob. * rubygen/templates/MethodHolder.rb: Generate support files for Blob-based MethodHolder. * src/Makefile.am: generate MethodHolder suppport files. * rubygen/cppgen.rb: Minor fixes/enhancements. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@564409 13f79535-47bb-0310-9956-ffa450edef68
* Avoid clash with built-in ruby function Object.methods():nAlan Conway2007-08-091-1/+1
| | | | | | | | - Renamed methods*() to amqp_methods, classes*() to amqp_classes. - Renamed CppGen.class_() to cpp_class. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@564225 13f79535-47bb-0310-9956-ffa450edef68
* Moved Proxy generation to rubygen.Alan Conway2007-08-091-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@564051 13f79535-47bb-0310-9956-ffa450edef68
* * Summary: new Frame type to replace AMQFrame. Instead of holdingAlan Conway2007-08-071-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a shared_ptr to a heap-allocated AMQBody subclass, it holds the body in-line in a boost::variant of all the concrete AMQBody subclasses. Actually there are nested variants, the compiler does not cope well with a single variant of 130-some types. Creating, encoding and decoding a local Frame doess 0 heap allocation apart from that done by the concrete AMQBody::encode/decode - e.g. method bodies with std::string fields. for method bodies All variants contain type boost::blank. This guarantees 0 heap alloocation by the variant and represents the "uninitialized" state. variant.h provides NoBlankVisitor to help write visitors for variants containing blank. * src/qpid/framing/MethodHolder.h, .cpp: Holds a variant containing a method body. * src/qpid/framing/Frame.h, .cpp: New Frame holds body in a variant rather than via heap allocation. * src/qpid/framing/variant.h: Utilities for using boost::variant. * src/qpid/framing/amqp_types.h: Added FrameType typedef. * src/qpid/framing/AMQMethodBody.h: Friends with MethodHolder. * src/Makefile.am: - Improved ruby generation rule. - Run method_variants template. - Added new source files - Pre-compiled header rule for method_variants.h * rubygen/templates/method_variants.rb: Generate variants to hold methods of each class, and MethodVariant to hold all the class variants. * rubygen/cppgen.rb: variant, tuple methods. * MethodBodyClass.h.tmpl: Added default constructor to method bodies. * amqpgen.rb (AmqpRoot::merge): fix bug in merge. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@563683 13f79535-47bb-0310-9956-ffa450edef68
* Added first cut of generated client interface.Gordon Sim2007-08-051-1/+1
| | | | | | | | | Old channel interface still supported; shares SessionCore with the new interface. Todo: allow applications to signal completion of received commands; keywrod args for interface. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@562866 13f79535-47bb-0310-9956-ffa450edef68
* * amqpgen.rb: fix sytax error.Alan Conway2007-08-051-11/+29
| | | | | | | | | | * cppgen.rb: - 0-10 types - typedef generator - automatic whitespace around classes etc. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@562845 13f79535-47bb-0310-9956-ffa450edef68
* Generate boost::variants for each class. Not yet used on trunk.Alan Conway2007-08-021-5/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@562255 13f79535-47bb-0310-9956-ffa450edef68
* * src/generate.sh: Moved requirements test to configure.acAlan Conway2007-08-011-0/+25
| | | | | | | | | | | | | | | | | | | | | * rubygen: Cleanup and improvements, template for cluster work. * configure.ac: - support for ruby code generator + cleanup. - moved "can generate" tests to configure.ac - removed redundant APR stuff. * bootstrap: Remove codegen from bootstrap, all in config/make. * src/Makefile.am (libqpidcommon_la_LIBADD): - Ruby code generator. - Improvements to existing generator rules. - Removed APR stuff. * configure.ac (CPPUNIT_CXXFLAGS): Removed APR stuff. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@561869 13f79535-47bb-0310-9956-ffa450edef68
* Ruby code generator for C++.Alan Conway2007-07-311-0/+126
Not yet in active use yet but two sample templates are provided. Note: same dependency story as java codegen: distribution has pre-generated code so ruby not required to build a distro. Only required for svn working copy builds. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@561468 13f79535-47bb-0310-9956-ffa450edef68