summaryrefslogtreecommitdiff
path: root/qpid/cpp/managementgen/qmf/generate.py
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/managementgen/qmf/generate.py')
-rwxr-xr-xqpid/cpp/managementgen/qmf/generate.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/qpid/cpp/managementgen/qmf/generate.py b/qpid/cpp/managementgen/qmf/generate.py
index 7346200a28..958728d739 100755
--- a/qpid/cpp/managementgen/qmf/generate.py
+++ b/qpid/cpp/managementgen/qmf/generate.py
@@ -250,6 +250,14 @@ class Generator:
path = self.packagePath + _class.getNameCap () + extension
return path
+ def targetEventFile (self, event, templateFile):
+ dot = templateFile.find(".")
+ if dot == -1:
+ raise ValueError ("Invalid template file name %s" % templateFile)
+ extension = templateFile[dot:len (templateFile)]
+ path = self.packagePath + "Event" + event.getNameCap () + extension
+ return path
+
def targetMethodFile (self, method, templateFile):
""" Return the file name for a method file """
dot = templateFile.rfind(".")
@@ -293,6 +301,16 @@ class Generator:
stream = template.expand (_class)
self.writeIfChanged (stream, target, force)
+ def makeEventFiles (self, templateFile, schema, force=False):
+ """ Generate an expanded template per schema event """
+ events = schema.getEvents()
+ template = Template (self.input + templateFile, self)
+ self.templateFiles.append (templateFile)
+ for event in events:
+ target = self.targetEventFile(event, templateFile)
+ stream = template.expand(event)
+ self.writeIfChanged(stream, target, force)
+
def makeMethodFiles (self, templateFile, schema, force=False):
""" Generate an expanded template per method-with-arguments """
classes = schema.getClasses ()