libSBML C API  libSBML 5.8.0 C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ModelHistory.cpp File Reference

Detailed Description

ModelHistory I/O.

Author
Sarah Keating

Copyright (C) 2009-2013 jointly by the following organizations: 1. California Institute of Technology, Pasadena, CA, USA 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK

Copyright (C) 2006-2008 by the California Institute of Technology, Pasadena, CA, USA

Copyright (C) 2002-2005 jointly by the following organizations: 1. California Institute of Technology, Pasadena, CA, USA 2. Japan Science and Technology Agency, Japan

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation. A copy of the license agreement is provided in the file named "LICENSE.txt" included with this software distribution. It is also available online at http://sbml.org/software/libsbml/license.html

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Include dependency graph for ModelHistory.cpp:

Functions

int ModelHistory_addCreator (ModelHistory_t *mh, ModelCreator_t *mc)
 Adds a copy of a ModelCreator_t structure to the ModelHistory_t structure. More...
 
int ModelHistory_addModifiedDate (ModelHistory_t *mh, Date_t *date)
 Adds a copy of a Date_t structure to the list of modifiedDates in the ModelHistory_t structure. More...
 
ModelHistory_t * ModelHistory_clone (const ModelHistory_t *mh)
 Creates a deep copy of the given ModelHistory_t structure. More...
 
ModelHistory_t * ModelHistory_create ()
 Creates a new ModelHistory_t structure and returns a pointer to it. More...
 
void ModelHistory_free (ModelHistory_t *mh)
 Destroys this ModelHistory. More...
 
Date_t * ModelHistory_getCreatedDate (ModelHistory_t *mh)
 Returns the createdDate from the ModelHistory. More...
 
ModelCreator_t * ModelHistory_getCreator (ModelHistory_t *mh, unsigned int n)
 Get the nth ModelCreator_t structure in this ModelHistory_t. More...
 
List_t * ModelHistory_getListCreators (ModelHistory_t *mh)
 Get the List of ModelCreator objects in this ModelHistory. More...
 
List_t * ModelHistory_getListModifiedDates (ModelHistory_t *mh)
 Get the List of Date objects in the list of ModifiedDates in this ModelHistory. More...
 
Date_t * ModelHistory_getModifiedDate (ModelHistory_t *mh)
 Returns the modifiedDate from the ModelHistory. More...
 
Date_t * ModelHistory_getModifiedDateFromList (ModelHistory_t *mh, unsigned int n)
 Get the nth Date_t structure in the list of ModifiedDates in this ModelHistory_t. More...
 
unsigned int ModelHistory_getNumCreators (ModelHistory_t *mh)
 Get the number of ModelCreator objects in this ModelHistory. More...
 
unsigned int ModelHistory_getNumModifiedDates (ModelHistory_t *mh)
 Get the number of modified Date objects in the list of ModifiedDates in this ModelHistory. More...
 
int ModelHistory_hasRequiredAttributes (ModelHistory_t *mh)
 
int ModelHistory_isSetCreatedDate (ModelHistory_t *mh)
 Predicate indicating whether this ModelHistory's createdDate is set. More...
 
int ModelHistory_isSetModifiedDate (ModelHistory_t *mh)
 Predicate indicating whether this ModelHistory's modifiedDate is set. More...
 
int ModelHistory_setCreatedDate (ModelHistory_t *mh, Date_t *date)
 Sets the createdDate. More...
 
int ModelHistory_setModifiedDate (ModelHistory_t *mh, Date_t *date)
 Sets the modifiedDate. More...
 

Function Documentation

int ModelHistory_addCreator ( ModelHistory_t *  mh,
ModelCreator_t *  mc 
)

Adds a copy of a ModelCreator_t structure to the ModelHistory_t structure.

Parameters
mhthe ModelHistory_t structure
mcthe ModelCreator_t structure to add.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
  • LIBSBML_OPERATION_FAILED
int ModelHistory_addModifiedDate ( ModelHistory_t *  mh,
Date_t *  date 
)

Adds a copy of a Date_t structure to the list of modifiedDates in the ModelHistory_t structure.

Parameters
mhthe ModelHistory_t structure
datethe Date_t structure to add.
ModelHistory_t* ModelHistory_clone ( const ModelHistory_t *  mh)

Creates a deep copy of the given ModelHistory_t structure.

Parameters
mhthe ModelHistory_t structure to be copied
Returns
a (deep) copy of the given ModelHistory_t structure.
ModelHistory_t* ModelHistory_create ( )

Creates a new ModelHistory_t structure and returns a pointer to it.

Returns
pointer to newly created ModelHistory_t structure.
void ModelHistory_free ( ModelHistory_t *  mh)

Destroys this ModelHistory.

Parameters
mhModelHistory_t structure to be freed.
Date_t* ModelHistory_getCreatedDate ( ModelHistory_t *  mh)

Returns the createdDate from the ModelHistory.

Parameters
mhthe ModelHistory_t structure
Returns
Date_t structure representing the createdDate from the ModelHistory_t structure.
ModelCreator_t* ModelHistory_getCreator ( ModelHistory_t *  mh,
unsigned int  n 
)

Get the nth ModelCreator_t structure in this ModelHistory_t.

Parameters
mhthe ModelHistory_t structure
nan unsigned int indicating which ModelCreator
Returns
the nth ModelCreator of this ModelHistory.
List_t* ModelHistory_getListCreators ( ModelHistory_t *  mh)

Get the List of ModelCreator objects in this ModelHistory.

Parameters
mhthe ModelHistory_t structure
Returns
a pointer to the List_t structure of ModelCreators for this ModelHistory_t structure.
List_t* ModelHistory_getListModifiedDates ( ModelHistory_t *  mh)

Get the List of Date objects in the list of ModifiedDates in this ModelHistory.

Parameters
mhthe ModelHistory_t structure
Returns
a pointer to the List_t structure of Dates for this ModelHistory_t structure.
Date_t* ModelHistory_getModifiedDate ( ModelHistory_t *  mh)

Returns the modifiedDate from the ModelHistory.

Parameters
mhthe ModelHistory_t structure
Returns
Date_t structure representing the modifiedDate from the ModelHistory_t structure.
Date_t* ModelHistory_getModifiedDateFromList ( ModelHistory_t *  mh,
unsigned int  n 
)

Get the nth Date_t structure in the list of ModifiedDates in this ModelHistory_t.

Parameters
mhthe ModelHistory_t structure
nan unsigned int indicating which Date
Returns
the nth Date in the list of ModifiedDates of this ModelHistory.
Note
A bug in libSBML meant that originally a ModelHistory object contained only one instance of a ModifiedDate. In fact the MIRIAM annotation expects zero or more modified dates and thus the implementation was changed. To avoid impacting on existing code there is a ditinction between the function ModelHistory_getModifiedDate which requires no index value and this function that indexes into a list.
unsigned int ModelHistory_getNumCreators ( ModelHistory_t *  mh)

Get the number of ModelCreator objects in this ModelHistory.

Parameters
mhthe ModelHistory_t structure
Returns
the number of ModelCreators in this ModelHistory.
unsigned int ModelHistory_getNumModifiedDates ( ModelHistory_t *  mh)

Get the number of modified Date objects in the list of ModifiedDates in this ModelHistory.

Parameters
mhthe ModelHistory_t structure
Returns
the number of Dates in the list of ModifiedDates in this ModelHistory.
int ModelHistory_hasRequiredAttributes ( ModelHistory_t *  mh)
int ModelHistory_isSetCreatedDate ( ModelHistory_t *  mh)

Predicate indicating whether this ModelHistory's createdDate is set.

Parameters
mhthe ModelHistory_t structure to be queried
Returns
true (non-zero) if the createdDate of this ModelHistory_t structure is set, false (0) otherwise.
int ModelHistory_isSetModifiedDate ( ModelHistory_t *  mh)

Predicate indicating whether this ModelHistory's modifiedDate is set.

Parameters
mhthe ModelHistory_t structure to be queried
Returns
true (non-zero) if the modifiedDate of this ModelHistory_t structure is set, false (0) otherwise.
int ModelHistory_setCreatedDate ( ModelHistory_t *  mh,
Date_t *  date 
)

Sets the createdDate.

Parameters
mhthe ModelHistory_t structure
datethe Date_t structure representing the date the ModelHistory was created.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
int ModelHistory_setModifiedDate ( ModelHistory_t *  mh,
Date_t *  date 
)

Sets the modifiedDate.

Parameters
mhthe ModelHistory_t structure
datethe Date_t structure representing the date the ModelHistory was modified.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT