summaryrefslogtreecommitdiff
path: root/cpp/managementgen/qmf
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-09-05 16:07:57 +0000
committerTed Ross <tross@apache.org>2008-09-05 16:07:57 +0000
commitb2b3d97bca484ea0b4733bdc7d65d1333262805b (patch)
tree4517a6c0d7720f4272d0e4d04f536c132d6e3fbd /cpp/managementgen/qmf
parent39f08c0cfe58f98f51cbfbfa1210f7cce2c23bc9 (diff)
downloadqpid-python-b2b3d97bca484ea0b4733bdc7d65d1333262805b.tar.gz
QPID-1274 - Moved management-gen data files into the qmf subdirectory to fix an install problem
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@692475 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/managementgen/qmf')
-rwxr-xr-xcpp/managementgen/qmf/generate.py4
-rw-r--r--cpp/managementgen/qmf/management-types.xml56
-rw-r--r--cpp/managementgen/qmf/templates/Args.h40
-rw-r--r--cpp/managementgen/qmf/templates/Class.cpp180
-rw-r--r--cpp/managementgen/qmf/templates/Class.h106
-rw-r--r--cpp/managementgen/qmf/templates/Makefile.mk37
-rw-r--r--cpp/managementgen/qmf/templates/Package.cpp32
-rw-r--r--cpp/managementgen/qmf/templates/Package.h41
8 files changed, 494 insertions, 2 deletions
diff --git a/cpp/managementgen/qmf/generate.py b/cpp/managementgen/qmf/generate.py
index c1edf0b8e2..70735b208a 100755
--- a/cpp/managementgen/qmf/generate.py
+++ b/cpp/managementgen/qmf/generate.py
@@ -110,7 +110,7 @@ class Makefile:
stream.write (mdir + "/qmf-gen \\\n")
stream.write (" " + mdir + "/qmf/generate.py \\\n")
stream.write (" " + mdir + "/qmf/schema.py \\\n")
- stream.write (" " + mdir + "/management-types.xml \\\n")
+ stream.write (" " + mdir + "/qmf/management-types.xml \\\n")
stream.write (" " + sdir + "/management-schema.xml \\\n")
first = True
for template in self.templateFiles:
@@ -119,7 +119,7 @@ class Makefile:
stream.write (" ")
else:
stream.write (" \\\n ")
- stream.write (mdir + "/templates/" + template)
+ stream.write (mdir + "/qmf/templates/" + template)
def genGenCppFiles (self, stream, variables):
first = True
diff --git a/cpp/managementgen/qmf/management-types.xml b/cpp/managementgen/qmf/management-types.xml
new file mode 100644
index 0000000000..31337b23bc
--- /dev/null
+++ b/cpp/managementgen/qmf/management-types.xml
@@ -0,0 +1,56 @@
+<schema-types>
+
+<!--
+ 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.
+-->
+
+<type name="objId" base="REF" cpp="ObjectId" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" init="0"/>
+<type name="uint8" base="U8" cpp="uint8_t" encode="@.putOctet(#)" decode="# = @.getOctet()" accessor="direct" init="0"/>
+<type name="uint16" base="U16" cpp="uint16_t" encode="@.putShort(#)" decode="# = @.getShort()" accessor="direct" init="0"/>
+<type name="uint32" base="U32" cpp="uint32_t" encode="@.putLong(#)" decode="# = @.getLong()" accessor="direct" init="0"/>
+<type name="uint64" base="U64" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" accessor="direct" init="0"/>
+<type name="int8" base="S8" cpp="int8_t" encode="@.putInt8(#)" decode="# = @.getInt8()" accessor="direct" init="0"/>
+<type name="int16" base="S16" cpp="int16_t" encode="@.putInt16(#)" decode="# = @.getInt16()" accessor="direct" init="0"/>
+<type name="int32" base="S32" cpp="int32_t" encode="@.putInt32(#)" decode="# = @.getInt32()" accessor="direct" init="0"/>
+<type name="int64" base="S64" cpp="int64_t" encode="@.putInt64(#)" decode="# = @.getInt64()" accessor="direct" init="0"/>
+<type name="bool" base="BOOL" cpp="uint8_t" encode="@.putOctet(#?1:0)" decode="# = @.getOctet()==1" accessor="direct" init="0"/>
+<type name="sstr" base="SSTR" cpp="std::string" encode="@.putShortString(#)" decode="@.getShortString(#)" accessor="direct" init='""'/>
+<type name="lstr" base="LSTR" cpp="std::string" encode="@.putLongString(#)" decode="@.getLongString(#)" accessor="direct" init='""'/>
+<type name="absTime" base="ABSTIME" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" accessor="direct" init="0"/>
+<type name="deltaTime" base="DELTATIME" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" accessor="direct" init="0"/>
+<type name="float" base="FLOAT" cpp="float" encode="@.putFloat(#)" decode="# = @.getFloat()" accessor="direct" init="0."/>
+<type name="double" base="DOUBLE" cpp="double" encode="@.putDouble(#)" decode="# = @.getDouble()" accessor="direct" init="0."/>
+<type name="uuid" base="UUID" cpp="framing::Uuid" encode="#.encode(@)" decode="#.decode(@)" accessor="direct"/>
+<type name="map" base="FTABLE" cpp="framing::FieldTable" encode="#.encode(@)" decode="#.decode(@)" accessor="direct"/>
+
+<type name="hilo8" base="U8" cpp="uint8_t" encode="@.putOctet(#)" decode="# = @.getOctet()" style="wm" accessor="counter" init="0"/>
+<type name="hilo16" base="U16" cpp="uint16_t" encode="@.putShort(#)" decode="# = @.getShort()" style="wm" accessor="counter" init="0"/>
+<type name="hilo32" base="U32" cpp="uint32_t" encode="@.putLong(#)" decode="# = @.getLong()" style="wm" accessor="counter" init="0"/>
+<type name="hilo64" base="U64" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" style="wm" accessor="counter" init="0"/>
+
+<type name="count8" base="U8" cpp="uint8_t" encode="@.putOctet(#)" decode="# = @.getOctet()" accessor="counter" init="0" perThread="y"/>
+<type name="count16" base="U16" cpp="uint16_t" encode="@.putShort(#)" decode="# = @.getShort()" accessor="counter" init="0" perThread="y"/>
+<type name="count32" base="U32" cpp="uint32_t" encode="@.putLong(#)" decode="# = @.getLong()" accessor="counter" init="0" perThread="y"/>
+<type name="count64" base="U64" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" accessor="counter" init="0" perThread="y"/>
+
+<!-- Min/Max/Average statistics -->
+<type name="mma32" base="U32" cpp="uint32_t" encode="@.putLong(#)" decode="# = @.getLong()" style="mma" accessor="direct" init="0" perThread="y"/>
+<type name="mma64" base="U64" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" style="mma" accessor="direct" init="0" perThread="y"/>
+<type name="mmaTime" base="DELTATIME" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" style="mma" accessor="direct" init="0" perThread="y"/>
+
+</schema-types>
diff --git a/cpp/managementgen/qmf/templates/Args.h b/cpp/managementgen/qmf/templates/Args.h
new file mode 100644
index 0000000000..576d891a3f
--- /dev/null
+++ b/cpp/managementgen/qmf/templates/Args.h
@@ -0,0 +1,40 @@
+/*MGEN:commentPrefix=//*/
+#ifndef _ARGS_/*MGEN:Method.NameUpper*/_
+#define _ARGS_/*MGEN:Method.NameUpper*/_
+
+//
+// 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.
+//
+
+/*MGEN:Root.Disclaimer*/
+
+#include "qpid/management/Args.h"
+#include <string>
+
+namespace qpid {
+namespace management {
+
+class Args/*MGEN:Method.NameCamel*/ : public Args
+{
+ public:
+/*MGEN:Method.Arguments*/
+};
+
+}}
+
+#endif /*!_ARGS_/*MGEN:Method.NameUpper*/_*/
diff --git a/cpp/managementgen/qmf/templates/Class.cpp b/cpp/managementgen/qmf/templates/Class.cpp
new file mode 100644
index 0000000000..2a0e55b34d
--- /dev/null
+++ b/cpp/managementgen/qmf/templates/Class.cpp
@@ -0,0 +1,180 @@
+/*MGEN:commentPrefix=//*/
+//
+// 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.
+//
+
+/*MGEN:Root.Disclaimer*/
+
+#include "qpid/log/Statement.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/management/Manageable.h"
+#include "qpid/agent/ManagementAgent.h"
+#include "/*MGEN:Class.NameCap*/.h"
+/*MGEN:Class.MethodArgIncludes*/
+
+using namespace qpid::management;
+using namespace qpid::sys;
+using namespace qpid::framing;
+using std::string;
+
+string /*MGEN:Class.NameCap*/::packageName = string ("/*MGEN:Class.NamePackageLower*/");
+string /*MGEN:Class.NameCap*/::className = string ("/*MGEN:Class.NameLower*/");
+uint8_t /*MGEN:Class.NameCap*/::md5Sum[16] =
+ {/*MGEN:Class.SchemaMD5*/};
+
+/*MGEN:Class.NameCap*/::/*MGEN:Class.NameCap*/ (ManagementAgent* _agent, Manageable* _core/*MGEN:Class.ParentArg*//*MGEN:Class.ConstructorArgs*/) :
+ ManagementObject(_agent, _core)/*MGEN:Class.ConstructorInits*/
+{
+ /*MGEN:Class.ParentRefAssignment*/
+/*MGEN:Class.InitializeElements*/
+/*MGEN:IF(Class.ExistOptionals)*/
+ // Optional properties start out not-present
+ for (uint8_t idx = 0; idx < /*MGEN:Class.PresenceMaskBytes*/; idx++)
+ presenceMask[idx] = 0;
+/*MGEN:ENDIF*/
+/*MGEN:IF(Class.ExistPerThreadStats)*/
+ maxThreads = agent->getMaxThreads();
+ perThreadStatsArray = new struct PerThreadStats*[maxThreads];
+ for (int idx = 0; idx < maxThreads; idx++)
+ perThreadStatsArray[idx] = 0;
+/*MGEN:ENDIF*/
+}
+
+/*MGEN:Class.NameCap*/::~/*MGEN:Class.NameCap*/ ()
+{
+/*MGEN:IF(Class.ExistPerThreadStats)*/
+ for (int idx = 0; idx < maxThreads; idx++)
+ if (perThreadStatsArray[idx] != 0)
+ delete perThreadStatsArray[idx];
+ delete[] perThreadStatsArray;
+/*MGEN:ENDIF*/
+}
+
+namespace {
+ const string NAME("name");
+ const string TYPE("type");
+ const string ACCESS("access");
+ const string INDEX("index");
+ const string OPTIONAL("optional");
+ const string UNIT("unit");
+ const string MIN("min");
+ const string MAX("max");
+ const string MAXLEN("maxlen");
+ const string DESC("desc");
+ const string ARGCOUNT("argCount");
+ const string ARGS("args");
+ const string DIR("dir");
+ const string DEFAULT("default");
+}
+
+void /*MGEN:Class.NameCap*/::registerClass(ManagementAgent* agent)
+{
+ agent->RegisterClass(packageName, className, md5Sum, writeSchema);
+}
+
+void /*MGEN:Class.NameCap*/::writeSchema (Buffer& buf)
+{
+ FieldTable ft;
+
+ // Schema class header:
+ buf.putShortString (packageName); // Package Name
+ buf.putShortString (className); // Class Name
+ buf.putBin128 (md5Sum); // Schema Hash
+ buf.putShort (/*MGEN:Class.ConfigCount*/); // Config Element Count
+ buf.putShort (/*MGEN:Class.InstCount*/); // Inst Element Count
+ buf.putShort (/*MGEN:Class.MethodCount*/); // Method Count
+ buf.putShort (/*MGEN:Class.EventCount*/); // Event Count
+
+ // Properties
+/*MGEN:Class.PropertySchema*/
+ // Statistics
+/*MGEN:Class.StatisticSchema*/
+ // Methods
+/*MGEN:Class.MethodSchema*/
+ // Events
+/*MGEN:Class.EventSchema*/
+}
+
+/*MGEN:IF(Class.ExistPerThreadStats)*/
+void /*MGEN:Class.NameCap*/::aggregatePerThreadStats(struct PerThreadStats* totals)
+{
+/*MGEN:Class.InitializeTotalPerThreadStats*/
+ for (int idx = 0; idx < maxThreads; idx++) {
+ struct PerThreadStats* threadStats = perThreadStatsArray[idx];
+ if (threadStats != 0) {
+/*MGEN:Class.AggregatePerThreadStats*/
+ }
+ }
+}
+/*MGEN:ENDIF*/
+
+void /*MGEN:Class.NameCap*/::writeProperties (Buffer& buf)
+{
+ sys::Mutex::ScopedLock mutex(accessLock);
+ configChanged = false;
+
+ writeTimestamps (buf);
+/*MGEN:IF(Class.ExistOptionals)*/
+ for (uint8_t idx = 0; idx < /*MGEN:Class.PresenceMaskBytes*/; idx++)
+ buf.putOctet(presenceMask[idx]);
+/*MGEN:ENDIF*/
+/*MGEN:Class.WriteProperties*/
+}
+
+void /*MGEN:Class.NameCap*/::writeStatistics (Buffer& buf, bool skipHeaders)
+{
+ sys::Mutex::ScopedLock mutex(accessLock);
+ instChanged = false;
+/*MGEN:IF(Class.ExistPerThreadAssign)*/
+ for (int idx = 0; idx < maxThreads; idx++) {
+ struct PerThreadStats* threadStats = perThreadStatsArray[idx];
+ if (threadStats != 0) {
+/*MGEN:Class.PerThreadAssign*/
+ }
+ }
+/*MGEN:ENDIF*/
+/*MGEN:IF(Class.ExistPerThreadStats)*/
+ struct PerThreadStats totals;
+ aggregatePerThreadStats(&totals);
+/*MGEN:ENDIF*/
+/*MGEN:Class.Assign*/
+ if (!skipHeaders)
+ writeTimestamps (buf);
+/*MGEN:Class.WriteStatistics*/
+
+ // Maintenance of hi-lo statistics
+/*MGEN:Class.HiLoStatResets*/
+/*MGEN:IF(Class.ExistPerThreadResets)*/
+ for (int idx = 0; idx < maxThreads; idx++) {
+ struct PerThreadStats* threadStats = perThreadStatsArray[idx];
+ if (threadStats != 0) {
+/*MGEN:Class.PerThreadHiLoStatResets*/
+ }
+ }
+/*MGEN:ENDIF*/
+}
+
+void /*MGEN:Class.NameCap*/::doMethod (/*MGEN:Class.DoMethodArgs*/)
+{
+ Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
+/*MGEN:Class.MethodHandlers*/
+ outBuf.putLong (status);
+ outBuf.putShortString (Manageable::StatusText (status));
+}
+
+/*MGEN:Class.EventMethodBodies*/
diff --git a/cpp/managementgen/qmf/templates/Class.h b/cpp/managementgen/qmf/templates/Class.h
new file mode 100644
index 0000000000..40ad20eb85
--- /dev/null
+++ b/cpp/managementgen/qmf/templates/Class.h
@@ -0,0 +1,106 @@
+/*MGEN:commentPrefix=//*/
+#ifndef _MANAGEMENT_/*MGEN:Class.NameUpper*/_
+#define _MANAGEMENT_/*MGEN:Class.NameUpper*/_
+
+//
+// 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.
+//
+
+/*MGEN:Root.Disclaimer*/
+
+#include "qpid/management/ManagementObject.h"
+#include "qpid/framing/FieldTable.h"
+#include "qpid/framing/Uuid.h"
+
+namespace qpid {
+namespace management {
+
+class /*MGEN:Class.NameCap*/ : public ManagementObject
+{
+ private:
+
+ static std::string packageName;
+ static std::string className;
+ static uint8_t md5Sum[16];
+/*MGEN:IF(Class.ExistOptionals)*/
+ uint8_t presenceMask[/*MGEN:Class.PresenceMaskBytes*/];
+/*MGEN:Class.PresenceMaskConstants*/
+/*MGEN:ENDIF*/
+
+ // Properties
+/*MGEN:Class.ConfigDeclarations*/
+ // Statistics
+/*MGEN:Class.InstDeclarations*/
+/*MGEN:IF(Class.ExistPerThreadStats)*/
+ // Per-Thread Statistics
+ struct PerThreadStats {
+/*MGEN:Class.PerThreadDeclarations*/
+ };
+
+ struct PerThreadStats** perThreadStatsArray;
+
+ inline struct PerThreadStats* getThreadStats() {
+ int index = getThreadIndex();
+ struct PerThreadStats* threadStats = perThreadStatsArray[index];
+ if (threadStats == 0) {
+ threadStats = new(PerThreadStats);
+ perThreadStatsArray[index] = threadStats;
+/*MGEN:Class.InitializePerThreadElements*/
+ }
+ return threadStats;
+ }
+
+ void aggregatePerThreadStats(struct PerThreadStats*);
+/*MGEN:ENDIF*/
+ // Private Methods
+ static void writeSchema (qpid::framing::Buffer& buf);
+ void writeProperties (qpid::framing::Buffer& buf);
+ void writeStatistics (qpid::framing::Buffer& buf,
+ bool skipHeaders = false);
+ void doMethod (std::string methodName,
+ qpid::framing::Buffer& inBuf,
+ qpid::framing::Buffer& outBuf);
+ writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
+/*MGEN:IF(Class.NoStatistics)*/
+ // Stub for getInstChanged. There are no statistics in this class.
+ bool getInstChanged (void) { return false; }
+/*MGEN:ENDIF*/
+ public:
+
+ /*MGEN:Class.NameCap*/ (ManagementAgent* agent,
+ Manageable* coreObject/*MGEN:Class.ParentArg*//*MGEN:Class.ConstructorArgs*/);
+ ~/*MGEN:Class.NameCap*/ (void);
+
+ /*MGEN:Class.SetGeneralReferenceDeclaration*/
+
+ static void registerClass (ManagementAgent* agent);
+ std::string& getPackageName (void) { return packageName; }
+ std::string& getClassName (void) { return className; }
+ uint8_t* getMd5Sum (void) { return md5Sum; }
+
+ // Method IDs
+/*MGEN:Class.MethodIdDeclarations*/
+ // Accessor Methods
+/*MGEN:Class.AccessorMethods*/
+ // Event Methods
+/*MGEN:Class.EventMethodDecls*/
+};
+
+}}
+
+#endif /*!_MANAGEMENT_/*MGEN:Class.NameUpper*/_*/
diff --git a/cpp/managementgen/qmf/templates/Makefile.mk b/cpp/managementgen/qmf/templates/Makefile.mk
new file mode 100644
index 0000000000..0e6454c13a
--- /dev/null
+++ b/cpp/managementgen/qmf/templates/Makefile.mk
@@ -0,0 +1,37 @@
+#
+# 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.
+#
+/*MGEN:commentPrefix=#*/
+/*MGEN:mgenDir=$(mgen_dir)*/
+/*MGEN:specDir=$(top_srcdir)/../specs*/
+/*MGEN:Root.Disclaimer*/
+
+mgen_generator=/*MGEN:Makefile.GenSources*/
+
+mgen_broker_cpp=/*MGEN:Makefile.GenCppFiles*/
+
+# Header file install rules.
+qpid_managementdir = $(includedir)/qpid/management
+dist_qpid_management_HEADERS = /*MGEN:Makefile.GenHFiles*/
+
+if GENERATE
+$(srcdir)/managementgen.mk: $(mgen_generator)
+ $(mgen_cmd)
+
+$(mgen_generator):
+endif
diff --git a/cpp/managementgen/qmf/templates/Package.cpp b/cpp/managementgen/qmf/templates/Package.cpp
new file mode 100644
index 0000000000..15e7fc15ec
--- /dev/null
+++ b/cpp/managementgen/qmf/templates/Package.cpp
@@ -0,0 +1,32 @@
+/*MGEN:commentPrefix=//*/
+//
+// 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.
+//
+
+/*MGEN:Root.Disclaimer*/
+
+#include "Package/*MGEN:Schema.PackageNameCap*/.h"
+/*MGEN:Schema.ClassIncludes*/
+
+using namespace qpid::management;
+
+Package/*MGEN:Schema.PackageNameCap*/::Package/*MGEN:Schema.PackageNameCap*/ (ManagementAgent* agent)
+{
+/*MGEN:Schema.ClassRegisters*/
+}
+
diff --git a/cpp/managementgen/qmf/templates/Package.h b/cpp/managementgen/qmf/templates/Package.h
new file mode 100644
index 0000000000..3f3ac35ffc
--- /dev/null
+++ b/cpp/managementgen/qmf/templates/Package.h
@@ -0,0 +1,41 @@
+/*MGEN:commentPrefix=//*/
+#ifndef _MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_
+#define _MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_
+
+//
+// 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.
+//
+
+/*MGEN:Root.Disclaimer*/
+
+#include "qpid/agent/ManagementAgent.h"
+
+namespace qpid {
+namespace management {
+
+class Package/*MGEN:Schema.PackageNameCap*/
+{
+ public:
+ Package/*MGEN:Schema.PackageNameCap*/ (ManagementAgent* agent);
+ ~Package/*MGEN:Schema.PackageNameCap*/ () {}
+};
+
+}}
+
+
+#endif /*!_MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_*/