summaryrefslogtreecommitdiff
path: root/cpp/managementgen/templates/Class.cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-09-03 18:01:44 +0000
committerTed Ross <tross@apache.org>2008-09-03 18:01:44 +0000
commit13191e7951b29453c75db8384391d26f0402139d (patch)
treeb3ca5bd5f9c8523924cf9d1a0fe118099bef9894 /cpp/managementgen/templates/Class.cpp
parentb8cf7ea1034fa6216183f03022c83efdb154f3ee (diff)
downloadqpid-python-13191e7951b29453c75db8384391d26f0402139d.tar.gz
QPID-1174 Updates to the management framework
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@691700 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/managementgen/templates/Class.cpp')
-rw-r--r--cpp/managementgen/templates/Class.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/cpp/managementgen/templates/Class.cpp b/cpp/managementgen/templates/Class.cpp
index 289427d742..2a0e55b34d 100644
--- a/cpp/managementgen/templates/Class.cpp
+++ b/cpp/managementgen/templates/Class.cpp
@@ -42,6 +42,11 @@ uint8_t /*MGEN:Class.NameCap*/::md5Sum[16] =
{
/*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];
@@ -65,6 +70,7 @@ namespace {
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");
@@ -76,6 +82,11 @@ namespace {
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;
@@ -90,9 +101,9 @@ void /*MGEN:Class.NameCap*/::writeSchema (Buffer& buf)
buf.putShort (/*MGEN:Class.EventCount*/); // Event Count
// Properties
-/*MGEN:Class.ConfigElementSchema*/
+/*MGEN:Class.PropertySchema*/
// Statistics
-/*MGEN:Class.InstElementSchema*/
+/*MGEN:Class.StatisticSchema*/
// Methods
/*MGEN:Class.MethodSchema*/
// Events
@@ -118,7 +129,11 @@ void /*MGEN:Class.NameCap*/::writeProperties (Buffer& buf)
configChanged = false;
writeTimestamps (buf);
-/*MGEN:Class.WriteConfig*/
+/*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)
@@ -140,7 +155,7 @@ void /*MGEN:Class.NameCap*/::writeStatistics (Buffer& buf, bool skipHeaders)
/*MGEN:Class.Assign*/
if (!skipHeaders)
writeTimestamps (buf);
-/*MGEN:Class.WriteInst*/
+/*MGEN:Class.WriteStatistics*/
// Maintenance of hi-lo statistics
/*MGEN:Class.HiLoStatResets*/
@@ -162,3 +177,4 @@ void /*MGEN:Class.NameCap*/::doMethod (/*MGEN:Class.DoMethodArgs*/)
outBuf.putShortString (Manageable::StatusText (status));
}
+/*MGEN:Class.EventMethodBodies*/