summaryrefslogtreecommitdiff
path: root/gentools/templ.cpp
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2006-11-21 19:44:40 +0000
committerKim van der Riet <kpvdr@apache.org>2006-11-21 19:44:40 +0000
commit03b8de17239609c9de5e18e0d59eccdd004067eb (patch)
tree4ac6b915f0983e76deda9691f7b0ac90f8b4fded /gentools/templ.cpp
parent4ac1fb1bc85fbad989deca30410d18eefb727837 (diff)
downloadqpid-python-03b8de17239609c9de5e18e0d59eccdd004067eb.tar.gz
Updates and bugfixes
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@477844 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'gentools/templ.cpp')
-rw-r--r--gentools/templ.cpp/AMQP_ClientHandlerImpl.cpp.tmpl49
-rw-r--r--gentools/templ.cpp/AMQP_ClientHandlerImpl.h.tmpl57
-rw-r--r--gentools/templ.cpp/AMQP_ClientOperations.h.tmpl63
-rw-r--r--gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl45
-rw-r--r--gentools/templ.cpp/AMQP_ClientProxy.h.tmpl69
-rw-r--r--gentools/templ.cpp/AMQP_Constants.h.tmpl42
-rw-r--r--gentools/templ.cpp/AMQP_MethodVersionMap.cpp.tmpl62
-rw-r--r--gentools/templ.cpp/AMQP_MethodVersionMap.h.tmpl58
-rw-r--r--gentools/templ.cpp/AMQP_ServerHandlerImpl.cpp.tmpl49
-rw-r--r--gentools/templ.cpp/AMQP_ServerHandlerImpl.h.tmpl57
-rw-r--r--gentools/templ.cpp/AMQP_ServerOperations.h.tmpl52
-rw-r--r--gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl45
-rw-r--r--gentools/templ.cpp/AMQP_ServerProxy.h.tmpl69
-rw-r--r--gentools/templ.cpp/MethodBodyClass.h.tmpl32
-rw-r--r--gentools/templ.cpp/amqp_methods.cpp.tmpl45
-rw-r--r--gentools/templ.cpp/amqp_methods.h.tmpl44
16 files changed, 335 insertions, 503 deletions
diff --git a/gentools/templ.cpp/AMQP_ClientHandlerImpl.cpp.tmpl b/gentools/templ.cpp/AMQP_ClientHandlerImpl.cpp.tmpl
deleted file mode 100644
index 19dbc24ef0..0000000000
--- a/gentools/templ.cpp/AMQP_ClientHandlerImpl.cpp.tmpl
+++ /dev/null
@@ -1,49 +0,0 @@
-&{AMQP_ClientHandlerImpl.cpp}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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}
- */
-
-#include "AMQP_ClientHandlerImpl.h"
-
-namespace qpid {
-namespace framing {
-
-AMQP_ClientHandlerImpl::AMQP_ClientHandlerImpl()
-{CLIST} {chp_initializers}
-{}
-
-AMQP_ClientHandlerImpl::~AMQP_ClientHandlerImpl()
-{
-{CLIST} {chp_destructor}
-}
-
-// Handler Stubs
-
-{CLIST} {chp_handler_stubs}
-
-} /* namespace framing */
-} /* namespace qpid */
-
diff --git a/gentools/templ.cpp/AMQP_ClientHandlerImpl.h.tmpl b/gentools/templ.cpp/AMQP_ClientHandlerImpl.h.tmpl
deleted file mode 100644
index ee52109bd6..0000000000
--- a/gentools/templ.cpp/AMQP_ClientHandlerImpl.h.tmpl
+++ /dev/null
@@ -1,57 +0,0 @@
-&{AMQP_ClientHandlerImpl.h}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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}
- */
-
-#ifndef _AMQP_ClientHandlerImpl_
-#define _AMQP_ClientHandlerImpl_
-
-#include "AMQP_ClientOperations.h"
-#include "qpid/framing/FieldTable.h"
-
-namespace qpid {
-namespace framing {
-
-class AMQP_ClientHandlerImpl : virtual public AMQP_ClientOperations
-{
-{CLIST} {chh_handler_pointer_declarations}
-
- public:
- AMQP_ClientHandlerImpl();
- virtual ~AMQP_ClientHandlerImpl();
-
-{CLIST} {chh_handler_pointer_get_methods}
-
- // Inner class handler declarations
-
-{CLIST} {shh_class_handler_declarations}
-
-}; /* AMQP_ClientHandlerImpl */
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl b/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl
index eeed9eae5b..4a92c9c422 100644
--- a/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl
+++ b/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl
@@ -1,43 +1,48 @@
&{AMQP_ClientOperations.h}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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.
-*
-*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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}
*/
+
+#include <sstream>
#ifndef _AMQP_ClientOperations_
#define _AMQP_ClientOperations_
-#include "qpid/framing/FieldTable.h"
+#include <qpid/framing/FieldTable.h>
+#include <qpid/framing/ProtocolVersion.h>
+#include <qpid/framing/ProtocolVersionException.h>
namespace qpid {
namespace framing {
class AMQP_ClientOperations
{
-private:
+protected:
ProtocolVersion version;
+ AMQP_ClientOperations() {}
public:
AMQP_ClientOperations(u_int8_t major, u_int8_t minor) : version(major, minor) {}
@@ -47,25 +52,25 @@ public:
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
+ inline bool isVersion(u_int8_t _major, u_int8_t _minor) const
{
return version.equals(_major, _minor);
}
- inline isVersion(ProtocolVersion& _version) const
+ inline bool isVersion(ProtocolVersion& _version) const
{
return version.equals(_version);
}
// Include framing constant declarations
- #include "AMQP_Constants.h"
+ #include <qpid/framing/AMQP_Constants.h>
- // Method handler get methods
-
-%{CLIST} ${coh_method_handler_get_method}
-
// Inner classes
%{CLIST} ${coh_inner_class}
+
+ // Method handler get methods
+
+%{CLIST} ${coh_method_handler_get_method}
}; /* class AMQP_ClientOperations */
diff --git a/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl b/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl
index 11510e588c..fe9e3b0ff1 100644
--- a/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl
+++ b/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl
@@ -1,24 +1,24 @@
&{AMQP_ClientProxy.cpp}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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.
-*
-*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
@@ -27,7 +27,10 @@
*/
#include <sstream>
-#include "AMQP_ClientProxy.h"
+
+#include <qpid/framing/AMQP_ClientProxy.h>
+#include <qpid/framing/AMQFrame.h>
+%{MLIST} ${cpc_method_body_include}
namespace qpid {
namespace framing {
diff --git a/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl b/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl
index 4caa53fb3f..48e2468674 100644
--- a/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl
+++ b/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl
@@ -1,24 +1,24 @@
&{AMQP_ClientProxy.h}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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.
-*
-*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
@@ -29,9 +29,9 @@
#ifndef _AMQP_ClientProxy_
#define _AMQP_ClientProxy_
-#include "AMQP_ClientOperations.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/OutputHandler.h"
+#include <qpid/framing/AMQP_ClientOperations.h>
+#include <qpid/framing/FieldTable.h>
+#include <qpid/framing/OutputHandler.h>
namespace qpid {
namespace framing {
@@ -40,24 +40,29 @@ class AMQP_ClientProxy : virtual public AMQP_ClientOperations
{
private:
OutputHandler* out;
- u_int8_t major;
- u_int8_t minor;
-
- // Inner class instances
-
-%{CLIST} ${cph_inner_class_instance}
+%{CLIST} ${cph_handler_pointer_defn}
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}
+ // Get methods for handlers
+
+%{CLIST} ${cph_handler_pointer_get_method}
// Inner class definitions
%{CLIST} ${cph_inner_class_defn}
+
+private:
+ // Inner class instances
+
+%{CLIST} ${cph_inner_class_instance}
+
+public:
+ // Inner class instance get methods
+
+%{CLIST} ${cph_inner_class_get_method}
}; /* class AMQP_ClientProxy */
diff --git a/gentools/templ.cpp/AMQP_Constants.h.tmpl b/gentools/templ.cpp/AMQP_Constants.h.tmpl
index c60407b014..4631bc8de6 100644
--- a/gentools/templ.cpp/AMQP_Constants.h.tmpl
+++ b/gentools/templ.cpp/AMQP_Constants.h.tmpl
@@ -1,24 +1,24 @@
&{AMQP_Constants.h}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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.
-*
-*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
@@ -26,7 +26,7 @@
%{VLIST} * ${major}-${minor}
*/
// NOTE: This file is intended to be included within the class structure of both
- // the client and server operations classes.
+ // the client and server operations classes. These need to have <sstream> included.
// Constant getValue methods
diff --git a/gentools/templ.cpp/AMQP_MethodVersionMap.cpp.tmpl b/gentools/templ.cpp/AMQP_MethodVersionMap.cpp.tmpl
new file mode 100644
index 0000000000..4741fed638
--- /dev/null
+++ b/gentools/templ.cpp/AMQP_MethodVersionMap.cpp.tmpl
@@ -0,0 +1,62 @@
+&{AMQP_MethodVersionMap.cpp}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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}
+ */
+
+#include <sstream>
+
+#include <qpid/framing/AMQP_MethodVersionMap.h>
+
+namespace qpid
+{
+namespace framing
+{
+
+AMQP_MethodVersionMap::AMQP_MethodVersionMap(u_int8_t major, u_int8_t minor): version(major, minor)
+{
+%{CLIST} ${mc_create_method_body_map_entry}
+}
+
+AMQMethodBody* AMQP_MethodVersionMap::createMethodBody(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor)
+{
+ iterator itr = find(createMapKey(classId, methodId, major, minor));
+ if (itr == end())
+ {
+ std::stringstream ss;
+ ss << "Unable to find MethodBody class for classId = " << classId << ", methodId = " <<
+ methodId << ", AMQ protocol version = " << major << "-" << minor << ".";
+ throw ProtocolVersionException(ss.str());
+ }
+ return (itr->second)(major, minor);
+}
+
+u_int64_t AMQP_MethodVersionMap::createMapKey(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor)
+{
+ return ((u_int64_t)classId<<48) + ((u_int64_t)methodId<<32) + ((u_int64_t)major<<16) + minor;
+}
+
+} /* namespace framing */
+} /* namespace qpid */
diff --git a/gentools/templ.cpp/AMQP_MethodVersionMap.h.tmpl b/gentools/templ.cpp/AMQP_MethodVersionMap.h.tmpl
new file mode 100644
index 0000000000..6b1418def5
--- /dev/null
+++ b/gentools/templ.cpp/AMQP_MethodVersionMap.h.tmpl
@@ -0,0 +1,58 @@
+&{AMQP_MethodVersionMap.h}
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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}
+ */
+
+#ifndef _METHOD_VERSION_MAP_H_
+#define _METHOD_VERSION_MAP_H_
+
+#include <map>
+#include <qpid/framing/AMQMethodBody.h>
+
+%{MLIST} ${mc_method_body_include}
+
+namespace qpid
+{
+namespace framing
+{
+
+template <class T> AMQMethodBody* createMethodBodyFn(u_int8_t major, u_int8_t minor) { return new T(major, minor); }
+typedef AMQMethodBody* (*fnPtr)(u_int8_t, u_int8_t);
+
+class AMQP_MethodVersionMap: public std::map<u_int64_t, fnPtr>
+{
+protected:
+ ProtocolVersion version;
+ u_int64_t createMapKey(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor);
+public:
+ AMQP_MethodVersionMap(u_int8_t major, u_int8_t minor);
+ AMQMethodBody* createMethodBody(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor);
+};
+
+} /* namespace framing */
+} /* namespace qpid */
+
+#endif
diff --git a/gentools/templ.cpp/AMQP_ServerHandlerImpl.cpp.tmpl b/gentools/templ.cpp/AMQP_ServerHandlerImpl.cpp.tmpl
deleted file mode 100644
index 54468cfb49..0000000000
--- a/gentools/templ.cpp/AMQP_ServerHandlerImpl.cpp.tmpl
+++ /dev/null
@@ -1,49 +0,0 @@
-&{AMQP_ServerHandlerImpl.cpp}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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}
- */
-
-#include "AMQP_ServerHandlerImpl.h"
-
-namespace qpid {
-namespace framing {
-
-AMQP_ServerHandlerImpl::AMQP_ServerHandlerImpl()
-{CLIST} {shp_initializers}
-{}
-
-AMQP_ServerHandlerImpl::~AMQP_ServerHandlerImpl()
-{
-{CLIST} {shp_destructor}
-}
-
-// Handler Stubs
-
-{CLIST} {shp_handler_stubs}
-
-} /* namespace framing */
-} /* namespace qpid */
-
diff --git a/gentools/templ.cpp/AMQP_ServerHandlerImpl.h.tmpl b/gentools/templ.cpp/AMQP_ServerHandlerImpl.h.tmpl
deleted file mode 100644
index 75d47c4f93..0000000000
--- a/gentools/templ.cpp/AMQP_ServerHandlerImpl.h.tmpl
+++ /dev/null
@@ -1,57 +0,0 @@
-&{AMQP_ServerHandlerImpl.h}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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}
- */
-
-#ifndef _AMQP_ServerHandlerImpl_
-#define _AMQP_ServerHandlerImpl_
-
-#include "AMQP_ServerOperations.h"
-#include "qpid/framing/FieldTable.h"
-
-namespace qpid {
-namespace framing {
-
-class AMQP_ServerHandlerImpl : virtual public AMQP_ServerOperations
-{
-{CLIST} {shh_handler_pointer_declarations}
-
- public:
- AMQP_ServerHandlerImpl();
- virtual ~AMQP_ServerHandlerImpl();
-
-{CLIST} {chh_handler_pointer_get_methods}
-
- // Inner class handler declarations
-
-{CLIST} {shh_class_handler_declarations}
-
-}; /* AMQP_ServerHandlerImpl */
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl b/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl
index eed4d7960f..7953e5be21 100644
--- a/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl
+++ b/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl
@@ -1,24 +1,24 @@
&{AMQP_ServerOperations.h}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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.
-*
-*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
@@ -29,18 +29,20 @@
#ifndef _AMQP_ServerOperations_
#define _AMQP_ServerOperations_
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/framing/ProtocolVersionException.h"
#include <sstream>
+#include <qpid/framing/FieldTable.h>
+#include <qpid/framing/ProtocolVersion.h>
+#include <qpid/framing/ProtocolVersionException.h>
+
namespace qpid {
namespace framing {
class AMQP_ServerOperations
{
-private:
+protected:
ProtocolVersion version;
+ AMQP_ServerOperations() {}
public:
AMQP_ServerOperations(u_int8_t major, u_int8_t minor) : version(major, minor) {}
@@ -60,7 +62,7 @@ public:
}
// Include framing constant declarations
- #include "AMQP_Constants.h"
+ #include <qpid/framing/AMQP_Constants.h>
// Inner classes
diff --git a/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl b/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl
index 65f42f54e6..3bf043c51d 100644
--- a/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl
+++ b/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl
@@ -1,24 +1,24 @@
&{AMQP_ServerProxy.cpp}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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.
-*
-*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
@@ -27,7 +27,10 @@
*/
#include <sstream>
-#include "AMQP_ServerProxy.h"
+
+#include <qpid/framing/AMQP_ServerProxy.h>
+#include <qpid/framing/AMQFrame.h>
+%{MLIST} ${spc_method_body_include}
namespace qpid {
namespace framing {
diff --git a/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl b/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl
index 6de12fef2d..33773116e3 100644
--- a/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl
+++ b/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl
@@ -1,24 +1,24 @@
&{AMQP_ServerProxy.h}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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.
-*
-*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
@@ -29,9 +29,9 @@
#ifndef _AMQP_ServerProxy_
#define _AMQP_ServerProxy_
-#include "AMQP_ServerOperations.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/OutputHandler.h"
+#include <qpid/framing/AMQP_ServerOperations.h>
+#include <qpid/framing/FieldTable.h>
+#include <qpid/framing/OutputHandler.h>
namespace qpid {
namespace framing {
@@ -40,25 +40,30 @@ class AMQP_ServerProxy : virtual public AMQP_ServerOperations
{
private:
OutputHandler* out;
- u_int8_t major;
- u_int8_t minor;
-
- // Inner class instances
-
-%{CLIST} ${sph_inner_class_instance}
+%{CLIST} ${sph_handler_pointer_defn}
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}
+ // Get methods for handlers
+
+%{CLIST} ${sph_handler_pointer_get_method}
// Inner class definitions
%{CLIST} ${sph_inner_class_defn}
+private:
+ // Inner class instances
+
+%{CLIST} ${sph_inner_class_instance}
+
+public:
+ // Inner class instance get methods
+
+%{CLIST} ${sph_inner_class_get_method}
+
}; /* class AMQP_ServerProxy */
} /* namespace framing */
diff --git a/gentools/templ.cpp/MethodBodyClass.h.tmpl b/gentools/templ.cpp/MethodBodyClass.h.tmpl
index 5d68ac4f2d..2a562cadcf 100644
--- a/gentools/templ.cpp/MethodBodyClass.h.tmpl
+++ b/gentools/templ.cpp/MethodBodyClass.h.tmpl
@@ -26,15 +26,13 @@
%{VLIST} * ${major}-${minor}
*/
-#include <map>
#include <string>
#include <sstream>
-#include "qpid/framing/amqp_types.h"
-#include "AMQP_ServerOperations.h"
-#include "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/framing/FieldTable.h"
+#include <qpid/framing/amqp_types.h>
+#include <qpid/framing/AMQMethodBody.h>
+#include <qpid/framing/Buffer.h>
+#include <qpid/framing/FieldTable.h>
#ifndef _${CLASS}${METHOD}Body_
#define _${CLASS}${METHOD}Body_
@@ -56,15 +54,11 @@ public:
typedef boost::shared_ptr<${CLASS}${METHOD}Body> shared_ptr;
// Constructors and destructors
-
- inline ${CLASS}${METHOD}Body(
-%{FLIST} ${mb_field_list_declare}
- ) :
-%{FLIST} ${mb_field_list_initializer}
- {}
- inline ${CLASS}${METHOD}Body() {}
+${mb_constructor_with_initializers}
+ inline ${CLASS}${METHOD}Body(u_int8_t major, u_int8_t minor): AMQMethodBody(major, minor) {}
+ inline ${CLASS}${METHOD}Body(ProtocolVersion version): AMQMethodBody(version) {}
virtual ~${CLASS}${METHOD}Body() {}
// Attribute get methods
@@ -96,22 +90,18 @@ public:
return size;
}
- inline void encodeContent(Buffer& buffer) const
+ inline void encodeContent(Buffer&${mb_buffer_param}) const
{
%{FLIST} ${mb_encode}
}
- inline void decodeContent(Buffer& buffer)
+ inline void decodeContent(Buffer&${mb_buffer_param})
{
%{FLIST} ${mb_decode}
}
- inline void invoke(AMQP_ServerOperations& target, u_int16_t channel)
- {
- target.getBasicHandler()->publish(channel,
-%{FLIST} ${mb_field_list}
- );
- }
+${mb_server_operation_invoke}
+
}; // class ${CLASS}${METHOD}Body
${version_namespace_end}
diff --git a/gentools/templ.cpp/amqp_methods.cpp.tmpl b/gentools/templ.cpp/amqp_methods.cpp.tmpl
deleted file mode 100644
index 947a2fd47e..0000000000
--- a/gentools/templ.cpp/amqp_methods.cpp.tmpl
+++ /dev/null
@@ -1,45 +0,0 @@
-&{amqp_methods.cpp}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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}
- */
-
-#include "amqp_methods.h"
-#include "qpid/QpidError.h"
-
-namespace qpid {
-namespace framing {
-
-AMQMethodBody* createAMQMethodBody(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor)
-{
- switch(classId * 1000 + methodId)
- {
-{MLIST} {m_create_method_body_class}
- }
- THROW_QPID_ERROR(FRAMING_ERROR, "Unknown method");
-} /* createAMQMethodBody() */
-
-} /* namespace framing */
-} /* namespace qpid */
diff --git a/gentools/templ.cpp/amqp_methods.h.tmpl b/gentools/templ.cpp/amqp_methods.h.tmpl
deleted file mode 100644
index 6668cf584c..0000000000
--- a/gentools/templ.cpp/amqp_methods.h.tmpl
+++ /dev/null
@@ -1,44 +0,0 @@
-&{amqp_methods.h}
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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}
- */
-
-#ifndef AMQ_METHODS_H
-#define AMQ_METHODS_H
-
-{MLIST} {m_method_body_class_indlude}
-
-namespace qpid {
-namespace framing {
-
-{MLIST} {m_method_body_class_instance}
-
-AMQMethodBody* createAMQMethodBody(u_int16_t classId, u_int16_t methodId);
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif