A list for the developers of CellML tools

Text archives Help


[cellml-dev] A standard model flattening API?


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-dev] A standard model flattening API?
  • Date: Wed, 12 Jun 2013 08:09:50 +1200

Hi all,

I've been looking at what an API for flattening CellML 1.1 models into
CellML 1.0 models should look like. I think we want to allow for future
expansion so we can flatten models with different options (for example,
we could have an off-by-default option that also changes encapsulation
to suit original COR) without breaking backwards compatibility, so I
think we want a two tier system where you ask the service for a
flattener (which you can customise through attributes) and then run the
flattening. We could go for a third level and have a 'flattening result'
interface, but I'm not sure if that will be useful enough to justify the
additional complexity it adds.

Please let me know what you think of the interface design below.

Best wishes,
Andrew

/**
* @file
* The MoFS, or Model Flattening Service, allows CellML 1.1 models with
imports
* to be 'flattened' to a CellML 1.0 model where all the content from the
* imports is placed in one file.
*/
#include "CellML_APISPEC.idl"

module mofs
{
/**
* Represents a particular set of options for model flattening.
* (note that initially there are no options, but this design allows for
* future expansion).
*/
interface ModelFlattener
: XPCOM::IObject
{
/**
* Flattens a CellML 1.1 model into a CellML 1.0 model with all
imported
* components and their dependencies in one file.
* @param aModel The model to flatten.
* @raises cellml_api::CellMLException if an error in the model
prevents
* flattening. lastError will
contain
* details.
*/
cellml_api::Model flatten(in cellml_api::Model aModel)
raises(cellml_api::CellMLException);

/**
* Contains an error explaining the last failure to flatten a model.
*/
readonly attribute wstring lastError;
};

interface ModelFlatteningService
: XPCOM::IObject
{
/**
* Creates a new model flattener with default options.
*/
ModelFlattener makeFlattener();
};
};





Archive powered by MHonArc 2.6.18.

Top of page