summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2008-09-22 19:35:54 +0000
committerTed Ross <tross@apache.org>2008-09-22 19:35:54 +0000
commit2b1d069f6877abc6259596059a62cdc002f0f851 (patch)
tree4315db9434d0ac7b7d7425c4c28e5d2fccb5d0db /qpid/cpp
parentd8052aa68614ae482a0ac618e7001d3c16a84920 (diff)
downloadqpid-python-2b1d069f6877abc6259596059a62cdc002f0f851.tar.gz
Add initialization for properties not in the constructor arguments
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@697961 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/managementgen/qmf/management-types.xml6
-rwxr-xr-xqpid/cpp/managementgen/qmf/schema.py7
2 files changed, 10 insertions, 3 deletions
diff --git a/qpid/cpp/managementgen/qmf/management-types.xml b/qpid/cpp/managementgen/qmf/management-types.xml
index 56d2488803..6e34421d99 100644
--- a/qpid/cpp/managementgen/qmf/management-types.xml
+++ b/qpid/cpp/managementgen/qmf/management-types.xml
@@ -19,7 +19,7 @@
under the License.
-->
-<type name="objId" base="REF" cpp="::qpid::management::ObjectId" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" init="0" byRef="y"/>
+<type name="objId" base="REF" cpp="::qpid::management::ObjectId" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" init="::qpid::management::ObjectId()" byRef="y"/>
<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"/>
@@ -35,8 +35,8 @@
<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="::qpid::framing::Uuid" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" byRef="y"/>
-<type name="map" base="FTABLE" cpp="::qpid::framing::FieldTable" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" byRef="y"/>
+<type name="uuid" base="UUID" cpp="::qpid::framing::Uuid" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" init="::qpid::framing::Uuid()" byRef="y"/>
+<type name="map" base="FTABLE" cpp="::qpid::framing::FieldTable" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" init="::qpid::framing::FieldTable()" byRef="y"/>
<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"/>
diff --git a/qpid/cpp/managementgen/qmf/schema.py b/qpid/cpp/managementgen/qmf/schema.py
index 12a325ed80..2ecf9c351f 100755
--- a/qpid/cpp/managementgen/qmf/schema.py
+++ b/qpid/cpp/managementgen/qmf/schema.py
@@ -332,6 +332,10 @@ class SchemaProperty:
def genAccessor (self, stream):
self.type.type.genAccessor (stream, self.name, "configChanged", self.isOptional == 1)
+ def genInitialize (self, stream, prefix="", indent=" "):
+ val = self.type.type.init
+ stream.write (indent + prefix + self.name + " = " + val + ";\n")
+
def genSchema (self, stream):
stream.write (" ft = FieldTable ();\n")
stream.write (" ft.setString (NAME, \"" + self.name + "\");\n")
@@ -966,6 +970,9 @@ class SchemaClass:
inst.genPerThreadHiLoStatResets (stream)
def genInitializeElements (self, stream, variables):
+ for prop in self.properties:
+ if not prop.isConstructorArg() and not prop.isParentRef:
+ prop.genInitialize(stream)
for inst in self.statistics:
if not inst.type.type.perThread:
inst.genInitialize (stream)