1 /**
2  * @file    Reaction.h
3  * @brief   Definitions of Reaction and ListOfReactions.
4  * @author  Ben Bornstein
5  *
6  * <!--------------------------------------------------------------------------
7  * This file is part of libSBML.  Please visit http://sbml.org for more
8  * information about SBML, and the latest version of libSBML.
9  *
10  * Copyright (C) 2020 jointly by the following organizations:
11  *     1. California Institute of Technology, Pasadena, CA, USA
12  *     2. University of Heidelberg, Heidelberg, Germany
13  *     3. University College London, London, UK
14  *
15  * Copyright (C) 2019 jointly by the following organizations:
16  *     1. California Institute of Technology, Pasadena, CA, USA
17  *     2. University of Heidelberg, Heidelberg, Germany
18  *
19  * Copyright (C) 2013-2018 jointly by the following organizations:
20  *     1. California Institute of Technology, Pasadena, CA, USA
21  *     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
22  *     3. University of Heidelberg, Heidelberg, Germany
23  *
24  * Copyright (C) 2009-2013 jointly by the following organizations:
25  *     1. California Institute of Technology, Pasadena, CA, USA
26  *     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
27  *
28  * Copyright (C) 2006-2008 by the California Institute of Technology,
29  *     Pasadena, CA, USA
30  *
31  * Copyright (C) 2002-2005 jointly by the following organizations:
32  *     1. California Institute of Technology, Pasadena, CA, USA
33  *     2. Japan Science and Technology Agency, Japan
34  *
35  * This library is free software; you can redistribute it and/or modify it
36  * under the terms of the GNU Lesser General Public License as published by
37  * the Free Software Foundation.  A copy of the license agreement is provided
38  * in the file named "LICENSE.txt" included with this software distribution
39  * and also available online as http://sbml.org/software/libsbml/license.html
40  * ------------------------------------------------------------------------ -->
41  *
42  * @class Reaction
43  * @sbmlbrief{core} An SBML reaction between species in an SBML model.
44  *
45  * A @em reaction represents any transformation, transport or binding
46  * process, typically a chemical reaction, that can change the quantity of
47  * one or more species.  In SBML, a reaction is defined primarily in terms
48  * of the participating reactants and products (and their corresponding
49  * stoichiometries), along with optional modifier species, an optional rate
50  * at which the reaction takes place, and optional parameters.
51  *
52  * As with other major objects in SBML, Reaction has a mandatory attribute,
53  * "id", used to give the reaction an identifier.  The identifier
54  * must be a text string conforming to the identifer syntax permitted in
55  * SBML.  In SBML Level&nbsp;2 and Level&nbsp;3, the reaction "id"
56  * identifier can be used in mathematical formulas elsewhere in an SBML
57  * model to represent the rate of that reaction; this usage is explained
58  * below.  Reaction also has an optional "name" attribute, of type
59  * @c string.  The "id" and "name" must be used according to the guidelines
60  * described in the SBML specification.
61  *
62  * The species participating as reactants, products, and/or modifiers in a
63  * reaction are declared using lists of SpeciesReference and/or
64  * ModifierSpeciesReference instances stored in subelements
65  * "listOfReactants", "listOfProducts" and "listOfModifiers".  Certain
66  * restrictions are placed on the appearance of species in reaction
67  * definitions:
68  * <ul>
69  * <li> The ability of a species to appear as a reactant or product of any
70  * reaction in a model is governed by certain flags in that species'
71  * definition; see the definition of Species for more information.
72  *
73  * <li> Any species appearing in the mathematical formula of the subelement
74  * "kineticLaw" (described below) of a Reaction must be declared in at
75  * least one of that Reaction's lists of reactants, products, and/or
76  * modifiers.  Put another way, it is an error for a reaction's kinetic law
77  * formula to refer to species that have not been declared for that
78  * reaction.
79  *
80  * <li> For SBML Levels 1, 2, and SBML Level&nbsp;3 Version&nbsp;1, a
81  * reaction definition can contain an empty list of reactants
82  * <em>or</em> an empty list of products, but it must have at least one
83  * reactant or product; in other words, a reaction without any reactant or
84  * product species is not permitted.  (This restriction does not apply to
85  * modifier species, which remain optional in all cases.)  In SBML
86  * Level&nbsp;3 Version&nbsp;2, this requirement was dropped, allowing
87  * the creation of reactions with neither reactants nor products.
88  * </ul>
89  *
90  * A reaction can contain up to one KineticLaw object in a subelement named
91  * "kineticLaw".  It defines the speed at which the process defined by the
92  * reaction takes place.  The description of KineticLaw provides more
93  * details about its use.  Note that although the inclusion of a KineticLaw
94  * object in an instance of a Reaction component is optional, there is no
95  * useful default that can be substituted in place of a missing rate
96  * expression in a reaction.  Moreover, a reaction's rate cannot be defined
97  * in any other way in SBML---InitialAssignment, AssignmentRule,
98  * RateRule, AlgebraicRule, Event, and other constructs in SBML cannot be
99  * used to set the reaction rate separately.  Nevertheless, for some
100  * modeling applications, reactions without any defined rate can be
101  * perfectly acceptable.
102  *
103  * Reaction also has a boolean attribute named "reversible" for indicating
104  * whether the reaction is reversible.  This attribute is optional in SBML
105  * Level&nbsp;2, with a default of @c true; it is mandatory in SBML
106  * Level&nbsp;3 (with no default value).  To say that a reaction is @em
107  * reversible is to say it can proceed in either the forward or the reverse
108  * direction.  Although the reversibility of a reaction can sometimes be
109  * deduced by inspecting its rate expression, this is not always the case,
110  * especially for complicated expressions.  Moreover, the need in SBML to
111  * allow rate expressions (i.e., KineticLaw) to be optional leads to the
112  * need for a separate flag indicating reversibility.  Note that labeling a
113  * reaction as irreversible is an assertion that the reaction always
114  * proceeds in the given forward direction.  (Why else would it be flagged
115  * as irreversible?)  This implies the rate expression in the KineticLaw
116  * always has a non-negative value during simulations.  Software tools
117  * could provide a means of optionally testing that this condition holds.
118  * The presence of reversibility information in two places (i.e., the rate
119  * expression and the "reversible" attribute on Reaction) leaves open the
120  * possibility that a model could contain contradictory information, but
121  * the creation of such a model would be an error on the part of the
122  * software generating it.
123  *
124  * The Reaction object class has another boolean attribute called "fast".
125  * This attribute is optional in SBML Level&nbsp;2, with a default of
126  * @c false; it is mandatory in SBML Level&nbsp;3 (with no default value).
127  * In SBML Level&nbsp;3 Version&nbsp;2, a value of @c true for the "fast"
128  * attribute is deprecated in favor of all reactions having a "fast" value
129  * of @c false.  It
130  * is used to indicate that a reaction occurs on a vastly faster time scale
131  * than others in a system.  Readers are directed to the SBML Level&nbsp;2
132  * Version&nbsp;4 specification, which provides more detail about the
133  * conditions under which a reaction can be considered to be fast in this
134  * sense.  SBML Level&nbsp;1
135  * and Level&nbsp;2 Version&nbsp;1 incorrectly claimed that software tools
136  * could ignore this attribute if they did not implement support for the
137  * corresponding concept; however, further research in SBML has revealed
138  * that this is not true, and "fast" <em>cannot be ignored</em> if it is
139  * set to @c true.  SBML Level&nbsp;2 Versions&nbsp;2&ndash;4 therefore
140  * stipulate that if a model has any reactions with "fast" set to @c true,
141  * a software tool must be able to respect the attribute or else indicate
142  * to the user that it does not have the capacity to do so.  Analysis
143  * software cannot ignore the value of the "fast" attribute because doing
144  * so may lead to different results as compared to a software system that
145  * <em>does</em> make use of "fast".
146  *
147  * @copydetails doc_fast_attribute_removed
148  *
149  * In SBML Level&nbsp;3, the Reaction object has an
150  * additional optional attribute named "compartment", whose value must be
151  * the identifier of a compartment defined in the enclosing Model object.
152  * The "compartment" attribute can be used to indicate the compartment in
153  * which the reaction is assumed to take place.  If the attribute is
154  * present, its value must be the identifier of a Compartment object
155  * defined in the enclosing Model object.  Similar to the "reversible"
156  * attribute, the value of the "compartment" attribute has no direct impact
157  * on the construction of mathematical equations for the SBML model.  When
158  * a kinetic law is given for a reaction, the compartment location may
159  * already be implicit in the kinetic law (although this cannot always be
160  * guaranteed).  Nevertheless, software tools may find the "compartment"
161  * attribute value useful for such purposes as analyzing the structure of
162  * the model, guiding the modeler in constructing correct rate formulas,
163  * and visualization purposes.
164  *
165  * Readers are urged to read the SBML specification for more details about
166  * the proper use of Reaction.
167  *
168  *
169  * <!-- ------------------------------------------------------------------- -->
170  * @class ListOfReactions
171  * @sbmlbrief{core} A list of Reaction objects.
172  *
173  * @copydetails doc_what_is_listof
174  */
175 
176 /**
177  * <!-- ~ ~ ~ ~ ~ Start of common documentation strings ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
178  * The following text is used as common documentation blocks copied multiple
179  * times elsewhere in this file.  The use of @class is a hack needed because
180  * Doxygen's @copydetails command has limited functionality.  Symbols
181  * beginning with "doc_" are marked as ignored in our Doxygen configuration.
182  * ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~  -->
183  *
184  * @class doc_warning_reaction_cant_ignore_fast
185  *
186  * @warning <span class="warning">SBML definitions before SBML Level&nbsp;2
187  * Version&nbsp;2 incorrectly indicated that software tools could ignore the
188  * "fast" attribute if they did not implement support for the corresponding
189  * concept; however, further research in SBML has revealed that this is not
190  * true, and "fast" <em>cannot be ignored</em> if it is set to @c true.
191  * Beginning with SBML Level&nbsp;2 Versions&nbsp;2, the SBML specifications
192  * therefore stipulate that if a model has any reactions with "fast" set to
193  * @c true, a software tool must be able to respect the attribute or else
194  * indicate to the user that it does not have the capacity to do so.  Readers
195  * are directed to the SBML specifications, which provides more detail about
196  * the conditions under which a reaction can be considered to be fast in this
197  * sense.</span>
198  *
199  */
200 
201 #ifndef Reaction_h
202 #define Reaction_h
203 
204 
205 #include <sbml/common/sbmlfwd.h>
206 
207 
208 #ifdef __cplusplus
209 
210 
211 #include <string>
212 
213 #include <sbml/SBase.h>
214 #include <sbml/ListOf.h>
215 #include <sbml/SpeciesReference.h>
216 
217 LIBSBML_CPP_NAMESPACE_BEGIN
218 
219 class KineticLaw;
220 class SBMLVisitor;
221 
222 
223 class LIBSBML_EXTERN Reaction : public SBase
224 {
225 public:
226 
227   /**
228    * Creates a new Reaction using the given SBML @p level and @p version
229    * values.
230    *
231    * @param level an unsigned int, the SBML Level to assign to this Reaction.
232    *
233    * @param version an unsigned int, the SBML Version to assign to this
234    * Reaction.
235    *
236    * @copydetails doc_throw_exception_lv
237    *
238    * @copydetails doc_note_setting_lv
239    */
240   Reaction (unsigned int level, unsigned int version);
241 
242 
243   /**
244    * Creates a new Reaction using the given SBMLNamespaces object
245    * @p  sbmlns.
246    *
247    * @copydetails doc_what_are_sbmlnamespaces
248    *
249    * @param sbmlns an SBMLNamespaces object.
250    *
251    * @copydetails doc_throw_exception_namespace
252    *
253    * @copydetails doc_note_setting_lv
254    */
255   Reaction (SBMLNamespaces* sbmlns);
256 
257 
258   /**
259    * Destroys this Reaction.
260    */
261   virtual ~Reaction ();
262 
263 
264   /**
265    * Copy constructor; creates a copy of this Reaction.
266    *
267    * @param orig the object to copy.
268    */
269   Reaction (const Reaction& orig);
270 
271 
272   /**
273    * Assignment operator for Reaction.
274    *
275    * @param rhs the object whose values are used as the basis of the
276    * assignment.
277    */
278   Reaction& operator=(const Reaction& rhs);
279 
280 
281   /** @cond doxygenLibsbmlInternal */
282   /**
283    * Accepts the given SBMLVisitor for this instance of Reaction.
284    *
285    * @param v the SBMLVisitor instance to be used.
286    *
287    * @return the result of calling <code>v.visit()</code>.
288    */
289   virtual bool accept (SBMLVisitor& v) const;
290   /** @endcond */
291 
292 
293   /**
294    * Creates and returns a deep copy of this Reaction object.
295    *
296    * @return the (deep) copy of this Reaction object.
297    */
298   virtual Reaction* clone () const;
299 
300 
301    /**
302    * Returns the first child element found that has the given @p id in the
303    * model-wide SId namespace, or @c NULL if no such object is found.
304    *
305    * @param id string representing the id of the object to find.
306    *
307    * @return pointer to the first element found with the given @p id.
308    */
309   virtual SBase* getElementBySId(const std::string& id);
310 
311 
312   /**
313    * Returns the first child element it can find with the given @p metaid, or
314    * @c NULL if no such object is found.
315    *
316    * @param metaid string representing the metaid of the object to find.
317    *
318    * @return pointer to the first element found with the given @p metaid.
319    */
320   virtual SBase* getElementByMetaId(const std::string& metaid);
321 
322 
323   /**
324    * Returns a List of all child SBase objects, including those nested to an
325    * arbitrary depth
326    *
327    * @param filter a pointer to an ElementFilter, which causes the function
328    * to return only elements that match a particular set of constraints.
329    * If NULL (the default), the function will return all child objects.
330    *
331    * @return a List of pointers to all children objects.
332    */
333   virtual List* getAllElements(ElementFilter* filter=NULL);
334 
335 
336   /**
337    * @copydoc doc_renamesidref_common
338    */
339   virtual void renameSIdRefs(const std::string& oldid, const std::string& newid);
340 
341 
342   /**
343    * Initializes the fields of this Reaction object to "typical" default
344    * values.
345    *
346    * The SBML Reaction component has slightly different aspects and
347    * default attribute values in different SBML Levels and Versions.
348    * This method sets the values to certain common defaults, based
349    * mostly on what they are in SBML Level&nbsp;2.  Specifically:
350    *
351    * @li Sets the "reversible" attribute to @c true
352    * @li Sets the "fast" attribute to @c false
353    * @li Marks the "fast" attribute as @em not having been set for
354    *     SBML Level&nbsp;2, but @em as having been set for
355    *     SBML Level&nbsp;1 and SBML Level&nbsp;3.
356    *
357    * @copydetails doc_warning_reaction_cant_ignore_fast
358    */
359   void initDefaults ();
360 
361 
362   /**
363    * Returns the value of the "id" attribute of this Reaction.
364    *
365    * @note Because of the inconsistent behavior of this function with
366    * respect to assignments and rules, it is now recommended to
367    * use the getIdAttribute() function instead.
368    *
369    * @copydetails doc_id_attribute
370    *
371    * @return the id of this Reaction.
372    *
373    * @see getIdAttribute()
374    * @see setIdAttribute(const std::string& sid)
375    * @see isSetIdAttribute()
376    * @see unsetIdAttribute()
377    */
378   virtual const std::string& getId () const;
379 
380 
381   /**
382    * Returns the value of the "name" attribute of this Reaction object.
383    *
384    * @copydetails doc_get_name
385    */
386   virtual const std::string& getName () const;
387 
388 
389   /**
390    * Returns the KineticLaw object contained in this Reaction.
391    *
392    * @return the KineticLaw instance.
393    */
394   const KineticLaw* getKineticLaw () const;
395 
396 
397   /**
398    * Returns the KineticLaw object contained in this Reaction.
399    *
400    * @return the KineticLaw instance.
401    */
402   KineticLaw* getKineticLaw ();
403 
404 
405   /**
406    * Returns the value of the "reversible" attribute on the Reaction as a
407    * boolean value.
408    *
409    * @return the reversibility status of this Reaction.
410    */
411   bool getReversible () const;
412 
413 
414   /**
415    * Returns the value of the "fast" attribute of this Reaction.
416    *
417    * @copydetails doc_fast_attribute_removed
418    *
419    * @return the "fast" status of this Reaction.
420    *
421    * @copydetails doc_warning_reaction_cant_ignore_fast
422    */
423   bool getFast () const;
424 
425 
426   /**
427    * (SBML Level&nbsp;3 only) Returns the value of the "compartment"
428    * attribute on the Reaction.
429    *
430    * @return the compartment of this Reaction.
431    *
432    * @note The "compartment" attribute is available in SBML Level&nbsp;3,
433    * but is not present on Reaction in lower Levels of
434    * SBML.
435    */
436   const std::string& getCompartment () const;
437 
438 
439   /**
440    * Predicate returning @c true if this
441    * Reaction's "id" attribute is set.
442    *
443    * @copydetails doc_isset_id
444    */
445   virtual bool isSetId () const;
446 
447 
448   /**
449    * Predicate returning @c true if this
450    * Reaction's "name" attribute is set.
451    *
452    * @copydetails doc_isset_name
453    */
454   virtual bool isSetName () const;
455 
456 
457   /**
458    * Predicate returning @c true if this
459    * Reaction contains a kinetic law object.
460    *
461    * @return @c true if a KineticLaw is present in this Reaction,, @c false
462    * otherwise.
463    */
464   bool isSetKineticLaw () const;
465 
466 
467   /**
468    * Predicate returning @c true if the value of
469    * the "fast" attribute on this Reaction is set.
470    *
471    * @copydetails doc_fast_attribute_removed
472    *
473    * @return @c true if the "fast" attribute is set, @c false otherwise.
474    *
475    * @copydetails doc_warning_reaction_cant_ignore_fast
476    */
477   bool isSetFast () const;
478 
479 
480   /**
481    * Predicate returning @c true if this
482    * Reaction's "compartment" attribute is set.
483    *
484    * @return @c true if the "compartment" attribute of this Reaction is
485    * set, @c false otherwise.
486    *
487    * @note The "compartment" attribute is available in SBML
488    * Level&nbsp;3, but is not present on Reaction in
489    * lower Levels of SBML.
490    */
491   bool isSetCompartment () const;
492 
493 
494   /**
495    * Predicate returning @c true if this
496    * Reaction's "reversible" attribute is set.
497    *
498    * @return @c true if the "reversible" attribute of this Reaction is
499    * set, @c false otherwise.
500    */
501   bool isSetReversible () const;
502 
503 
504   /**
505    * Sets the value of the "id" attribute of this Reaction.
506    *
507    * @copydetails doc_set_id
508    */
509   virtual int setId(const std::string& sid);
510 
511 
512   /**
513    * Sets the value of the "name" attribute of this Reaction.
514    *
515    * @copydetails doc_set_name
516    */
517   virtual int setName (const std::string& name);
518 
519 
520   /**
521    * Sets the "kineticLaw" subelement of this Reaction to a copy of the
522    * given KineticLaw object.
523    *
524    * @param kl the KineticLaw object to use.
525    *
526    * @copydetails doc_returns_success_code
527    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
528    * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
529    * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
530   */
531   int setKineticLaw (const KineticLaw* kl);
532 
533 
534   /**
535    * Sets the value of the "reversible" attribute of this Reaction.
536    *
537    * @param value the value of the "reversible" attribute.
538    *
539    * @copydetails doc_returns_success_code
540    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
541    */
542   int setReversible (bool value);
543 
544 
545   /**
546    * Sets the value of the "fast" attribute of this Reaction.
547    *
548    * @copydetails doc_fast_attribute_removed
549    *
550    * Calling this function with an argument of @c true for an
551    * SBML Level&nbsp;3 Version&nbsp;2 Reaction will not set
552    * the value, as the attribute does not exist for that level/version.
553    * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
554    *
555    * @param value the value of the "fast" attribute.
556    *
557    * @copydetails doc_returns_success_code
558    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
559    * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
560    *
561    * @copydetails doc_warning_reaction_cant_ignore_fast
562    */
563   int setFast (bool value);
564 
565 
566   /**
567    * Sets the value of the "compartment" attribute of this Reaction.
568    *
569    * The string @p sid is copied.
570    *
571    * @param sid the string to use as the compartment of this Reaction.
572    *
573    * @copydetails doc_returns_success_code
574    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
575    * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
576    * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}
577    *
578    * @note The "compartment" attribute is available in SBML
579    * Level&nbsp;3, but is not present on Reaction in
580    * lower Levels of SBML.
581    */
582   int setCompartment (const std::string& sid);
583 
584 
585   /**
586    * Unsets the value of the "name" attribute of this Reaction.
587    *
588    * @copydetails doc_unset_name
589    */
590   virtual int unsetName ();
591 
592 
593   /**
594    * Unsets the "kineticLaw" subelement of this Reaction.
595    *
596    * @copydetails doc_returns_success_code
597    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
598    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
599    */
600   int unsetKineticLaw ();
601 
602 
603   /**
604    * Unsets the value of the "fast" attribute of this Reaction.
605    *
606    * @copydetails doc_fast_attribute_removed
607    *
608    * @copydetails doc_returns_success_code
609    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
610    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
611    * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
612    *
613    * @copydetails doc_warning_reaction_cant_ignore_fast
614    */
615   int unsetFast ();
616 
617 
618   /**
619    * Unsets the value of the "compartment" attribute of this Reaction.
620    *
621    * @copydetails doc_returns_success_code
622    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
623    * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
624    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
625    *
626    * @note The "compartment" attribute is available in SBML
627    * Level&nbsp;3, but is not present on Reaction in
628    * lower Levels of SBML.
629    */
630   int unsetCompartment ();
631 
632 
633   /**
634    * Unsets the value of the "reversible" attribute of this Reaction.
635    *
636    * @copydetails doc_returns_success_code
637    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
638    * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
639    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
640    */
641   int unsetReversible ();
642 
643 
644   /**
645    * Adds a given SpeciesReference object as a reactant in this Reaction.
646    *
647    * The SpeciesReference instance in @p sr is copied.
648    *
649    * @param sr a SpeciesReference object referring to a Species in the
650    * enclosing Model.
651    *
652    * @copydetails doc_returns_success_code
653    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
654    * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
655    * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
656    * @li @sbmlconstant{LIBSBML_DUPLICATE_OBJECT_ID, OperationReturnValues_t}
657    * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t}
658    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
659    *
660    * @copydetails doc_note_object_is_copied
661    *
662    * @see createReactant()
663    */
664   int addReactant (const SpeciesReference* sr);
665 
666   /**
667    * Adds the given species as a reactant with the given stoichiometry
668    *
669    * @param species the species to be added as reactant.
670    *
671    * @param stoichiometry an optional parameter specifying the
672    *        stoichiometry of the added reactant (defaulting to 1).
673    *
674    * @param id an optional id to be given to the species reference that will
675    *        be created. (defaulting to empty string, i.e. not set).
676    *
677    * @param constant an attribute specifying whether the species reference is
678    *        constant or not (defaulting to true).
679    *
680    * @copydetails doc_returns_success_code
681    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
682    * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t}
683    * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}
684    * @li @sbmlconstant{LIBSBML_DUPLICATE_OBJECT_ID, OperationReturnValues_t}
685    *
686    * @copydetails doc_note_object_is_copied
687    *
688    * @note the Species object itself is NOT added to the model
689    *
690    * @see createProduct()
691    */
692   int addReactant(const Species* species,
693                   double stoichiometry = 1.0,
694                   const std::string id = "",
695                   bool constant = true);
696 
697   /**
698    * Adds a given SpeciesReference object as a product in this Reaction.
699    *
700    * The SpeciesReference instance in @p sr is copied.
701    *
702    * @param sr a SpeciesReference object referring to a Species in the
703    * enclosing Model.
704    *
705    * @copydetails doc_returns_success_code
706    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
707    * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
708    * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
709    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
710    *
711    * @copydetails doc_note_object_is_copied
712    *
713    * @see createProduct()
714    */
715   int addProduct (const SpeciesReference* sr);
716 
717   /**
718    * Adds the given species as a product with the given stoichiometry
719    *
720    * @param species the species to be added as product.
721    *
722    * @param stoichiometry an optional parameter specifying the
723    *        stoichiometry of the added product (defaulting to 1).
724    *
725    * @param id an optional id to be given to the species reference that will
726    *        be created. (defaulting to empty string, i.e. not set).
727    *
728    * @param constant an attribute specifying whether the species reference is
729    *        constant or not (defaulting to true).
730    *
731    * @copydetails doc_returns_success_code
732    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
733    * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t}
734    * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}
735    * @li @sbmlconstant{LIBSBML_DUPLICATE_OBJECT_ID, OperationReturnValues_t}
736    *
737    * @copydetails doc_note_object_is_copied
738    *
739    * @note the Species object itself is NOT added to the model
740    *
741    * @see createProduct()
742    */
743   int addProduct(const Species* species,
744                  double stoichiometry = 1.0,
745                  const std::string id = "",
746                  bool constant = true);
747 
748   /**
749    * Adds a given ModifierSpeciesReference object as a product in this
750    * Reaction.
751    *
752    * The ModifierSpeciesReference instance in @p msr is copied.
753    *
754    * @param msr a ModifierSpeciesReference object referring to a Species in
755    * the enclosing Model.
756    *
757    * @copydetails doc_returns_success_code
758    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
759    * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
760    * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
761    * @li @sbmlconstant{LIBSBML_DUPLICATE_OBJECT_ID, OperationReturnValues_t}
762    * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
763    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
764    *
765    * @copydetails doc_note_object_is_copied
766    *
767    * @see createModifier()
768    */
769   int addModifier (const ModifierSpeciesReference* msr);
770 
771   /**
772    * Adds the given species as a modifier to this reaction
773    *
774    * @param species the species to be added as modifier.
775    *
776    * @param id an optional id to be given to the species reference that will
777    *        be created. (defaulting to empty string, i.e. not set).
778    *
779    * @copydetails doc_returns_success_code
780    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
781    * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t}
782    * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}
783    * @li @sbmlconstant{LIBSBML_DUPLICATE_OBJECT_ID, OperationReturnValues_t}
784    *
785    * @copydetails doc_note_object_is_copied
786    *
787    * @note the Species object itself is NOT added to the model
788    *
789    * @see createModifier()
790    */
791   int addModifier(const Species *species,
792                   const std::string id = "");
793 
794   /**
795    * Creates a new SpeciesReference, adds it to this Reaction's list of
796    * reactants, and returns it.
797    *
798    * @return a new SpeciesReference object.
799    */
800   SpeciesReference* createReactant ();
801 
802 
803   /**
804    * Creates a new SpeciesReference, adds it to this Reaction's list of
805    * products, and returns it.
806    *
807    * @return a new SpeciesReference object.
808    */
809   SpeciesReference* createProduct ();
810 
811 
812   /**
813    * Creates a new ModifierSpeciesReference, adds it to this Reaction's
814    * list of modifiers and returns it.
815    *
816    * @return a new ModifierSpeciesReference object.
817    */
818   ModifierSpeciesReference* createModifier ();
819 
820 
821   /**
822    * Creates a new KineticLaw object, installs it as this Reaction's
823    * "kineticLaw" subelement, and returns it.
824    *
825    * If this Reaction had a previous KineticLaw, it will be destroyed.
826    *
827    * @return the new KineticLaw object.
828    */
829   KineticLaw* createKineticLaw ();
830 
831 
832   /**
833    * Returns the list of reactants in this Reaction object.
834    *
835    * @return the ListOfSpeciesReferences containing the references to the
836    * species acting as reactants in this reaction.
837    */
838   const ListOfSpeciesReferences* getListOfReactants () const;
839 
840 
841   /**
842    * Returns the list of reactants in this Reaction object.
843    *
844    * @return the ListOfSpeciesReferences containing the references to the
845    * species acting as reactants in this reaction.
846    */
847   ListOfSpeciesReferences* getListOfReactants ();
848 
849 
850   /**
851    * Returns the list of products in this Reaction object.
852    *
853    * @return the ListOfSpeciesReferences containing the references to the
854    * species acting as products in this reaction.
855    */
856   const ListOfSpeciesReferences* getListOfProducts () const;
857 
858 
859   /**
860    * Returns the list of products in this Reaction object.
861    *
862    * @return the ListOfSpeciesReferences containing the references to the
863    * species acting as products in this reaction.
864    */
865   ListOfSpeciesReferences* getListOfProducts ();
866 
867 
868   /**
869    * Returns the list of modifiers in this Reaction object.
870    *
871    * @return the ListOfSpeciesReferences containing the references to the
872    * species acting as modifiers in this reaction.
873    */
874   const ListOfSpeciesReferences* getListOfModifiers () const;
875 
876 
877   /**
878    * Returns the list of modifiers in this Reaction object.
879    *
880    * @return the ListOfSpeciesReferences containing the references to the
881    * species acting as modifiers in this reaction.
882    */
883   ListOfSpeciesReferences* getListOfModifiers ();
884 
885 
886   /**
887    * Returns the nth reactant species (as a SpeciesReference object) in
888    * the list of reactants in this Reaction.
889    *
890    * Callers should first call getNumReactants() to find out how many
891    * reactants there are, to avoid using an invalid index number.
892    *
893    * @param n the index of the reactant sought.
894    *
895    * @return the nth reactant (as a SpeciesReference object) of this
896    * Reaction.
897    * If the index @p n is invalid, @c NULL is returned.
898    */
899   const SpeciesReference* getReactant (unsigned int n) const;
900 
901 
902   /**
903    * Returns the nth reactant species (as a SpeciesReference object)
904    * in the list of reactants in this Reaction.
905    *
906    * Callers should first call getNumReactants() to find out how many
907    * reactants there are, to avoid using an invalid index number.
908    *
909    * @param n the index of the reactant sought.
910    *
911    * @return the nth reactant (as a SpeciesReference object) of this
912    * Reaction.
913    * If the index @p n is invalid, @c NULL is returned.
914    */
915   SpeciesReference* getReactant (unsigned int n);
916 
917 
918   /**
919    * Returns the reactant species (as a SpeciesReference object) having
920    * a specific identifier in this Reaction.
921    *
922    * @param species the identifier of the reactant Species ("species"
923    * attribute of the reactant SpeciesReference object).
924    *
925    * @return a SpeciesReference object, or @c NULL if no species with the
926    * given identifier @p species appears as a reactant in this Reaction.
927    */
928   const SpeciesReference* getReactant (const std::string& species) const;
929 
930 
931   /**
932    * Returns the reactant species (as a SpeciesReference object) having
933    * a specific identifier in this Reaction.
934    *
935    * @param species the identifier of the reactant Species ("species"
936    * attribute of the reactant SpeciesReference object).
937    *
938    * @return a SpeciesReference object, or @c NULL if no species with the
939    * given identifier @p species appears as a reactant in this Reaction.
940    */
941   SpeciesReference* getReactant (const std::string& species);
942 
943 
944   /**
945    * Returns the nth product species (as a SpeciesReference object) in
946    * the list of products in this Reaction.
947    *
948    * Callers should first call getNumProducts() to find out how many
949    * products there are, to avoid using an invalid index number.
950    *
951    * @param n the index of the product sought.
952    *
953    * @return the nth product (as a SpeciesReference object) of this
954    * Reaction.
955    * If the index @p n is invalid, @c NULL is returned.
956    */
957   const SpeciesReference* getProduct (unsigned int n) const;
958 
959 
960   /**
961    * Returns the nth product species (as a SpeciesReference object)
962    * in the list of products in this Reaction.
963    *
964    * Callers should first call getNumProducts() to find out how many
965    * products there are, to avoid using an invalid index number.
966    *
967    * @param n the index of the product sought.
968    *
969    * @return the nth product (as a SpeciesReference object) of this
970    * Reaction.
971    * If the index @p n is invalid, @c NULL is returned.
972    */
973   SpeciesReference* getProduct (unsigned int n);
974 
975 
976   /**
977    * Returns the product species (as a SpeciesReference object) having
978    * a specific identifier in this Reaction.
979    *
980    * @param species the identifier of the product Species ("species"
981    * attribute of the product SpeciesReference object).
982    *
983    * @return a SpeciesReference object, or @c NULL if no species with the
984    * given identifier @p species appears as a product in this Reaction.
985    */
986   const SpeciesReference* getProduct (const std::string& species) const;
987 
988 
989   /**
990    * Returns the product species (as a SpeciesReference object) having
991    * a specific identifier in this Reaction.
992    *
993    * @param species the identifier of the product Species ("species"
994    * attribute of the product SpeciesReference object).
995    *
996    * @return a SpeciesReference object, or @c NULL if no species with the
997    * given identifier @p species appears as a product in this Reaction.
998    */
999   SpeciesReference* getProduct (const std::string& species);
1000 
1001 
1002   /**
1003    * Returns the nth modifier species (as a ModifierSpeciesReference object)
1004    * in the list of modifiers of this Reaction.
1005    *
1006    * Callers should first call getNumModifiers() to find out how many
1007    * modifiers there are, to avoid using an invalid index number.
1008    *
1009    * @param n the index of the modifier species sought.
1010    *
1011    * @return the nth modifier (as a ModifierSpeciesReference object) of
1012    * this Reaction.
1013    * If the index @p n is invalid, @c NULL is returned.
1014    */
1015   const ModifierSpeciesReference* getModifier (unsigned int n) const;
1016 
1017 
1018   /**
1019    * Returns the nth modifier species (as a ModifierSpeciesReference object)
1020    * in the list of modifiers of this Reaction.
1021    *
1022    * Callers should first call getNumModifiers() to find out how many
1023    * modifiers there are, to avoid using an invalid index number.
1024    *
1025    * @param n the index of the modifier species sought.
1026    *
1027    * @return the nth modifier (as a ModifierSpeciesReference object) of
1028    * this Reaction.
1029    * If the index @p n is invalid, @c NULL is returned.
1030    */
1031   ModifierSpeciesReference* getModifier (unsigned int n);
1032 
1033 
1034   /**
1035    * Returns the modifier species (as a ModifierSpeciesReference object)
1036    * having a specific identifier in this Reaction.
1037    *
1038    * @param species the identifier of the modifier Species ("species"
1039    * attribute of the ModifierSpeciesReference object).
1040    *
1041    * @return a ModifierSpeciesReference object, or @c NULL if no species with
1042    * the given identifier @p species appears as a modifier in this
1043    * Reaction.
1044    */
1045   const ModifierSpeciesReference*
1046   getModifier (const std::string& species) const;
1047 
1048 
1049   /**
1050    * Returns the modifier species (as a ModifierSpeciesReference object)
1051    * having a specific identifier in this Reaction.
1052    *
1053    * @param species the identifier of the modifier Species ("species"
1054    * attribute of the ModifierSpeciesReference object).
1055    *
1056    * @return a ModifierSpeciesReference object, or @c NULL if no species with
1057    * the given identifier @p species appears as a modifier in this
1058    * Reaction.
1059    */
1060   ModifierSpeciesReference* getModifier (const std::string& species);
1061 
1062 
1063   /**
1064    * Returns the number of reactant species in this Reaction.
1065    *
1066    * @return the number of reactants in this Reaction.
1067    */
1068   unsigned int getNumReactants () const;
1069 
1070 
1071   /**
1072    * Returns the number of product species in this Reaction.
1073    *
1074    * @return the number of products in this Reaction.
1075    */
1076   unsigned int getNumProducts () const;
1077 
1078 
1079   /**
1080    * Returns the number of modifier species in this Reaction.
1081    *
1082    * @return the number of modifiers in this Reaction.
1083    */
1084   unsigned int getNumModifiers () const;
1085 
1086 
1087   /**
1088    * Removes the nth reactant species (SpeciesReference object) in the list of
1089    * reactants in this Reaction and returns a pointer to it.
1090    *
1091    * The caller owns the returned object and is responsible for deleting it.
1092    * The caller should first call getNumReactants() to find out how many
1093    * reactants there are, to avoid using an invalid index number.
1094    *
1095    * @param n the index of the reactant SpeciesReference object to remove.
1096    *
1097    * @return the removed reactant SpeciesReference object, or @c NULL if the
1098    * given index is out of range.
1099    */
1100   SpeciesReference* removeReactant (unsigned int n);
1101 
1102 
1103   /**
1104    * Removes the reactant species (SpeciesReference object) having the given
1105    * "species" attribute in this Reaction and returns a pointer to it.
1106    *
1107    * The caller owns the returned object and is responsible for deleting it.
1108    *
1109    * @param species the "species" attribute of the reactant SpeciesReference
1110    * object.
1111    *
1112    * @return the removed reactant SpeciesReference object, or @c NULL if no
1113    * reactant SpeciesReference object with the given "species" attribute
1114    * @p species exists in this Reaction.
1115    */
1116   SpeciesReference* removeReactant (const std::string& species);
1117 
1118 
1119   /**
1120    * Removes the nth product species (SpeciesReference object) in the list of
1121    * products in this Reaction and returns a pointer to it.
1122    *
1123    * The caller owns the returned object and is responsible for deleting it.
1124    * The caller should first call getNumProducts() to find out how many
1125    * products there are, to avoid using an invalid index number.
1126    *
1127    * @param n the index of the product SpeciesReference object to remove.
1128    *
1129    * @return the removed product SpeciesReference object, or @c NULL if the
1130    * given index is out of range.
1131    */
1132   SpeciesReference* removeProduct (unsigned int n);
1133 
1134 
1135   /**
1136    * Removes the product species (SpeciesReference object) having the given
1137    * "species" attribute in this Reaction and returns a pointer to it.
1138    *
1139    * The caller owns the returned object and is responsible for deleting it.
1140    *
1141    * @param species the "species" attribute of the product SpeciesReference
1142    * object.
1143    *
1144    * @return the removed product SpeciesReference object, or @c NULL if no
1145    * product SpeciesReference object with the given "species" attribute
1146    * @p species exists in this Reaction.
1147    */
1148   SpeciesReference* removeProduct (const std::string& species);
1149 
1150 
1151   /**
1152    * Removes the nth modifier species (ModifierSpeciesReference object) in
1153    * the list of  modifiers in this Reaction and returns a pointer to it.
1154    *
1155    * The caller owns the returned object and is responsible for deleting it.
1156    * The caller should first call getNumModifiers() to find out how many
1157    * modifiers there are, to avoid using an invalid index number.
1158    *
1159    * @param n the index of the ModifierSpeciesReference object to remove.
1160    *
1161    * @return the removed ModifierSpeciesReference object, or @c NULL if the
1162    * given index is out of range.
1163    */
1164   ModifierSpeciesReference* removeModifier (unsigned int n);
1165 
1166 
1167   /**
1168    * Removes the modifier species (ModifierSpeciesReference object) having
1169    * the given "species" attribute in this Reaction and returns a pointer to it.
1170    *
1171    * The caller owns the returned object and is responsible for deleting it.
1172    *
1173    * @param species the "species" attribute of the ModifierSpeciesReference
1174    * object.
1175    *
1176    * @return the removed ModifierSpeciesReference object, or @c NULL if no
1177    * ModifierSpeciesReference object with the given "species" attribute @p
1178    * species exists in this Reaction.
1179    */
1180   ModifierSpeciesReference* removeModifier (const std::string& species);
1181 
1182 
1183   /** @cond doxygenLibsbmlInternal */
1184   /**
1185    * Sets the parent SBMLDocument of this SBML object.
1186    */
1187   virtual void setSBMLDocument (SBMLDocument* d);
1188 
1189 
1190   /**
1191    * Sets this SBML object to child SBML objects (if any).
1192    * (Creates a child-parent relationship by the parent)
1193    *
1194    * Subclasses must override this function if they define
1195    * one ore more child elements.
1196    * Basically, this function needs to be called in
1197    * constructor, copy constructor and assignment operator.
1198    *
1199    * @see setSBMLDocument
1200    * @see enablePackageInternal
1201    */
1202   virtual void connectToChild ();
1203 
1204 
1205   /**
1206    * Enables/Disables the given package with this element and child
1207    * elements (if any).
1208    * (This is an internal implementation for enablePackage function)
1209    *
1210    * @note Subclasses of the SBML Core package in which one or more child
1211    * elements are defined must override this function.
1212    */
1213   virtual void enablePackageInternal(const std::string& pkgURI,
1214                                      const std::string& pkgPrefix, bool flag);
1215 
1216   /** @endcond */
1217 
1218   /** @cond doxygenLibsbmlInternal */
1219 
1220   virtual void updateSBMLNamespace(const std::string& package,
1221     unsigned int level, unsigned int version);
1222 
1223   /** @endcond */
1224 
1225 
1226   /**
1227    * Returns the libSBML type code for this SBML object.
1228    *
1229    * @copydetails doc_what_are_typecodes
1230    *
1231    * @return the SBML type code for this object:
1232    * @sbmlconstant{SBML_REACTION, SBMLTypeCode_t} (default).
1233    *
1234    * @copydetails doc_warning_typecodes_not_unique
1235    *
1236    * @see getElementName()
1237    * @see getPackageName()
1238    */
1239   virtual int getTypeCode () const;
1240 
1241 
1242   /**
1243    * Returns the XML element name of this object, which for Reaction, is
1244    * always @c "reaction".
1245    *
1246    * @return the name of this element, i.e., @c "reaction".
1247    */
1248   virtual const std::string& getElementName () const;
1249 
1250 
1251   /** @cond doxygenLibsbmlInternal */
1252   /**
1253    * Subclasses should override this method to write out their contained
1254    * SBML objects as XML elements.  Be sure to call your parent's
1255    * implementation of this method as well.
1256    */
1257   virtual void writeElements (XMLOutputStream& stream) const;
1258   /** @endcond */
1259 
1260 
1261   /**
1262    * Predicate returning @c true if all the required attributes for this
1263    * Reaction object have been set.
1264    *
1265    * The required attributes for a Reaction object are:
1266    * @li "id" (or "name" in SBML Level&nbsp;1)
1267    * @li "fast" (in Level&nbsp;3 Version&nbsp;1 only, where it is defined as a required attribute)
1268    * @li "reversible" (in Level&nbsp;3 only, where it is defined as a required attribute)
1269    *
1270    * @return @c true if the required attributes have been set, @c false
1271    * otherwise.
1272    */
1273   virtual bool hasRequiredAttributes() const ;
1274 
1275 
1276 
1277 
1278 
1279 
1280   #ifndef SWIG
1281 
1282 
1283 
1284   /** @cond doxygenLibsbmlInternal */
1285 
1286   /**
1287    * Returns the value of the "attributeName" attribute of this Reaction.
1288    *
1289    * @param attributeName, the name of the attribute to retrieve.
1290    *
1291    * @param value, the address of the value to record.
1292    *
1293    * @copydetails doc_returns_success_code
1294    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1295    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1296    */
1297   virtual int getAttribute(const std::string& attributeName, bool& value)
1298     const;
1299 
1300   /** @endcond */
1301 
1302 
1303 
1304   /** @cond doxygenLibsbmlInternal */
1305 
1306   /**
1307    * Returns the value of the "attributeName" attribute of this Reaction.
1308    *
1309    * @param attributeName, the name of the attribute to retrieve.
1310    *
1311    * @param value, the address of the value to record.
1312    *
1313    * @copydetails doc_returns_success_code
1314    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1315    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1316    */
1317   virtual int getAttribute(const std::string& attributeName, int& value) const;
1318 
1319   /** @endcond */
1320 
1321 
1322 
1323   /** @cond doxygenLibsbmlInternal */
1324 
1325   /**
1326    * Returns the value of the "attributeName" attribute of this Reaction.
1327    *
1328    * @param attributeName, the name of the attribute to retrieve.
1329    *
1330    * @param value, the address of the value to record.
1331    *
1332    * @copydetails doc_returns_success_code
1333    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1334    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1335    */
1336   virtual int getAttribute(const std::string& attributeName,
1337                            double& value) const;
1338 
1339   /** @endcond */
1340 
1341 
1342 
1343   /** @cond doxygenLibsbmlInternal */
1344 
1345   /**
1346    * Returns the value of the "attributeName" attribute of this Reaction.
1347    *
1348    * @param attributeName, the name of the attribute to retrieve.
1349    *
1350    * @param value, the address of the value to record.
1351    *
1352    * @copydetails doc_returns_success_code
1353    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1354    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1355    */
1356   virtual int getAttribute(const std::string& attributeName,
1357                            unsigned int& value) const;
1358 
1359   /** @endcond */
1360 
1361 
1362 
1363   /** @cond doxygenLibsbmlInternal */
1364 
1365   /**
1366    * Returns the value of the "attributeName" attribute of this Reaction.
1367    *
1368    * @param attributeName, the name of the attribute to retrieve.
1369    *
1370    * @param value, the address of the value to record.
1371    *
1372    * @copydetails doc_returns_success_code
1373    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1374    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1375    */
1376   virtual int getAttribute(const std::string& attributeName,
1377                            std::string& value) const;
1378 
1379   /** @endcond */
1380 
1381 
1382 
1383   /** @cond doxygenLibsbmlInternal */
1384 
1385   /**
1386    * Returns the value of the "attributeName" attribute of this Reaction.
1387    *
1388    * @param attributeName, the name of the attribute to retrieve.
1389    *
1390    * @param value, the address of the value to record.
1391    *
1392    * @copydetails doc_returns_success_code
1393    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1394    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1395    */
1396   //virtual int getAttribute(const std::string& attributeName,
1397   //                         const char* value) const;
1398 
1399   /** @endcond */
1400 
1401 
1402 
1403   /** @cond doxygenLibsbmlInternal */
1404 
1405   /**
1406    * Predicate returning @c true if this Reaction's attribute "attributeName"
1407    * is set.
1408    *
1409    * @param attributeName, the name of the attribute to query.
1410    *
1411    * @return @c true if this Reaction's attribute "attributeName" has been set,
1412    * otherwise @c false is returned.
1413    */
1414   virtual bool isSetAttribute(const std::string& attributeName) const;
1415 
1416   /** @endcond */
1417 
1418 
1419 
1420   /** @cond doxygenLibsbmlInternal */
1421 
1422   /**
1423    * Sets the value of the "attributeName" attribute of this Reaction.
1424    *
1425    * @param attributeName, the name of the attribute to set.
1426    *
1427    * @param value, the value of the attribute to set.
1428    *
1429    * @copydetails doc_returns_success_code
1430    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1431    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1432    */
1433   virtual int setAttribute(const std::string& attributeName, bool value);
1434 
1435   /** @endcond */
1436 
1437 
1438 
1439   /** @cond doxygenLibsbmlInternal */
1440 
1441   /**
1442    * Sets the value of the "attributeName" attribute of this Reaction.
1443    *
1444    * @param attributeName, the name of the attribute to set.
1445    *
1446    * @param value, the value of the attribute to set.
1447    *
1448    * @copydetails doc_returns_success_code
1449    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1450    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1451    */
1452   virtual int setAttribute(const std::string& attributeName, int value);
1453 
1454   /** @endcond */
1455 
1456 
1457 
1458   /** @cond doxygenLibsbmlInternal */
1459 
1460   /**
1461    * Sets the value of the "attributeName" attribute of this Reaction.
1462    *
1463    * @param attributeName, the name of the attribute to set.
1464    *
1465    * @param value, the value of the attribute to set.
1466    *
1467    * @copydetails doc_returns_success_code
1468    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1469    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1470    */
1471   virtual int setAttribute(const std::string& attributeName, double value);
1472 
1473   /** @endcond */
1474 
1475 
1476 
1477   /** @cond doxygenLibsbmlInternal */
1478 
1479   /**
1480    * Sets the value of the "attributeName" attribute of this Reaction.
1481    *
1482    * @param attributeName, the name of the attribute to set.
1483    *
1484    * @param value, the value of the attribute to set.
1485    *
1486    * @copydetails doc_returns_success_code
1487    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1488    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1489    */
1490   virtual int setAttribute(const std::string& attributeName,
1491                            unsigned int value);
1492 
1493   /** @endcond */
1494 
1495 
1496 
1497   /** @cond doxygenLibsbmlInternal */
1498 
1499   /**
1500    * Sets the value of the "attributeName" attribute of this Reaction.
1501    *
1502    * @param attributeName, the name of the attribute to set.
1503    *
1504    * @param value, the value of the attribute to set.
1505    *
1506    * @copydetails doc_returns_success_code
1507    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1508    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1509    */
1510   virtual int setAttribute(const std::string& attributeName,
1511                            const std::string& value);
1512 
1513   /** @endcond */
1514 
1515 
1516 
1517   /** @cond doxygenLibsbmlInternal */
1518 
1519   /**
1520    * Sets the value of the "attributeName" attribute of this Reaction.
1521    *
1522    * @param attributeName, the name of the attribute to set.
1523    *
1524    * @param value, the value of the attribute to set.
1525    *
1526    * @copydetails doc_returns_success_code
1527    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1528    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1529    */
1530   //virtual int setAttribute(const std::string& attributeName, const char*
1531   //  value);
1532 
1533   /** @endcond */
1534 
1535 
1536 
1537   /** @cond doxygenLibsbmlInternal */
1538 
1539   /**
1540    * Unsets the value of the "attributeName" attribute of this Reaction.
1541    *
1542    * @param attributeName, the name of the attribute to query.
1543    *
1544    * @copydetails doc_returns_success_code
1545    * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1546    * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1547    */
1548   virtual int unsetAttribute(const std::string& attributeName);
1549 
1550   /** @endcond */
1551 
1552 
1553 
1554   /** @cond doxygenLibsbmlInternal */
1555 
1556   /**
1557    * Creates and returns an new "elementName" object in this Reaction.
1558    *
1559    * @param elementName, the name of the element to create.
1560    *
1561    * @return pointer to the element created.
1562    */
1563   virtual SBase* createChildObject(const std::string& elementName);
1564 
1565   /** @endcond */
1566 
1567 
1568 
1569   /** @cond doxygenLibsbmlInternal */
1570 
1571   /**
1572   * Add a new "elementName" object to this Reaction.
1573   *
1574   * @param elementName, the name of the element to create.
1575   * @param element, pointer to the element to be added.
1576   *
1577   * @copydetails doc_returns_success_code
1578   * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
1579   * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
1580   */
1581   virtual int addChildObject(const std::string& elementName, const SBase* element);
1582 
1583   /** @endcond */
1584 
1585 
1586 
1587   /** @cond doxygenLibsbmlInternal */
1588 
1589   /**
1590   * Removes and returns the "elementName" object with the given id in this Reaction.
1591   *
1592   * @param elementName, the name of the element to remove.
1593   * @param id, the id of the element to remove
1594   *
1595   * @return pointer to the element removed.
1596   */
1597   virtual SBase* removeChildObject(const std::string& elementName, const std::string& id);
1598 
1599   /** @endcond */
1600 
1601 
1602   /** @cond doxygenLibsbmlInternal */
1603 
1604   /**
1605    * Returns the number of "elementName" in this Reaction.
1606    *
1607    * @param elementName, the name of the element to get number of.
1608    *
1609    * @return unsigned int number of elements.
1610    */
1611   virtual unsigned int getNumObjects(const std::string& elementName);
1612 
1613   /** @endcond */
1614 
1615 
1616 
1617   /** @cond doxygenLibsbmlInternal */
1618 
1619   /**
1620    * Returns the nth object of "objectName" in this Reaction.
1621    *
1622    * @param elementName, the name of the element to get number of.
1623    *
1624    * @param index, unsigned int the index of the object to retrieve.
1625    *
1626    * @return pointer to the object.
1627    */
1628   virtual SBase* getObject(const std::string& elementName, unsigned int index);
1629 
1630   /** @endcond */
1631 
1632 
1633 
1634 
1635   #endif /* !SWIG */
1636 
1637 
1638 protected:
1639   /** @cond doxygenLibsbmlInternal */
1640   /**
1641    * Create and return an SBML object of this class, if present.
1642    *
1643    * @return the SBML object corresponding to next XMLToken in the
1644    * XMLInputStream or @c NULL if the token was not recognized.
1645    */
1646   virtual SBase* createObject (XMLInputStream& stream);
1647 
1648 
1649   /**
1650    * Subclasses should override this method to get the list of
1651    * expected attributes.
1652    * This function is invoked from corresponding readAttributes()
1653    * function.
1654    */
1655   virtual void addExpectedAttributes(ExpectedAttributes& attributes);
1656 
1657 
1658   /**
1659    * Subclasses should override this method to read values from the given
1660    * XMLAttributes set into their specific fields.  Be sure to call your
1661    * parent's implementation of this method as well.
1662    */
1663   virtual void readAttributes (const XMLAttributes& attributes,
1664                                const ExpectedAttributes& expectedAttributes);
1665 
1666   void readL1Attributes (const XMLAttributes& attributes);
1667 
1668   void readL2Attributes (const XMLAttributes& attributes);
1669 
1670   void readL3Attributes (const XMLAttributes& attributes);
1671 
1672 
1673   /**
1674    * Subclasses should override this method to write their XML attributes
1675    * to the XMLOutputStream.  Be sure to call your parent's implementation
1676    * of this method as well.
1677    */
1678   virtual void writeAttributes (XMLOutputStream& stream) const;
1679 
isExplicitlySetReversible()1680   bool isExplicitlySetReversible() const { return mExplicitlySetReversible; };
isExplicitlySetFast()1681   bool isExplicitlySetFast() const { return mExplicitlySetFast; };
1682 
1683   //std::string mId;
1684   //std::string mName;
1685 
1686   ListOfSpeciesReferences  mReactants;
1687   ListOfSpeciesReferences  mProducts;
1688   ListOfSpeciesReferences  mModifiers;
1689 
1690   KineticLaw* mKineticLaw;
1691   bool        mReversible;
1692   bool        mFast;
1693 
1694   bool mIsSetFast;
1695   std::string mCompartment;
1696   bool mIsSetReversible;
1697 
1698   bool mExplicitlySetReversible;
1699   bool mExplicitlySetFast;
1700 
1701   /* the validator classes need to be friends to access the
1702    * protected constructor that takes no arguments
1703    */
1704   friend class Validator;
1705   friend class ConsistencyValidator;
1706   friend class IdentifierConsistencyValidator;
1707   friend class InternalConsistencyValidator;
1708   friend class L1CompatibilityValidator;
1709   friend class L2v1CompatibilityValidator;
1710   friend class L2v2CompatibilityValidator;
1711   friend class L2v3CompatibilityValidator;
1712   friend class L2v4CompatibilityValidator;
1713   friend class MathMLConsistencyValidator;
1714   friend class ModelingPracticeValidator;
1715   friend class OverdeterminedValidator;
1716   friend class SBOConsistencyValidator;
1717   friend class UnitConsistencyValidator;
1718 
1719   /** @endcond */
1720 };
1721 
1722 
1723 
1724 class LIBSBML_EXTERN ListOfReactions : public ListOf
1725 {
1726 public:
1727 
1728   /**
1729    * Creates a new ListOfReactions object.
1730    *
1731    * The object is constructed such that it is valid for the given SBML
1732    * Level and Version combination.
1733    *
1734    * @param level the SBML Level.
1735    *
1736    * @param version the Version within the SBML Level.
1737    *
1738    * @copydetails doc_throw_exception_lv
1739    *
1740    * @copydetails doc_note_setting_lv
1741    */
1742   ListOfReactions (unsigned int level, unsigned int version);
1743 
1744 
1745   /**
1746    * Creates a new ListOfReactions object.
1747    *
1748    * The object is constructed such that it is valid for the SBML Level and
1749    * Version combination determined by the SBMLNamespaces object in @p
1750    * sbmlns.
1751    *
1752    * @param sbmlns an SBMLNamespaces object that is used to determine the
1753    * characteristics of the ListOfReactions object to be created.
1754    *
1755    * @copydetails doc_throw_exception_namespace
1756    *
1757    * @copydetails doc_note_setting_lv
1758    */
1759   ListOfReactions (SBMLNamespaces* sbmlns);
1760 
1761 
1762   /**
1763    * Creates and returns a deep copy of this ListOfReactions object.
1764    *
1765    * @return the (deep) copy of this ListOfReactions object.
1766    */
1767   virtual ListOfReactions* clone () const;
1768 
1769 
1770   /**
1771    * Returns the libSBML type code for the objects contained in this ListOf
1772    * (i.e., Reaction objects, if the list is non-empty).
1773    *
1774    * @copydetails doc_what_are_typecodes
1775    *
1776    * @return the SBML type code for objects contained in this list:
1777    * @sbmlconstant{SBML_REACTION, SBMLTypeCode_t} (default).
1778    *
1779    * @see getElementName()
1780    * @see getPackageName()
1781    */
1782   virtual int getItemTypeCode () const;
1783 
1784 
1785   /**
1786    * Returns the XML element name of this object
1787    *
1788    * For ListOfReactions, the XML element name is @c "listOfReactions".
1789    *
1790    * @return the name of this element, i.e., @c "listOfReactions".
1791    */
1792   virtual const std::string& getElementName () const;
1793 
1794 
1795   /**
1796    * Get a Reaction from the ListOfReactions.
1797    *
1798    * @param n the index number of the Reaction to get.
1799    *
1800    * @return the nth Reaction in this ListOfReactions.
1801    * If the index @p n is invalid, @c NULL is returned.
1802    *
1803    * @see size()
1804    */
1805   virtual Reaction * get(unsigned int n);
1806 
1807 
1808   /**
1809    * Get a Reaction from the ListOfReactions.
1810    *
1811    * @param n the index number of the Reaction to get.
1812    *
1813    * @return the nth Reaction in this ListOfReactions.
1814    * If the index @p n is invalid, @c NULL is returned.
1815    *
1816    * @see size()
1817    */
1818   virtual const Reaction * get(unsigned int n) const;
1819 
1820 
1821   /**
1822    * Get a Reaction from the ListOfReactions based on its identifier.
1823    *
1824    * @param sid a string representing the identifier of the Reaction to get.
1825    *
1826    * @return Reaction in this ListOfReactions with the given @p sid or
1827    * @c NULL if no such Reaction exists.
1828    *
1829    * @see get(unsigned int n)
1830    * @see size()
1831    */
1832   virtual Reaction* get (const std::string& sid);
1833 
1834 
1835   /**
1836    * Get a Reaction from the ListOfReactions based on its identifier.
1837    *
1838    * @param sid a string representing the identifier of the Reaction to get.
1839    *
1840    * @return Reaction in this ListOfReactions with the given @p sid or
1841    * @c NULL if no such Reaction exists.
1842    *
1843    * @see get(unsigned int n)
1844    * @see size()
1845    */
1846   virtual const Reaction* get (const std::string& sid) const;
1847 
1848 
1849   /**
1850    * Removes the nth item from this ListOfReactions items and returns a
1851    * pointer to it.
1852    *
1853    * The caller owns the returned item and is responsible for deleting it.
1854    *
1855    * @param n the index of the item to remove.
1856    *
1857    * @see size()
1858    */
1859   virtual Reaction* remove (unsigned int n);
1860 
1861 
1862   /**
1863    * Removes item in this ListOfReactions items with the given identifier.
1864    *
1865    * The caller owns the returned item and is responsible for deleting it.
1866    * If none of the items in this list have the identifier @p sid, then
1867    * NULL is returned.
1868    *
1869    * @param sid the identifier of the item to remove.
1870    *
1871    * @return the item removed.  As mentioned above, the caller owns the
1872    * returned item.
1873    */
1874   virtual Reaction* remove (const std::string& sid);
1875 
1876 
1877   /** @cond doxygenLibsbmlInternal */
1878   /**
1879    * Return the position of this element.
1880    *
1881    * @return the ordinal position of the element with respect to its
1882    * siblings or -1 (default) to indicate the position is not significant.
1883    */
1884   virtual int getElementPosition () const;
1885 
1886   /** @endcond */
1887 
1888 
1889 protected:
1890   /** @cond doxygenLibsbmlInternal */
1891   /**
1892    * Create and return an SBML object of this class, if present.
1893    *
1894    * @return the SBML object corresponding to next XMLToken in the
1895    * XMLInputStream or @c NULL if the token was not recognized.
1896    */
1897   virtual SBase* createObject (XMLInputStream& stream);
1898 
1899   /** @endcond */
1900 };
1901 
1902 LIBSBML_CPP_NAMESPACE_END
1903 
1904 #endif  /* __cplusplus */
1905 
1906 
1907 #ifndef SWIG
1908 
1909 LIBSBML_CPP_NAMESPACE_BEGIN
1910 BEGIN_C_DECLS
1911 
1912 /**
1913  * Creates a new Reaction_t structure using the given SBML @p level
1914  * and @p version values.
1915  *
1916  * @param level an unsigned int, the SBML Level to assign to this
1917  * Reaction_t.
1918  *
1919  * @param version an unsigned int, the SBML Version to assign to this
1920  * Reaction_t.
1921  *
1922  * @return a pointer to the newly created Reaction_t structure.
1923  *
1924  * @copydetails doc_note_setting_lv
1925  *
1926  * @memberof Reaction_t
1927  */
1928 LIBSBML_EXTERN
1929 Reaction_t *
1930 Reaction_create (unsigned int level, unsigned int version);
1931 
1932 
1933 /**
1934  * Creates a new Reaction_t structure using the given
1935  * SBMLNamespaces_t structure.
1936  *
1937  * @param sbmlns SBMLNamespaces_t, a pointer to an SBMLNamespaces_t structure
1938  * to assign to this Reaction_t.
1939  *
1940  * @return a pointer to the newly created Reaction_t structure.
1941  *
1942  * @copydetails doc_note_setting_lv
1943  *
1944  * @memberof Reaction_t
1945  */
1946 LIBSBML_EXTERN
1947 Reaction_t *
1948 Reaction_createWithNS (SBMLNamespaces_t *sbmlns);
1949 
1950 
1951 /**
1952  * Frees the given Reaction_t.
1953  *
1954  * @memberof Reaction_t
1955  */
1956 LIBSBML_EXTERN
1957 void
1958 Reaction_free (Reaction_t *r);
1959 
1960 
1961 /**
1962  * @return a (deep) copy of this Reaction_t.
1963  *
1964  * @memberof Reaction_t
1965  */
1966 LIBSBML_EXTERN
1967 Reaction_t *
1968 Reaction_clone (const Reaction_t *r);
1969 
1970 
1971 /**
1972  * Initializes the fields of this Reaction_t to their defaults:
1973  *
1974  * The SBML Reaction component has slightly different aspects and
1975  * default attribute values in different SBML Levels and Versions.
1976  * This method sets the values to certain common defaults, based
1977  * mostly on what they are in SBML Level&nbsp;2.  Specifically:
1978  *
1979  * @li Sets the "reversible" attribute to @c true
1980  * @li Sets the "fast" attribute to @c false
1981  * @li Marks the "fast" attribute as @em not having been set for
1982  *     SBML Level&nbsp;2, but @em as having been set for
1983  *     SBML Level&nbsp;1 and SBML Level&nbsp;3.
1984  *
1985  * @copydetails doc_warning_reaction_cant_ignore_fast
1986  *
1987  * @memberof Reaction_t
1988  */
1989 LIBSBML_EXTERN
1990 void
1991 Reaction_initDefaults (Reaction_t *r);
1992 
1993 
1994 /**
1995  * Returns a list of XMLNamespaces_t associated with this Reaction_t
1996  * structure.
1997  *
1998  * @param r the Reaction_t structure.
1999  *
2000  * @return pointer to the XMLNamespaces_t structure associated with
2001  * this structure
2002  *
2003  * @memberof Reaction_t
2004  */
2005 LIBSBML_EXTERN
2006 const XMLNamespaces_t *
2007 Reaction_getNamespaces(Reaction_t *r);
2008 
2009 
2010 /**
2011  * @return the id of this Reaction_t.
2012  *
2013  * @memberof Reaction_t
2014  */
2015 LIBSBML_EXTERN
2016 const char *
2017 Reaction_getId (const Reaction_t *r);
2018 
2019 
2020 /**
2021  * @return the name of this Reaction_t.
2022  *
2023  * @memberof Reaction_t
2024  */
2025 LIBSBML_EXTERN
2026 const char *
2027 Reaction_getName (const Reaction_t *r);
2028 
2029 
2030 /**
2031  * @return the KineticLaw_t of this Reaction_t.
2032  *
2033  * @memberof Reaction_t
2034  */
2035 LIBSBML_EXTERN
2036 KineticLaw_t *
2037 Reaction_getKineticLaw (Reaction_t *r);
2038 
2039 
2040 /**
2041  * @return the reversible status of this Reaction_t.
2042  *
2043  * @memberof Reaction_t
2044  */
2045 LIBSBML_EXTERN
2046 int
2047 Reaction_getReversible (const Reaction_t *r);
2048 
2049 
2050 /**
2051  * @return the fast status of this Reaction_t.
2052  *
2053  * @copydetails doc_fast_attribute_removed
2054  *
2055  * @memberof Reaction_t
2056  */
2057 LIBSBML_EXTERN
2058 int
2059 Reaction_getFast (const Reaction_t *r);
2060 
2061 
2062 /**
2063  * @return the compartment of this Reaction_t.
2064  *
2065  * @memberof Reaction_t
2066  */
2067 LIBSBML_EXTERN
2068 const char *
2069 Reaction_getCompartment (const Reaction_t *r);
2070 
2071 
2072 /**
2073  * @return @c 1 (true) if the id of this Reaction_t is set,
2074  * @c 0 (false) otherwise.
2075  *
2076  * @memberof Reaction_t
2077  */
2078 LIBSBML_EXTERN
2079 int
2080 Reaction_isSetId (const Reaction_t *r);
2081 
2082 
2083 /**
2084  * @return @c 1 (true) if the name of this Reaction_t is set,
2085  * @c 0 (false) otherwise.
2086  *
2087  * @memberof Reaction_t
2088  */
2089 LIBSBML_EXTERN
2090 int
2091 Reaction_isSetName (const Reaction_t *r);
2092 
2093 
2094 /**
2095  * @return @c 1 (true) if the KineticLaw_t of this Reaction_t is set,
2096  * @c 0 (false) otherwise.
2097  *
2098  * @memberof Reaction_t
2099  */
2100 LIBSBML_EXTERN
2101 int
2102 Reaction_isSetKineticLaw (const Reaction_t *r);
2103 
2104 
2105 /**
2106  * @return @c 1 (true) if the fast status of this Reaction_t is set,
2107  * @c 0 (false) otherwise.
2108  *
2109  * In L1, fast is optional with a default of false, which means it is
2110  * effectively always set.  In L2, however, fast is optional with no
2111  * default value, so it may or may not be set to a specific value.
2112  *
2113  * @copydetails doc_fast_attribute_removed
2114  *
2115  * @memberof Reaction_t
2116  */
2117 LIBSBML_EXTERN
2118 int
2119 Reaction_isSetFast (const Reaction_t *r);
2120 
2121 
2122 /**
2123  * @return @c 1 (true) if the KineticLaw_t of this Reaction_t is set,
2124  * @c 0 (false) otherwise.
2125  *
2126  * @memberof Reaction_t
2127  */
2128 LIBSBML_EXTERN
2129 int
2130 Reaction_isSetCompartment (const Reaction_t *r);
2131 
2132 
2133 /**
2134  * @return @c 1 (true) if the reversible attribute of this Reaction_t is set,
2135  * @c 0 (false) otherwise.
2136  *
2137  * @memberof Reaction_t
2138  */
2139 LIBSBML_EXTERN
2140 int
2141 Reaction_isSetReversible (const Reaction_t *r);
2142 
2143 
2144 /**
2145  * Sets the id of this Reaction_t to a copy of @p sid.
2146  *
2147  * @copydetails doc_returns_success_code
2148  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2149  * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}
2150  *
2151  * @note Using this function with an @p sid of NULL is equivalent to
2152  * unsetting the "id" attribute.
2153  *
2154  * @memberof Reaction_t
2155  */
2156 LIBSBML_EXTERN
2157 int
2158 Reaction_setId (Reaction_t *r, const char *sid);
2159 
2160 
2161 /**
2162  * Sets the name of this Reaction_t to a copy of name.
2163  *
2164  * @copydetails doc_returns_success_code
2165  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2166  * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}
2167  *
2168  * @note Using this function with the name set to NULL is equivalent to
2169  * unsetting the "name" attribute.
2170  *
2171  * @memberof Reaction_t
2172  */
2173 LIBSBML_EXTERN
2174 int
2175 Reaction_setName (Reaction_t *r, const char *name);
2176 
2177 
2178 /**
2179  * Sets the KineticLaw_t of this Reaction_t to a copy of the given KineticLaw_t.
2180  *
2181  * @copydetails doc_returns_success_code
2182  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2183  * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
2184  * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
2185  *
2186  * @memberof Reaction_t
2187  */
2188 LIBSBML_EXTERN
2189 int
2190 Reaction_setKineticLaw (Reaction_t *r, const KineticLaw_t *kl);
2191 
2192 
2193 /**
2194  * Sets the reversible status of this Reaction_t to value (boolean).
2195  *
2196  * @copydetails doc_returns_success_code
2197  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2198  * @li @sbmlconstant{LIBSBML_INVALID_OBJECT, OperationReturnValues_t}
2199  *
2200  * @memberof Reaction_t
2201  */
2202 LIBSBML_EXTERN
2203 int
2204 Reaction_setReversible (Reaction_t *r, int value);
2205 
2206 
2207 /**
2208  * Sets the fast status of this Reaction_t to value (boolean).
2209  *
2210  * @copydetails doc_fast_attribute_removed
2211  *
2212  * @copydetails doc_returns_success_code
2213  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2214  * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
2215  *
2216  * @memberof Reaction_t
2217  */
2218 LIBSBML_EXTERN
2219 int
2220 Reaction_setFast (Reaction_t *r, int value);
2221 
2222 
2223 /**
2224  * Sets the compartment of this Reaction_t to a copy of compartment.
2225  *
2226  * @copydetails doc_returns_success_code
2227  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2228  * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
2229  * @li @sbmlconstant{LIBSBML_INVALID_ATTRIBUTE_VALUE, OperationReturnValues_t}
2230  *
2231  * @note Using this function with the compartment set to NULL is equivalent to
2232  * unsetting the "compartment" attribute.
2233  *
2234  * @memberof Reaction_t
2235  */
2236 LIBSBML_EXTERN
2237 int
2238 Reaction_setCompartment (Reaction_t *r, const char *compartment);
2239 
2240 
2241 /**
2242  * Unsets the name of this Reaction_t.
2243  *
2244  * @copydetails doc_returns_success_code
2245  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2246  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2247  *
2248  * @memberof Reaction_t
2249  */
2250 LIBSBML_EXTERN
2251 int
2252 Reaction_unsetName (Reaction_t *r);
2253 
2254 
2255 /**
2256  * Unsets the compartment of this Reaction_t.
2257  *
2258  * @copydetails doc_returns_success_code
2259  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2260  * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
2261  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2262  *
2263  * @memberof Reaction_t
2264  */
2265 LIBSBML_EXTERN
2266 int
2267 Reaction_unsetCompartment (Reaction_t *r);
2268 
2269 
2270 /**
2271  * Unsets the KineticLaw_t of this Reaction_t.
2272  *
2273  * @copydetails doc_returns_success_code
2274  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2275  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2276  *
2277  * @memberof Reaction_t
2278  */
2279 LIBSBML_EXTERN
2280 int
2281 Reaction_unsetKineticLaw (Reaction_t *r);
2282 
2283 
2284 /**
2285  * Unsets the fast status of this Reation_t.
2286  *
2287  * @copydetails doc_fast_attribute_removed
2288  *
2289  * @copydetails doc_returns_success_code
2290  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2291  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2292  * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
2293  *
2294  * In L1, fast is optional with a default of false, which means it is
2295  * effectively always set.  In L2, however, fast is optional with no
2296  * default value, so it may or may not be set to a specific value.
2297  *
2298  * @memberof Reaction_t
2299  */
2300 LIBSBML_EXTERN
2301 int
2302 Reaction_unsetFast (Reaction_t *r);
2303 
2304 
2305 /**
2306  * Unsets the reversible status of this Reaction_t.
2307  *
2308  * @copydetails doc_returns_success_code
2309  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2310  * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
2311  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2312  *
2313  * @memberof Reaction_t
2314  */
2315 LIBSBML_EXTERN
2316 int
2317 Reaction_unsetReversible (Reaction_t *r);
2318 
2319 
2320 /**
2321  * Predicate returning @c 1 (true) or @c 0 (false) depending on whether
2322  * all the required attributes for this Reaction_t structure
2323  * have been set.
2324  *
2325  * The required attributes for a Reaction_t structure are:
2326  * @li "id" (or "name" in SBML Level&nbsp;1)
2327  * @li "fast" (in Level&nbsp;3 Version&nbsp;1 only, where it is defined as a required attribute)
2328  * @li "reversible" (in Level&nbsp;3 only, where it is defined as a required attribute)
2329  *
2330  * @param r the Reaction_t structure to check.
2331  *
2332  * @return @c 1 (true) if all the required
2333  * attributes for this structure have been defined, @c 0 (false) otherwise.
2334  *
2335  * @memberof Reaction_t
2336  */
2337 LIBSBML_EXTERN
2338 int
2339 Reaction_hasRequiredAttributes (Reaction_t *r);
2340 
2341 
2342 /**
2343  * Adds a copy of the given reactant (SpeciesReference_t) to this Reaction_t.
2344  *
2345  * @copydetails doc_returns_success_code
2346  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2347  * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
2348  * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
2349  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2350  *
2351  * @memberof Reaction_t
2352  */
2353 LIBSBML_EXTERN
2354 int
2355 Reaction_addReactant (Reaction_t *r, const SpeciesReference_t *sr);
2356 
2357 
2358 /**
2359  * Adds a copy of the given product (SpeciesReference_t) to this Reaction_t.
2360  *
2361  * @copydetails doc_returns_success_code
2362  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2363  * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
2364  * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
2365  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2366  *
2367  * @memberof Reaction_t
2368  */
2369 LIBSBML_EXTERN
2370 int
2371 Reaction_addProduct (Reaction_t *r, const SpeciesReference_t *sr);
2372 
2373 
2374 /**
2375  * Adds a copy of the given modifier (modifier SpeciesReference_t) to this
2376  * Reaction_t.
2377  *
2378  * @copydetails doc_returns_success_code
2379  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2380  * @li @sbmlconstant{LIBSBML_UNEXPECTED_ATTRIBUTE, OperationReturnValues_t}
2381  * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
2382  * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
2383  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2384  *
2385  * @memberof Reaction_t
2386  */
2387 LIBSBML_EXTERN
2388 int
2389 Reaction_addModifier (Reaction_t *r, const SpeciesReference_t *msr);
2390 
2391 /**
2392  * Adds a copy of the given Species_t object as a reactant to this Reaction_t.
2393  *
2394  * @param r the Reaction_t structure to which the reactant is added.
2395  * @param s the Species_t structure to be added as reactant.
2396  * @param stoichiometry the stoichiometry of the added reactant.
2397  * @param id the string to be used as the id of the SpeciesReference_t that will
2398  *        be created.
2399  * @param constant an attribute specifying whether the created SpeciesReference_t is
2400  *        constant or not.
2401  *
2402  * @copydetails doc_returns_success_code
2403  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2404  * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
2405  * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
2406  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2407  *
2408  * @note the Species_t structure itself is NOT added to the model
2409  *
2410  * @memberof Reaction_t
2411  */
2412 LIBSBML_EXTERN
2413 int
2414 Reaction_addReactantBySpecies (Reaction_t *r, const Species_t *s,
2415                                double stoichiometry, const char *id,
2416                                int constant);
2417 
2418 
2419 /**
2420  * Adds a copy of the given Species_t object as a product to this Reaction_t.
2421  *
2422  * @param r the Reaction_t structure to which the product is added.
2423  * @param s the Species_t structure to be added as product.
2424  * @param stoichiometry the stoichiometry of the added product.
2425  * @param id the string to be used as the id of the SpeciesReference_t that will
2426  *        be created.
2427  * @param constant an attribute specifying whether the SpeciesReference_t is
2428  *        constant or not.
2429  *
2430  * @copydetails doc_returns_success_code
2431  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2432  * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
2433  * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
2434  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2435  *
2436  * @note the Species_t structure itself is NOT added to the model
2437  *
2438  * @memberof Reaction_t
2439  */
2440 LIBSBML_EXTERN
2441 int
2442 Reaction_addProductBySpecies (Reaction_t *r, const Species_t *s,
2443                                double stoichiometry, const char *id,
2444                                int constant);
2445 
2446 
2447 /**
2448  * Adds a copy of the given Species_t object as a modifier to this Reaction_t.
2449  *
2450  * @param r the Reaction_t structure to which the modifier is added.
2451  * @param s the Species_t structure to be added as modifier.
2452  * @param id the string to be used as the id of the SpeciesReference_t that will
2453  *        be created.
2454  *
2455  * @copydetails doc_returns_success_code
2456  * @li @sbmlconstant{LIBSBML_OPERATION_SUCCESS, OperationReturnValues_t}
2457  * @li @sbmlconstant{LIBSBML_LEVEL_MISMATCH, OperationReturnValues_t}
2458  * @li @sbmlconstant{LIBSBML_VERSION_MISMATCH, OperationReturnValues_t}
2459  * @li @sbmlconstant{LIBSBML_OPERATION_FAILED, OperationReturnValues_t}
2460  *
2461  * @note the Species_t structure itself is NOT added to the model
2462  *
2463  * @memberof Reaction_t
2464  */
2465 LIBSBML_EXTERN
2466 int
2467 Reaction_addModifierBySpecies (Reaction_t *r, const Species_t *s,
2468                                const char *id);
2469 
2470 
2471 /**
2472  * Creates a new SpeciesReference, adds it to this Reaction_t's list of
2473  * reactants and returns it.
2474  *
2475  * @memberof Reaction_t
2476  */
2477 LIBSBML_EXTERN
2478 SpeciesReference_t *
2479 Reaction_createReactant (Reaction_t *r);
2480 
2481 
2482 /**
2483  * Creates a new SpeciesReference, adds it to this Reaction_t's list of
2484  * products and returns it.
2485  *
2486  * @memberof Reaction_t
2487  */
2488 LIBSBML_EXTERN
2489 SpeciesReference_t *
2490 Reaction_createProduct (Reaction_t *r);
2491 
2492 
2493 /**
2494  * Creates a new SpeciesReference, adds it to this Reaction_t's list of
2495  * modifiers and returns it.
2496  *
2497  * @memberof Reaction_t
2498  */
2499 LIBSBML_EXTERN
2500 SpeciesReference_t *
2501 Reaction_createModifier (Reaction_t *r);
2502 
2503 
2504 /**
2505  * Creates a new KineticLaw_t for this Reaction_t and returns it.  If this
2506  * Reaction_t had a previous KineticLaw_t, it will be destroyed.
2507  *
2508  * @memberof Reaction_t
2509  */
2510 LIBSBML_EXTERN
2511 KineticLaw_t *
2512 Reaction_createKineticLaw (Reaction_t *r);
2513 
2514 
2515 /**
2516  * @return the list of Reactants for this Reaction_t.
2517  *
2518  * @memberof Reaction_t
2519  */
2520 LIBSBML_EXTERN
2521 ListOf_t *
2522 Reaction_getListOfReactants (Reaction_t *r);
2523 
2524 
2525 /**
2526  * @return the list of Products for this Reaction_t.
2527  *
2528  * @memberof Reaction_t
2529  */
2530 LIBSBML_EXTERN
2531 ListOf_t *
2532 Reaction_getListOfProducts (Reaction_t *r);
2533 
2534 
2535 /**
2536  * @return the list of Modifiers for this Reaction_t.
2537  *
2538  * @memberof Reaction_t
2539  */
2540 LIBSBML_EXTERN
2541 ListOf_t *
2542 Reaction_getListOfModifiers (Reaction_t *r);
2543 
2544 
2545 /**
2546  * @return the nth reactant (SpeciesReference_t) of this Reaction_t.
2547  * If the index @p n is invalid, @c NULL is returned.
2548  *
2549  * @memberof Reaction_t
2550  */
2551 LIBSBML_EXTERN
2552 SpeciesReference_t *
2553 Reaction_getReactant (Reaction_t *r, unsigned int n);
2554 
2555 
2556 /**
2557  * @return the reactant (SpeciesReference_t) in this Reaction_t with the given
2558  * species or @c NULL if no such reactant exists.
2559  *
2560  * @memberof Reaction_t
2561  */
2562 LIBSBML_EXTERN
2563 SpeciesReference_t *
2564 Reaction_getReactantBySpecies (Reaction_t *r, const char *species);
2565 
2566 
2567 /**
2568  * @return the nth product (SpeciesReference_t) of this Reaction_t.
2569  * If the index @p n is invalid, @c NULL is returned.
2570  *
2571  * @memberof Reaction_t
2572  */
2573 LIBSBML_EXTERN
2574 SpeciesReference_t *
2575 Reaction_getProduct (Reaction_t *r, unsigned int n);
2576 
2577 
2578 /**
2579  * @return the product (SpeciesReference_t) in this Reaction_t with the given
2580  * species or @c NULL if no such product exists.
2581  *
2582  * @memberof Reaction_t
2583  */
2584 LIBSBML_EXTERN
2585 SpeciesReference_t *
2586 Reaction_getProductBySpecies (Reaction_t *r, const char *species);
2587 
2588 
2589 /**
2590  * @return the nth modifier (modifier SpeciesReference_t) of this Reaction_t.
2591  * If the index @p n is invalid, @c NULL is returned.
2592  *
2593  * @memberof Reaction_t
2594  */
2595 LIBSBML_EXTERN
2596 SpeciesReference_t *
2597 Reaction_getModifier (Reaction_t *r, unsigned int n);
2598 
2599 
2600 /**
2601  * @return the modifier (modifier SpeciesReference_t) in this Reaction_t with
2602  * the given species or @c NULL if no such modifier exists.
2603  *
2604  * @memberof Reaction_t
2605  */
2606 LIBSBML_EXTERN
2607 SpeciesReference_t *
2608 Reaction_getModifierBySpecies (Reaction_t *r, const char *species);
2609 
2610 
2611 /**
2612  * @return the number of reactants (SpeciesReference_t's) in this Reaction_t.
2613  *
2614  * @memberof Reaction_t
2615  */
2616 LIBSBML_EXTERN
2617 unsigned int
2618 Reaction_getNumReactants (const Reaction_t *r);
2619 
2620 
2621 /**
2622  * @return the number of products (SpeciesReference_t's) in this Reaction_t.
2623  *
2624  * @memberof Reaction_t
2625  */
2626 LIBSBML_EXTERN
2627 unsigned int
2628 Reaction_getNumProducts (const Reaction_t *r);
2629 
2630 
2631 /**
2632  * @return the number of modifiers (modifier SpeciesReference_t's) in this
2633  * Reaction_t.
2634  *
2635  * @memberof Reaction_t
2636  */
2637 LIBSBML_EXTERN
2638 unsigned int
2639 Reaction_getNumModifiers (const Reaction_t *r);
2640 
2641 
2642 /**
2643  * Removes the nth reactant SpeciesReference_t structure from this
2644  * Reaction_t structure and returns a pointer to it.
2645  *
2646  * The caller owns the returned structure and is responsible for deleting it.
2647  *
2648  * @param r the Reaction_t structure.
2649  * @param n the integer index of the reactant SpeciesReference_t to remove.
2650  *
2651  * @return the reactant SpeciesReference_t structure removed.  As mentioned
2652  * above, the caller owns the returned structure. @c NULL is returned if the
2653  * given index is out of range.
2654  *
2655  * @memberof Reaction_t
2656  */
2657 LIBSBML_EXTERN
2658 SpeciesReference_t *
2659 Reaction_removeReactant (Reaction_t *r, unsigned int n);
2660 
2661 
2662 /**
2663  * Removes the reactant SpeciesReference_t structure with the given
2664  * "species" attribute from this Reaction_t structure and returns a pointer
2665  * to it.
2666  *
2667  * The caller owns the returned structure and is responsible for deleting it.
2668  *
2669  * @param r the Reaction_t structure.
2670  * @param species the "species" attribute of the reactant SpeciesReference_t
2671  * to remove.
2672  *
2673  * @return the reactant SpeciesReference_t structure removed.  As mentioned
2674  * above, the caller owns the returned structure. @c NULL is returned if no
2675  * reactant SpeciesReference_t structure with the "species" attribute exists
2676  * in this Reaction_t.
2677  *
2678  * @memberof Reaction_t
2679  */
2680 LIBSBML_EXTERN
2681 SpeciesReference_t *
2682 Reaction_removeReactantBySpecies (Reaction_t *r, const char *species);
2683 
2684 
2685 /**
2686  * Removes the nth product SpeciesReference_t structure from this
2687  * Reaction_t structure and returns a pointer to it.
2688  *
2689  * The caller owns the returned structure and is responsible for deleting it.
2690  *
2691  * @param r the Reaction_t structure.
2692  * @param n the integer index of the product SpeciesReference_t to remove.
2693  *
2694  * @return the product SpeciesReference_t structure removed.  As mentioned
2695  * above, the caller owns the returned structure. @c NULL is returned if the
2696  * given index is out of range.
2697  *
2698  * @memberof Reaction_t
2699  */
2700 LIBSBML_EXTERN
2701 SpeciesReference_t *
2702 Reaction_removeProduct (Reaction_t *r, unsigned int n);
2703 
2704 
2705 /**
2706  * Removes the product SpeciesReference_t structure with the given
2707  * "species" attribute from this Reaction_t structure and returns a pointer
2708  * to it.
2709  *
2710  * The caller owns the returned structure and is responsible for deleting it.
2711  *
2712  * @param r the Reaction_t structure.
2713  * @param species the "species" attribute of the product SpeciesReference_t
2714  * to remove.
2715  *
2716  * @return the product SpeciesReference_t structure removed.  As mentioned
2717  * above, the caller owns the returned structure. @c NULL is returned if no
2718  * product SpeciesReference_t structure with the "species" attribute exists
2719  * in this Reaction_t.
2720  *
2721  * @memberof Reaction_t
2722  */
2723 LIBSBML_EXTERN
2724 SpeciesReference_t *
2725 Reaction_removeProductBySpecies (Reaction_t *r, const char *species);
2726 
2727 
2728 /**
2729  * Removes the nth modifier SpeciesReference_t structure from this
2730  * Reaction_t structure and returns a pointer to it.
2731  *
2732  * The caller owns the returned structure and is responsible for deleting it.
2733  *
2734  * @param r the Reaction_t structure.
2735  * @param n the integer index of the modifier SpeciesReference_t to remove.
2736  *
2737  * @return the modifier SpeciesReference_t structure removed.  As mentioned
2738  * above, the caller owns the returned structure. @c NULL is returned if the
2739  * given index is out of range.
2740  *
2741  * @memberof Reaction_t
2742  */
2743 LIBSBML_EXTERN
2744 SpeciesReference_t *
2745 Reaction_removeModifier (Reaction_t *r, unsigned int n);
2746 
2747 
2748 /**
2749  * Removes the modifier SpeciesReference_t structure with the given
2750  * "species" attribute from this Reaction_t structure and returns a pointer
2751  * to it.
2752  *
2753  * The caller owns the returned structure and is responsible for deleting it.
2754  *
2755  * @param r the Reaction_t structure.
2756  * @param species the "species" attribute of the modifier SpeciesReference_t
2757  * to remove.
2758  *
2759  * @return the modifier SpeciesReference_t structure removed.  As mentioned
2760  * above, the caller owns the returned structure. @c NULL is returned if no
2761  * modifier SpeciesReference_t structure with the "species" attribute exists
2762  * in this Reaction_t.
2763  *
2764  * @memberof Reaction_t
2765  */
2766 LIBSBML_EXTERN
2767 SpeciesReference_t *
2768 Reaction_removeModifierBySpecies (Reaction_t *r, const char *species);
2769 
2770 
2771 /**
2772  * Returns the Reaction_t structure having a given identifier.
2773  *
2774  * @param lo the ListOfReactions_t structure to search.
2775  * @param sid the "id" attribute value being sought.
2776  *
2777  * @return item in the @p lo ListOfReactions with the given @p sid or a
2778  * null pointer if no such item exists.
2779  *
2780  * @see ListOf_t
2781  *
2782  * @memberof ListOfReactions_t
2783  */
2784 LIBSBML_EXTERN
2785 Reaction_t *
2786 ListOfReactions_getById (ListOf_t *lo, const char *sid);
2787 
2788 
2789 /**
2790  * Removes a Reaction_t structure based on its identifier.
2791  *
2792  * The caller owns the returned item and is responsible for deleting it.
2793  *
2794  * @param lo the list of Reaction_t structures to search.
2795  * @param sid the "id" attribute value of the structure to remove.
2796  *
2797  * @return The Reaction_t structure removed, or a null pointer if no such
2798  * item exists in @p lo.
2799  *
2800  * @see ListOf_t
2801  *
2802  * @memberof ListOfReactions_t
2803  */
2804 LIBSBML_EXTERN
2805 Reaction_t *
2806 ListOfReactions_removeById (ListOf_t *lo, const char *sid);
2807 
2808 
2809 END_C_DECLS
2810 LIBSBML_CPP_NAMESPACE_END
2811 
2812 #endif  /* !SWIG */
2813 #endif  /* Reaction_h */
2814 
2815