#include <iostream>
#include <sstream>
#ifdef WIN32
#include <conio.h>
#endif
LIBSBML_CPP_NAMESPACE_USE
using namespace std;
int main(int argc,char** argv)
{
int retval = 0;
mod1->setId("enzyme");
mod1->setName("enzyme");
mod1->addSpecies(&spec);
mod1->addSpecies(&spec);
mod1->addSpecies(&spec);
mod1->addSpecies(&spec);
mod1->addReaction(&rxn);
mod1->addReaction(&rxn2);
m1port.
setId(
"comp_port");
mod2->setId("simple");
mod2->addSpecies(&spec);
mod2->addSpecies(&spec);
mod2->addReaction(&rxn3);
model->setId("complexified");
model->addSpecies(&spec);
model->addSpecies(&spec);
model->addReaction(&blankrxn);
model->addReaction(&blankrxn);
delete document;
if (document == NULL)
{
cout << "Error reading back in file." << endl;
retval = -1;
}
else
{
{
stringstream errorstream;
cout << "Errors encoutered when round-tripping SBML file: \n"
<< errorstream.str() << endl;
retval = -1;
}
delete document;
}
#ifdef WIN32
if (retval != 0)
{
cout << "(Press any key to exit.)" << endl;
_getch();
}
#endif
return retval;
}
static SBMLExtensionRegister< CompExtension > compExtensionRegistry
Definition: CompExtension.cpp:109
Definition of CompExtension, the core module of comp package.
Definition of CompModelPlugin, the plugin class of comp package for the Model element.
Definition of CompSBMLDocumentPlugin, the plugin class of comp package for the Model element.
Definition of CompSBasePlugin, the plugin class of comp package for the Model element.
@ LIBSBML_CAT_UNITS_CONSISTENCY
Definition: SBMLError.h:975
Template class for registering extension packages.
The registry class for tracking package extensions.
SBMLDocument_t * readSBMLFromFile(const char *filename)
Include all SBML types in a single header file.
int writeSBMLToFile(const SBMLDocument_t *d, const char *filename)
Writes the given SBML document d to the file filename.
@sbmlpackage{comp}
Definition: CompModelPlugin.h:87
Port * createPort()
Creates a Port object, adds it to the end of the port objects list and returns a pointer to the newly...
Definition: CompModelPlugin.cpp:457
Submodel * createSubmodel()
Creates a Submodel object, adds it to the end of the submodel objects list and returns a pointer to t...
Definition: CompModelPlugin.cpp:316
int addPort(const Port *port)
Adds a copy of the given Port object to the list of ports.
Definition: CompModelPlugin.cpp:416
@sbmlpackage{comp}
Definition: CompSBMLDocumentPlugin.h:94
virtual int setRequired(bool value)
Sets the bool value of "required" attribute of corresponding package in SBMLDocument element.
Definition: CompSBMLDocumentPlugin.cpp:608
ModelDefinition * createModelDefinition()
Creates a ModelDefinition object, adds it to the end of the ModelDefinition objects list and returns ...
Definition: CompSBMLDocumentPlugin.cpp:403
@sbmlpackage{comp}
Definition: CompSBasePlugin.h:85
int addReplacedElement(const ReplacedElement *replacedElement)
Adds a copy of the given ReplacedElement object to the list of ReplacedElements.
Definition: CompSBasePlugin.cpp:325
ReplacedElement * createReplacedElement()
Creates a ReplacedElement object, adds it to the end of the ReplacedElement objects list and returns ...
Definition: CompSBasePlugin.cpp:375
ReplacedBy * createReplacedBy()
Creates a new, empty ReplacedBy, adds it to this CompSBasePlugin and returns the created ReplacedBy.
Definition: CompSBasePlugin.cpp:447
@sbmlpackage{core}
Definition: Compartment.h:490
int setConstant(bool value)
Sets the value of the "constant" attribute of this Compartment object.
Definition: Compartment.cpp:661
int setSpatialDimensions(unsigned int value)
Sets the "spatialDimensions" attribute of this Compartment object.
Definition: Compartment.cpp:552
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Compartment object.
Definition: Compartment.cpp:479
int setSize(double value)
Sets the "size" attribute (or "volume" in SBML Level 1) of this Compartment object.
Definition: Compartment.cpp:603
@sbmlpackage{comp}
Definition: Deletion.h:110
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Deletion.
Definition: Deletion.cpp:118
@sbmlpackage{comp}
Definition: ModelDefinition.h:71
@sbmlpackage{comp}
Definition: Port.h:91
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Port.
Definition: Port.cpp:103
@sbmlpackage{core}
Definition: Reaction.h:224
int setReversible(bool value)
Sets the value of the "reversible" attribute of this Reaction.
Definition: Reaction.cpp:599
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Reaction.
Definition: Reaction.cpp:517
int addReactant(const SpeciesReference *sr)
Adds a given SpeciesReference object as a reactant in this Reaction.
Definition: Reaction.cpp:784
SpeciesReference * removeReactant(unsigned int n)
Removes the nth reactant species (SpeciesReference object) in the list of reactants in this Reaction ...
Definition: Reaction.cpp:1299
int setFast(bool value)
Sets the value of the "fast" attribute of this Reaction.
Definition: Reaction.cpp:612
int addProduct(const SpeciesReference *sr)
Adds a given SpeciesReference object as a product in this Reaction.
Definition: Reaction.cpp:840
@sbmlpackage{comp}
Definition: ReplacedBy.h:71
@sbmlpackage{comp}
Definition: ReplacedElement.h:143
virtual int setDeletion(const std::string &id)
Sets the value of the "deletion" attribute of this ReplacedElement.
Definition: ReplacedElement.cpp:160
virtual int setSubmodelRef(const std::string &id)
Sets the value of the "submodelRef" attribute of this SBaseRef.
Definition: Replacing.cpp:100
@sbmlpackage{core}
Definition: SBMLDocument.h:349
Model * createModel(const std::string sid="")
Creates a new Model inside this SBMLDocument, and returns a pointer to it.
Definition: SBMLDocument.cpp:623
unsigned int checkConsistency()
Performs consistency checking and validation on this SBML document.
Definition: SBMLDocument.cpp:695
SBMLErrorLog * getErrorLog()
Returns the list of errors or warnings logged during parsing, consistency checking,...
Definition: SBMLDocument.cpp:1329
void printErrors(std::ostream &stream=std::cerr) const
Prints all the errors or warnings encountered trying to parse, check, or translate this SBML document...
Definition: SBMLDocument.cpp:1176
void setConsistencyChecks(SBMLErrorCategory_t category, bool apply)
Controls the consistency checks that are performed when SBMLDocument::checkConsistency() is called.
Definition: SBMLDocument.cpp:673
unsigned int getNumFailsWithSeverity(unsigned int severity)
Returns the number of errors that have been logged with the given severity code.
Definition: SBMLErrorLog.cpp:363
@sbmlpackage{core}
Definition: SBMLExtensionRegister.h:74
@sbmlpackage{core}
Definition: SBMLNamespaces.h:145
SBasePlugin * getPlugin(const std::string &package)
Returns a plug-in object (extension interface) for an SBML Level 3 package extension with the given ...
Definition: SBase.cpp:3345
virtual int setPortRef(const std::string &id)
Sets the value of the "portRef" attribute of this SBaseRef.
Definition: SBaseRef.cpp:247
virtual int unsetIdRef()
Unsets the value of the "idRef" attribute of this SBaseRef.
Definition: SBaseRef.cpp:353
virtual int setIdRef(const std::string &id)
Sets the value of the "idRef" attribute of this SBaseRef.
Definition: SBaseRef.cpp:309
int setSpecies(const std::string &sid)
Sets the "species" attribute of this SimpleSpeciesReference.
Definition: SimpleSpeciesReference.cpp:196
@sbmlpackage{core}
Definition: Species.h:429
int setCompartment(const std::string &sid)
Sets the "compartment" attribute of this Species object.
Definition: Species.cpp:661
int setConstant(bool value)
Sets the "constant" attribute of this Species object.
Definition: Species.cpp:820
int setBoundaryCondition(bool value)
Sets the "boundaryCondition" attribute of this Species object.
Definition: Species.cpp:787
int setInitialConcentration(double value)
Sets the "initialConcentration" attribute of this Species and marks the field as set.
Definition: Species.cpp:695
int unsetInitialConcentration()
Unsets the "initialConcentration" attribute value of this Species object.
Definition: Species.cpp:957
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Species.
Definition: Species.cpp:591
int setHasOnlySubstanceUnits(bool value)
Sets the "hasOnlySubstanceUnits" attribute of this Species object.
Definition: Species.cpp:767
@sbmlpackage{core}
Definition: SpeciesReference.h:281
int setStoichiometry(double value)
Sets the value of the "stoichiometry" attribute of this SpeciesReference.
Definition: SpeciesReference.cpp:312
int setConstant(bool flag)
Sets the "constant" attribute of this SpeciesReference to the given boolean flag.
Definition: SpeciesReference.cpp:400
@sbmlpackage{comp}
Definition: Submodel.h:156
virtual int setId(const std::string &sid)
Sets the value of the "id" attribute of this Submodel.
Definition: Submodel.cpp:178
virtual int setModelRef(const std::string &modelRef)
Sets the value of the "modelRef" attribute of this Submodel.
Definition: Submodel.cpp:254
Deletion * createDeletion()
Creates a Deletion object, adds it to the end of the deletion objects list and returns a pointer to t...
Definition: Submodel.cpp:500