summaryrefslogtreecommitdiff
path: root/cpp/rubygen/templates
Commit message (Collapse)AuthorAgeFilesLines
* Generate code for both 0-99 preview and 0-10 final specs .Alan Conway2008-02-2712-1361/+0
| | | | | | | 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-0/+64
| | | | | | | | | 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
* Start moving towards final 0-10 spec:Gordon Sim2008-02-211-2/+2
| | | | | | | | | | | | | * marked preview spec as 99-0 to distinguish it from 0-10 (which will now be used for the final version) * modified python client to treat 99-0 as 0-10 for now * modified broker to have two paths for the two different versions: 99-0 uses PreviewConnection, PreviewConnectionHandler and PreviewSessionHandler which are straight copy & pastes of the Connection, ConnectionHandler and SessionHandler now associated with 0-10 (so we can migrate the 0-10 path to the final spec without affecting clients working with the preview version) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@629883 13f79535-47bb-0310-9956-ffa450edef68
* Some minor changes to doc; primarily aimed at making the list of classesGordon Sim2008-01-231-0/+1
| | | | | | | | listed as client API more useful. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@614551 13f79535-47bb-0310-9956-ffa450edef68
* Summary:Alan Conway2007-12-071-53/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced InProcessBroker with BrokerFixture, uses a full loopback broker for more realistic tests. - Extracted non-generated parts of Session_0_10 into SessionBase. - Sundry small fixes. src/tests/BrokerFixture.h - in process broker with loopback connections. - tests can force a disorderly disconnect. src/qpid/client/Connector.h - back door to private members for BrokerFixture. - close() in destructor to avoid leaks. src/qpid/client/ConnectionImpl.h,cpp: - close() in destructor, to fix hang when destroyed without being closed. src/qpid/client/CompletionTracker.h,.cpp: - Fixed race in close/add. src/qpid/client/SessionBase.h,cpp: - Extracted all non-generated code from Session_0_10 into SessionBase - Added sync() src/tests/exception_test.cpp: Converted to boost & BrokerFixture src/tests/ClientChannelTest.cpp, ClientSessionTest.cpp: Use BrokerFixture git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@602182 13f79535-47bb-0310-9956-ffa450edef68
* Added framing::BodyHolder:Alan Conway2007-11-221-20/+34
| | | | | | | | | | | | | | - Uniform holder for all body types, replaces MethodHolder. - Uses in_place constructors to avoid avoid body copy. framing::AMQFrame: - Holds body in heap-allocated intrusive_ptr<BodyHolder> - Uses in_place constructors to avoid avoid body copy. Removed/downgraded to TODO many redundant FIXME comments. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@597513 13f79535-47bb-0310-9956-ffa450edef68
* Fix for QPID-639: c++ now includes sizes for all structs (enabled the same ↵Gordon Sim2007-11-071-7/+54
| | | | | | in python & java) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592895 13f79535-47bb-0310-9956-ffa450edef68
* Fix to QPID-640. The fields actually set/encoded are now tracked explicitly.Gordon Sim2007-11-071-43/+105
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592753 13f79535-47bb-0310-9956-ffa450edef68
* Generate doxygen comments for Session_0_10 using AMQP <doc> elements.Alan Conway2007-10-301-10/+68
| | | | 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-181/+152
| | | | | | | | | | | | | | 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
* Rename client::Session as client::Session_0_10Alan Conway2007-10-291-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@589794 13f79535-47bb-0310-9956-ffa450edef68
* Session resume support in client & broker: Client can resume a sessionAlan Conway2007-10-261-14/+54
| | | | | | | | | | | | | | | | | | | | | | | | | after voluntary suspend() or network failure. Frames lost in network failure are automatically re-transmitted for transparent re-connection. client::Session improvements: - Locking to avoid races between network & user threads. - Replaced client::StateManager with sys::StateMonitor - avoid heap allocation. qpid::Exception clean up: - use QPID_MSG consistently to format exception messages. - throw typed exceptions (in reply_exceptions.h) for AMQP exceptions. - re-throw correct typed exception on client for exceptions from broker. - Removed QpidError.h rubygen/templates/constants.rb: - constants.h: Added FOO_CLASS_ID and FOO_BAR_METHOD_ID constants. - reply_constants.h: Added throwReplyException(code, text) log::Logger: - Fixed shutdown race in Statement::~Initializer() git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@588761 13f79535-47bb-0310-9956-ffa450edef68
* * Summary: generalized Invoker visitor to all *Operations andAlan Conway2007-10-164-115/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | *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
* Enabled packed struct encoding in python, cpp, and java. Also fixed ↵Rafael H. Schloming2007-10-141-22/+27
| | | | | | computation of required byte credit in Message.cpp. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@584474 13f79535-47bb-0310-9956-ffa450edef68
* Fixed compile error.Alan Conway2007-09-281-1/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580417 13f79535-47bb-0310-9956-ffa450edef68
* Missed commit for last checkin.Alan Conway2007-09-281-2/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580413 13f79535-47bb-0310-9956-ffa450edef68
* * src/tests/ClientSessionTest.cpp: Suspend/resume tests.Alan Conway2007-09-281-25/+20
| | | | | | | | | | | | | | | * broker/SessionManager.cpp, broker/SessionHandler.cpp: Implement suspend/resume * client/ScopedAssociation.h, SessionCore.h, SessionHandler.h: Simplified relationships. - Removed ScopedAssociation. - SessionHandler: is now a member of SessionCore. - SessionCore: shared_ptr ownership by Session(s) and ConnectionImpl. - Using framing::FrameHandler interfaces. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580403 13f79535-47bb-0310-9956-ffa450edef68
* Some revisions to rubygen for packed structs and execution header (changes ↵Gordon Sim2007-09-271-27/+135
| | | | | | not yet enabled) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@580094 13f79535-47bb-0310-9956-ffa450edef68
* Start execution mark from -1 (0xFFFFFFFF)Gordon Sim2007-09-261-0/+1
| | | | | | | | Rename ackFrequency as ackBatchSize in Dispatcher git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@579553 13f79535-47bb-0310-9956-ffa450edef68
* * rubygen/templates/Proxy.rb, src/qpid/framing/Proxy.cpp, Proxy.h:Alan Conway2007-09-181-15/+10
| | | | | | | | | | | | Drop ChannelAdapter, construct Proxy from FrameHandler. * src/qpid/framing/amqp_types.h: Added missing decl for class Uuid. * src/qpid/broker/HandlerImpl.h, src/qpid/broker/ConnectionAdapter.cpp: Fix Proxy constructor calls * src/qpid/framing/AMQFrame.h (class AMQFrame): construct from AMQBody only. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@576963 13f79535-47bb-0310-9956-ffa450edef68
* In ClientChannel: Use subscribe and flush in place of get; use ↵Gordon Sim2007-09-121-1/+1
| | | | | | | | | | per-subscriber flow control for managing prefetches. In brokers Session: set credit to 0 when subscription is created (modified python tests accordingly) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@574979 13f79535-47bb-0310-9956-ffa450edef68
* Moved old ClientChannel class from using basic to using message for publish ↵Gordon Sim2007-09-111-0/+3
| | | | | | | | | | & consume. (Get and qos still use the basic class's defintions, that will be changed next) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@574551 13f79535-47bb-0310-9956-ffa450edef68
* Support for keyword args in session interfaceGordon Sim2007-09-101-9/+71
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@574323 13f79535-47bb-0310-9956-ffa450edef68
* Implementation of execution.result on the client side Gordon Sim2007-09-062-37/+39
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@573359 13f79535-47bb-0310-9956-ffa450edef68
* * Summary:Alan Conway2007-08-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | - Moved BrokerChannel functionality into Session. - Moved ChannelHandler methods handling into SessionAdapter. - Updated all handlers to use session. (We're still using AMQP channel methods in SessionAdapter) Roles & responsibilities: Session: - represents an _open_ session, may be active or suspended. - ows all session state including handler chains. - attahced to SessionAdapter when active, not when suspended. SessionAdapter: - reprents the association of a channel with a session. - owned by Connection, kept in the session map. - channel open == SessionAdapter.getSessio() != 0 Anything that depends on attachment to a channel, connection or protocol should be in SessionAdpater. Anything that suvives a session suspend belongs in Session. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@571575 13f79535-47bb-0310-9956-ffa450edef68
* Fix compile errors in generated code.Alan Conway2007-08-302-4/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@571347 13f79535-47bb-0310-9956-ffa450edef68
* * rubygen/cppgen.rb: Use class Uuid for AMQP uuids.Alan Conway2007-08-291-2/+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
* Generate constants and reply exceptions from spec constants.Alan Conway2007-08-282-3/+42
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@570540 13f79535-47bb-0310-9956-ffa450edef68
* Updated message.transfer encoding to use header and content segments ↵Gordon Sim2007-08-284-15/+27
| | | | | | | | | | (including new structs). Unified more between the basic and message classes messages. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@570538 13f79535-47bb-0310-9956-ffa450edef68
* * src/qpid/framing/FrameDefaultVisitor.h:Alan Conway2007-08-271-0/+34
| | | | | | | | | | | | | | | 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-1/+1
| | | | | | | * 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-279-81/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reapply rev 568249 with the changes made to the generator this time, rather ↵Gordon Sim2007-08-222-41/+2
| | | | | | than the generated file itself. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568517 13f79535-47bb-0310-9956-ffa450edef68
* Undo revision 568249, causing tests to hang.Alan Conway2007-08-211-0/+39
| | | | | | | | | | | | | ------------------------------------------------------------------------ r568249 | gsim | 2007-08-21 16:11:20 -0400 (Tue, 21 Aug 2007) | 3 lines Invocation now uses the visitor mechanism ------------------------------------------------------------------------ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568298 13f79535-47bb-0310-9956-ffa450edef68
* Invocation now uses the visitor mechanismGordon Sim2007-08-211-39/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568249 13f79535-47bb-0310-9956-ffa450edef68
* Refresh of transitional xml to more closely reflect latest specificationGordon Sim2007-08-214-3/+561
| | | | | | | | | 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
* * Fixes for code generation.Alan Conway2007-08-172-101/+0
| | | | | | | | | | - Generate make fragments in $(srcdir) to fix VPATH builds. - rubygen: generates its own .mk fragment - rubygen: moved template info from Makefile.am to generated rubygen.mk, fixes circular dependency between Makefile and rubygen.mk - removed unused templates. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@567072 13f79535-47bb-0310-9956-ffa450edef68
* rubygen/templates/Session.rb: apply fixes that were mistakenly made to the ↵Alan Conway2007-08-161-1/+1
| | | | | | generated file. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@566831 13f79535-47bb-0310-9956-ffa450edef68
* AMQBodies are no longer allocated on the heap and passed with shared_ptr.Alan Conway2007-08-165-12/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Altered old client channel to use new generated session interface (primarily ↵Gordon Sim2007-08-151-5/+17
| | | | | | to reduce the number of places where method bodies are constructed). git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@566274 13f79535-47bb-0310-9956-ffa450edef68
* Removed unused types: RequestId, ResponseId, MethodContext.Alan Conway2007-08-141-99/+43
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@565821 13f79535-47bb-0310-9956-ffa450edef68
* Fix unused argument warning.Alan Conway2007-08-101-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@564449 13f79535-47bb-0310-9956-ffa450edef68
* * src/qpid/framing/MethodHolder.h, .cpp:Alan Conway2007-08-091-0/+67
| | | | | | | | | | | 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-095-23/+23
| | | | | | | | - 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-0/+141
| | | | 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-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+136
| | | | | | | | | 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
* Generate boost::variants for each class. Not yet used on trunk.Alan Conway2007-08-021-0/+29
| | | | 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/+31
* 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