Example #1
0
def writeRequiredMethods(fileOut):
  fileOut.write('\t//---------------------------------------------------------------\n')
  fileOut.write('\t//\n')
  fileOut.write('\t// overridden virtual functions for read/write/check\n')
  fileOut.write('\t//\n')
  fileOut.write('\t//---------------------------------------------------------------\n\n')
  generalFunctions.writeInternalStartDecl(fileOut)
  fileOut.write('\t/**\n')
  fileOut.write('\t * Subclasses must override this method to create, store, and then\n')
  fileOut.write('\t * return an SEDML object corresponding to the next XMLToken in the\n')
  fileOut.write('\t * XMLInputStream if they have their specific elements.\n')
  fileOut.write('\t *\n')
  fileOut.write('\t * @return the SEDML object corresponding to next XMLToken in the\n')
  fileOut.write('\t * XMLInputStream or NULL if the token was not recognized.\n')
  fileOut.write('\t */\n')
  fileOut.write('\tvirtual SedBase* createObject (XMLInputStream& stream);\n\n\n')
  generalFunctions.writeInternalEndDecl(fileOut)
  generalFunctions.writeInternalStartDecl(fileOut)
  fileOut.write('\t/**\n')
  fileOut.write('\t * Subclasses must override this method to write out their contained\n')
  fileOut.write('\t * SEDML objects as XML elements if they have their specific elements.\n')
  fileOut.write('\t */\n')
  fileOut.write('\tvirtual void writeElements (XMLOutputStream& stream) const;\n\n\n')
  generalFunctions.writeInternalEndDecl(fileOut)
  fileOut.write('\t/**\n')
  fileOut.write('\t * Checks if this plugin object has all the required elements.\n')
  fileOut.write('\t *\n')
  fileOut.write('\t * Subclasses must override this method \n')
  fileOut.write('\t * if they have their specific elements.\n')
  fileOut.write('\t *\n')
  fileOut.write('\t * @return true if this plugin object has all the required elements\n')
  fileOut.write('\t * otherwise false will be returned.\n')
  fileOut.write('\t */\n')
  fileOut.write('\tvirtual bool hasRequiredElements () const;\n\n\n')
  fileOut.write('\t//---------------------------------------------------------------\n\n\n')
Example #2
0
def writeRequiredMethods(fileOut):
    fileOut.write(
        '\t//---------------------------------------------------------------\n'
    )
    fileOut.write('\t//\n')
    fileOut.write('\t// overridden virtual functions for read/write/check\n')
    fileOut.write('\t//\n')
    fileOut.write(
        '\t//---------------------------------------------------------------\n\n'
    )
    generalFunctions.writeInternalStartDecl(fileOut)
    fileOut.write('\t/**\n')
    fileOut.write(
        '\t * Subclasses must override this method to create, store, and then\n'
    )
    fileOut.write(
        '\t * return an SEDML object corresponding to the next XMLToken in the\n'
    )
    fileOut.write(
        '\t * XMLInputStream if they have their specific elements.\n')
    fileOut.write('\t *\n')
    fileOut.write(
        '\t * @return the SEDML object corresponding to next XMLToken in the\n'
    )
    fileOut.write(
        '\t * XMLInputStream or NULL if the token was not recognized.\n')
    fileOut.write('\t */\n')
    fileOut.write(
        '\tvirtual SedBase* createObject (XMLInputStream& stream);\n\n\n')
    generalFunctions.writeInternalEndDecl(fileOut)
    generalFunctions.writeInternalStartDecl(fileOut)
    fileOut.write('\t/**\n')
    fileOut.write(
        '\t * Subclasses must override this method to write out their contained\n'
    )
    fileOut.write(
        '\t * SEDML objects as XML elements if they have their specific elements.\n'
    )
    fileOut.write('\t */\n')
    fileOut.write(
        '\tvirtual void writeElements (XMLOutputStream& stream) const;\n\n\n')
    generalFunctions.writeInternalEndDecl(fileOut)
    fileOut.write('\t/**\n')
    fileOut.write(
        '\t * Checks if this plugin object has all the required elements.\n')
    fileOut.write('\t *\n')
    fileOut.write('\t * Subclasses must override this method \n')
    fileOut.write('\t * if they have their specific elements.\n')
    fileOut.write('\t *\n')
    fileOut.write(
        '\t * @return true if this plugin object has all the required elements\n'
    )
    fileOut.write('\t * otherwise false will be returned.\n')
    fileOut.write('\t */\n')
    fileOut.write('\tvirtual bool hasRequiredElements () const;\n\n\n')
    fileOut.write(
        '\t//---------------------------------------------------------------\n\n\n'
    )
Example #3
0
def writeClassEnd(fileOut, members):
  fileOut.write('protected:\n\n')
  generalFunctions.writeInternalStartDecl(fileOut)
  for i in range (0, len(members)):
    mem = members[i]
    fileOut.write('\tSedListOf{0}s m{0}s;\n'.format(mem['name']))
  fileOut.write('\n')
  generalFunctions.writeInternalEndDecl(fileOut)
  fileOut.write('};\n\n\n')
Example #4
0
def writeClassEnd(fileOut, members):
    fileOut.write('protected:\n\n')
    generalFunctions.writeInternalStartDecl(fileOut)
    for i in range(0, len(members)):
        mem = members[i]
        fileOut.write('\tSedListOf{0}s m{0}s;\n'.format(mem['name']))
    fileOut.write('\n')
    generalFunctions.writeInternalEndDecl(fileOut)
    fileOut.write('};\n\n\n')
Example #5
0
def writeProtectedFunctions(output, element, package):
  listOf = generalFunctions.writeListOf(element)
  generalFunctions.writeInternalStartDecl(output)
  output.write('  /**\n')
  output.write('   * Creates a new {0} in this {1}\n'.format(element, listOf))
  output.write('   */\n')
  output.write('  virtual SedBase* createObject(XMLInputStream& stream);\n\n\n')
  generalFunctions.writeInternalEndDecl(output)
  generalFunctions.writeInternalStartDecl(output)
  output.write('  /**\n')
  output.write('   * Write the namespace for the {0} package.\n'.format(package))
  output.write('   */\n')
  output.write('  virtual void writeXMLNS(XMLOutputStream& stream) const;\n\n\n')
  generalFunctions.writeInternalEndDecl(output)
Example #6
0
def writeProtectedFunctions(output, element, package):
  listOf = generalFunctions.writeListOf(element)
  generalFunctions.writeInternalStartDecl(output)
  output.write('\t/**\n')
  output.write('\t * Creates a new {0} in this {1}\n'.format(element, listOf))
  output.write('\t */\n')
  output.write('\tvirtual SedBase* createObject(XMLInputStream& stream);\n\n\n')
  generalFunctions.writeInternalEndDecl(output)
  generalFunctions.writeInternalStartDecl(output)
  output.write('\t/**\n')
  output.write('\t * Write the namespace for the {0} package.\n'.format(package))
  output.write('\t */\n')
  output.write('\tvirtual void writeXMLNS(XMLOutputStream& stream) const;\n\n\n')
  generalFunctions.writeInternalEndDecl(output)