From 6bf200b4a953e3e7ae521c1e269e420af7e52cba Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 27 Feb 2008 21:49:04 +0000 Subject: Generating domains, structs, commands and controls for 0-10 final spec. Not yet generating: holders, visitors. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@631740 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/Makefile.am | 2 ++ cpp/src/qpid/amqp_0_10/helpers.h | 32 +++++++------------------------- 2 files changed, 9 insertions(+), 25 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am index 0a63ce1b90..e3b95e045f 100644 --- a/cpp/src/Makefile.am +++ b/cpp/src/Makefile.am @@ -103,6 +103,7 @@ libqpidcommon_la_LIBADD = \ libqpidcommon_la_SOURCES = \ $(rgen_common_cpp) \ $(platform_src) \ + qpid/amqp_0_10/helpers.cpp \ qpid/Serializer.h \ qpid/amqp_0_10/built_in_types.h \ qpid/amqp_0_10/Codec.h \ @@ -251,6 +252,7 @@ libqpidclient_la_SOURCES = \ nobase_include_HEADERS = \ $(platform_hdr) \ + qpid/amqp_0_10/helpers.h \ qpid/assert.h \ qpid/DataDir.h \ qpid/Exception.h \ diff --git a/cpp/src/qpid/amqp_0_10/helpers.h b/cpp/src/qpid/amqp_0_10/helpers.h index c916a3e869..1769d374d9 100644 --- a/cpp/src/qpid/amqp_0_10/helpers.h +++ b/cpp/src/qpid/amqp_0_10/helpers.h @@ -27,46 +27,28 @@ namespace qpid { namespace amqp_0_10 { -/** Static information about an AMQP class */ -struct ClassInfo { uint8_t code; const char* name; }; - -/** Info about a class memeber - command, control or struct */ -struct MemberInfo { - ClassInfo* class_; // 0 for top level struct. - - const char* name; - uint8_t code; - std::string fullName() const { - return std::string(class_->name)+"."+name; - } -}; - -/** Info about a struct */ -struct StructInfo : public MemberInfo { uint8_t size, pack; }; - -// Look up info by code. -const ClassInfo& getClassInfo(uint8_t code); -const MemberInfo& getCommandInfo(uint8_t classCode, uint8_t code); -const MemberInfo& getControlInfo(uint8_t classCode, uint8_t code); -const StructInfo& getStructInfo(uint8_t classCode, uint8_t code); +// Look up names by code +const char* getClassName(uint8_t code); +const char* getCommandName(uint8_t classCode, uint8_t code); +const char* getControlName(uint8_t classCode, uint8_t code); +const char* getStructName(uint8_t classCode, uint8_t code); struct Command { virtual ~Command(); class Visitor; - virtual const MemberInfo& info() const = 0; virtual void accept(Visitor&) const = 0; }; struct Control { virtual ~Control(); class Visitor; - virtual const MemberInfo& info() const = 0; virtual void accept(Visitor&) const = 0; }; struct Struct { virtual ~Struct(); - virtual const StructInfo& info() const = 0; + class Visitor; + virtual void accept(Visitor&) const = 0; }; /** Base class for generated enum domains. -- cgit v1.2.1