Skip to content

Commit

Permalink
Merge pull request #252 from exaexa/mk-create-objects
Browse files Browse the repository at this point in the history
FbcModelPlugin C API for createObjective and createGeneProduct
  • Loading branch information
skeating committed Aug 4, 2022
2 parents f1124d3 + 8dd8654 commit 00eb881
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/sbml/packages/fbc/extension/FbcModelPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2546,6 +2546,14 @@ FbcModelPlugin_getNumFluxBounds(SBasePlugin_t * fbc)
}


LIBSBML_EXTERN
Objective_t*
FbcModelPlugin_createObjective(SBasePlugin_t * fbc)
{
return static_cast<FbcModelPlugin*>(fbc)->createObjective();
}


LIBSBML_EXTERN
int
FbcModelPlugin_addObjective(SBasePlugin_t * fbc, Objective_t * obj)
Expand Down Expand Up @@ -2596,6 +2604,14 @@ FbcModelPlugin_setActiveObjectiveId(SBasePlugin_t * fbc, const char * activeId)
}


LIBSBML_EXTERN
GeneProduct_t*
FbcModelPlugin_createGeneProduct(SBasePlugin_t * fbc)
{
return static_cast<FbcModelPlugin*>(fbc)->createGeneProduct();
}


LIBSBML_EXTERN
int
FbcModelPlugin_addGeneProduct(SBasePlugin_t * fbc, GeneProduct_t * fb)
Expand Down
36 changes: 36 additions & 0 deletions src/sbml/packages/fbc/extension/FbcModelPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,24 @@ unsigned int
FbcModelPlugin_getNumFluxBounds(SBasePlugin_t * fmp);


/**
* Creates a new Objective_t object, adds it to this FbcModelPlugin_t object
* and returns the created object.
*
* @param fmp the FbcModelPlugin_t structure to which the
* Objective_t should be added.
*
* @return a new Objective_t object instance.
*
* @copydetails doc_returned_unowned_pointer
*
* @memberof FbcModelPlugin_t
*/
LIBSBML_EXTERN
Objective_t*
FbcModelPlugin_createObjective(SBasePlugin_t * fmp);


/**
* Appends a copy of the given Objective_t structure to the given FbcModelPlugin_t
* structure.
Expand Down Expand Up @@ -1932,6 +1950,24 @@ int
FbcModelPlugin_setActiveObjectiveId(SBasePlugin_t * fmp, const char * activeObjective);


/**
* Creates a new GeneProduct_t object, adds it to this FbcModelPlugin_t object
* and returns the created object.
*
* @param fmp the FbcModelPlugin_t structure to which the
* GeneProduct_t should be added.
*
* @return a new GeneProduct_t object instance.
*
* @copydetails doc_returned_unowned_pointer
*
* @memberof FbcModelPlugin_t
*/
LIBSBML_EXTERN
GeneProduct_t*
FbcModelPlugin_createGeneProduct(SBasePlugin_t * fmp);


/**
* Appends a copy of the given GeneProduct_t structure to the given FbcModelPlugin_t
* structure.
Expand Down

0 comments on commit 00eb881

Please sign in to comment.