diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2006-11-10 21:04:43 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2006-11-10 21:04:43 +0000 |
| commit | 3b4121f6d81dd4bbf9658813931bc6791aebf2cd (patch) | |
| tree | c5b428e232846dd5dfc878b4413be079343c02fa /gentools/templ.cpp | |
| parent | 150ef9fa00ab29d7bd65323d3ae62129c8fdd9e1 (diff) | |
| download | qpid-python-3b4121f6d81dd4bbf9658813931bc6791aebf2cd.tar.gz | |
Latest version of gentools. Java AmqpConstants class added which allows in changes in the <constant>
declarations in spec from version to version. C++ AMQP_Constants.h file still incomplete.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@473472 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'gentools/templ.cpp')
| -rw-r--r-- | gentools/templ.cpp/AMQP_ClientOperations.h.tmpl | 23 | ||||
| -rw-r--r-- | gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl | 10 | ||||
| -rw-r--r-- | gentools/templ.cpp/AMQP_ClientProxy.h.tmpl | 19 | ||||
| -rw-r--r-- | gentools/templ.cpp/AMQP_Constants.h.tmpl | 35 | ||||
| -rw-r--r-- | gentools/templ.cpp/AMQP_ServerOperations.h.tmpl | 23 | ||||
| -rw-r--r-- | gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl | 10 | ||||
| -rw-r--r-- | gentools/templ.cpp/AMQP_ServerProxy.h.tmpl | 21 |
7 files changed, 103 insertions, 38 deletions
diff --git a/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl b/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl index b8010896a7..28c9831105 100644 --- a/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl +++ b/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl @@ -26,7 +26,6 @@ #ifndef _AMQP_ClientOperations_ #define _AMQP_ClientOperations_ -#include "AMQP_Constants.h" #include "qpid/framing/FieldTable.h" namespace qpid { @@ -35,20 +34,28 @@ namespace framing { class AMQP_ClientOperations { private: - u_int8_t major; - u_int8_t minor; + ProtocolVersion version; public: - AMQP_ClientOperations(u_int8_t major, u_int8_t minor) : major(major), minor(minor) {} + AMQP_ClientOperations(u_int8_t major, u_int8_t minor) : version(major, minor) {} + AMQP_ClientOperations(ProtocolVersion version) : version(version) {} virtual ~AMQP_ClientOperations() {} - inline u_int8_t getMajor() { return major; } - inline u_int8_t getMinor() { return minor; } - inline isVersion(u_int8_t _major, u_int8_t _minor) + inline u_int8_t getMajor() const { return version.getMajor(); } + inline u_int8_t getMinor() const { return version.getMinor(); } + inline const ProtocolVersion& getVersion() const { return version; } + inline isVersion(u_int8_t _major, u_int8_t _minor) const { - return major == _major && minor == _minor; + return version.equals(_major, _minor); + } + inline isVersion(ProtocolVersion& _version) const + { + return version.equals(_version); } + // Include framing constant declarations + #include "AMQP_Constants.h" + // Method handler get methods %{CLIST} ${coh_method_handler_get_method} diff --git a/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl b/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl index 7ecd3e0a7e..69c7fd6840 100644 --- a/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl +++ b/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl @@ -23,23 +23,23 @@ %{VLIST} * ${major}-${minor} */ +#include <sstream> #include "AMQP_ClientProxy.h" namespace qpid { namespace framing { -AMQP_ClientProxy::AMQP_ClientProxy(OutputHandler* _out) : - out(_out) -{CLIST} {cpc_constructor_initializer} +AMQP_ClientProxy::AMQP_ClientProxy(OutputHandler* out, u_int8_t major, u_int8_t minor) : +%{CLIST} ${cpc_constructor_initializer} {} // Inner class instance get methods -{CLIST} {cpc_inner_class_get_method} +%{CLIST} ${cpc_inner_class_get_method} // Inner class implementation -{CLIST} {cpc_inner_class_impl} +%{CLIST} ${cpc_inner_class_impl} } /* namespace framing */ } /* namespace qpid */ diff --git a/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl b/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl index 82ba5391d5..15610ad438 100644 --- a/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl +++ b/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl @@ -35,17 +35,26 @@ namespace framing { class AMQP_ClientProxy : virtual public AMQP_ClientOperations { - public: - AMQP_ClientProxy(OutputHandler* _out); - virtual ~AMQP_ClientProxy() {}; +private: + OutputHandler* out; + u_int8_t major; + u_int8_t minor; // Inner class instances -{CLIST} {cph_inner_class_get_method} +%{CLIST} ${cph_inner_class_instance} + +public: + AMQP_ClientProxy(OutputHandler* out, u_int8_t major, u_int8_t minor); + virtual ~AMQP_ClientProxy() {} + + // Inner class instance get methods + +%{CLIST} ${cph_inner_class_get_method} // Inner class definitions -{CLIST} {cph_inner_class_impl} +%{CLIST} ${cph_inner_class_defn} }; /* class AMQP_ClientProxy */ diff --git a/gentools/templ.cpp/AMQP_Constants.h.tmpl b/gentools/templ.cpp/AMQP_Constants.h.tmpl new file mode 100644 index 0000000000..7b7ba9f27b --- /dev/null +++ b/gentools/templ.cpp/AMQP_Constants.h.tmpl @@ -0,0 +1,35 @@ +&{AMQP_Constants.h} +/** +* +* Copyright (c) 2006 The Apache Software Foundation +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*/ + +/* + * This file is auto-generated by ${GENERATOR} - do not modify. + * Supported AMQP versions: +%{VLIST} * ${major}-${minor} + */ + // NOTE: This file is intended to be included within the class structure of both + // the client and server operations classes. + + // Constant declarations for constants that change by version + +%{TLIST} ${ch_static_const_decl} + + // Constant getValue methods + +%{TLIST} ${ch_get_value_method} +
\ No newline at end of file diff --git a/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl b/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl index b1d1c98b25..b600979047 100644 --- a/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl +++ b/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl @@ -26,7 +26,6 @@ #ifndef _AMQP_ServerOperations_ #define _AMQP_ServerOperations_ -#include "AMQP_Constants.h" #include "qpid/framing/FieldTable.h" namespace qpid { @@ -35,19 +34,27 @@ namespace framing { class AMQP_ServerOperations { private: - u_int8_t major; - u_int8_t minor; + ProtocolVersion version; public: - AMQP_ServerOperations(u_int8_t major, u_int8_t minor) : major(major), minor(minor) {} + AMQP_ServerOperations(u_int8_t major, u_int8_t minor) : version(major, minor) {} + AMQP_ServerOperations(ProtocolVersion version) : version(version) {} virtual ~AMQP_ServerOperations() {} - inline u_int8_t getMajor() { return major; } - inline u_int8_t getMinor() { return minor; } - inline isVersion(u_int8_t _major, u_int8_t _minor) + inline u_int8_t getMajor() const { return version.getMajor(); } + inline u_int8_t getMinor() const { return version.getMinor(); } + inline const ProtocolVersion& getVersion() const { return version; } + inline isVersion(u_int8_t _major, u_int8_t _minor) const { - return major == _major && minor == _minor; + return version.equals(_major, _minor); } + inline isVersion(ProtocolVersion& _version) const + { + return version.equals(_version); + } + + // Include framing constant declarations + #include "AMQP_Constants.h" // Method handler get methods diff --git a/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl b/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl index 8996f4a41c..0855bc2026 100644 --- a/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl +++ b/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl @@ -23,23 +23,23 @@ %{VLIST} * ${major}-${minor} */ +#include <sstream> #include "AMQP_ServerProxy.h" namespace qpid { namespace framing { -AMQP_ServerProxy::AMQP_ServerProxy(OutputHandler* _out) : - out(_out) -{CLIST} {spc_constructor_initializer} +AMQP_ServerProxy::AMQP_ServerProxy(OutputHandler* out, u_int8_t major, u_int8_t minor) : +%{CLIST} ${spc_constructor_initializer} {} // Inner class instance get methods -{CLIST} {spc_inner_class_get_method} +%{CLIST} ${spc_inner_class_get_method} // Inner class implementation -{CLIST} {spc_inner_class_impl} +%{CLIST} ${spc_inner_class_impl} } /* namespace framing */ } /* namespace qpid */ diff --git a/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl b/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl index a1bc3cbc9f..dd72fa17e4 100644 --- a/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl +++ b/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl @@ -35,19 +35,26 @@ namespace framing { class AMQP_ServerProxy : virtual public AMQP_ServerOperations { - OutputHandler* out; - - public: - AMQP_ServerProxy(OutputHandler* _out); - virtual ~AMQP_ServerProxy() {} +private: + OutputHandler* out; + u_int8_t major; + u_int8_t minor; // Inner class instances -{CLIST} {sph_inner_class_get_method} +%{CLIST} ${sph_inner_class_instance} + +public: + AMQP_ServerProxy(OutputHandler* out, u_int8_t major, u_int8_t minor); + virtual ~AMQP_ServerProxy() {} + + // Inner class instance get methods + +%{CLIST} ${sph_inner_class_get_method} // Inner class definitions -{CLIST} {sph_inner_class_impl} +%{CLIST} ${sph_inner_class_defn} }; /* class AMQP_ServerProxy */ |
