Alan,

In order to maintain the qpid broker management schema, we've established a couple of XML document formats that formally define the schema (object types, methods/arguments, events, etc.).  Note that these documents are disjoint from, and unrelated to the AMQP specification document.

All of the broker classes (C++ only for now) that implement the management schema are generated by a code generation tool.  I would like to begin integrating the management code generation into the C++ broker build and am looking for advice as to how to do it properly.

Here are some points/questions:
  1. The schema spec will be changing on a regular basis during development.  This means that the generator must be run at build time when the xml documents have changed.  The generator writes the output files only if they don't exist or their contents have changed.  This prevents unnecessarily long make runs caused by "touching" files that aren't changed.  The easiest strategy would be to always run the generator at the beginning of each build (the generation process takes 21 milliseconds on my ThinkPad).
  2. The generator writes both .h and .cpp files.  The .h files need to be available for inclusion from normal broker source files (i.e. must be in some include path).
  3. Where should the generated files be deposited?  I assume cpp/src/gen/qpid/management is the right place.
  4. Where should the generator go?  Should it be considered a peer of rubygen and placed in cpp/managementgen?
  5. Where are the generator files and templates listed such that they are properly included in a source distribution?
  6. How is the make file updated to include all of the generated source code?  Should the generator create a makefile fragment to be included?  I can emulate the rubygen example but it's not obvious to me how it works or which files are truly "source" and which are generated along the way.
Regards,

-Ted

Reply via email to