Example #1 from the SBML Level 3 Hierarchical Model Composition specification.
#include <iostream>
#include <sstream>
#ifdef WIN32
#include <conio.h>
#endif
int main(int argc,char** argv)
{
int retval = 0;
model->
setId(
"aggregate");
submod1->
setId(
"submod1");
submod2.
setId(
"submod2");
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;
}