1 using System; 2 using System.Runtime.InteropServices; 3 4 //------------------------------------------------------------------------------ 5 // <auto-generated /> 6 // 7 // This file was automatically generated by SWIG (http://www.swig.org). 8 // Version 4.0.2 9 // 10 // Do not make changes to this file unless you know what you are doing--modify 11 // the SWIG interface file instead. 12 //------------------------------------------------------------------------------ 13 14 namespace libsbmlcs { 15 16 using System; 17 using System.Runtime.InteropServices; 18 19 /** 20 * @sbmlpackage{core} 21 * 22 @htmlinclude pkg-marker-core.html An SBML reaction between species in an SBML model. 23 * 24 * A @em reaction represents any transformation, transport or binding 25 * process, typically a chemical reaction, that can change the quantity of 26 * one or more species. In SBML, a reaction is defined primarily in terms 27 * of the participating reactants and products (and their corresponding 28 * stoichiometries), along with optional modifier species, an optional rate 29 * at which the reaction takes place, and optional parameters. 30 * 31 * As with other major objects in SBML, Reaction has a mandatory attribute, 32 * 'id', used to give the reaction an identifier. The identifier 33 * must be a text string conforming to the identifer syntax permitted in 34 * SBML. In SBML Level 2 and Level 3, the reaction 'id' 35 * identifier can be used in mathematical formulas elsewhere in an SBML 36 * model to represent the rate of that reaction; this usage is explained 37 * below. Reaction also has an optional 'name' attribute, of type 38 * @c string. The 'id' and 'name' must be used according to the guidelines 39 * described in the SBML specification. 40 * 41 * The species participating as reactants, products, and/or modifiers in a 42 * reaction are declared using lists of SpeciesReference and/or 43 * ModifierSpeciesReference instances stored in subelements 44 * 'listOfReactants', 'listOfProducts' and 'listOfModifiers'. Certain 45 * restrictions are placed on the appearance of species in reaction 46 * definitions: 47 * <ul> 48 * <li> The ability of a species to appear as a reactant or product of any 49 * reaction in a model is governed by certain flags in that species' 50 * definition; see the definition of Species for more information. 51 * 52 * <li> Any species appearing in the mathematical formula of the subelement 53 * 'kineticLaw' (described below) of a Reaction must be declared in at 54 * least one of that Reaction's lists of reactants, products, and/or 55 * modifiers. Put another way, it is an error for a reaction's kinetic law 56 * formula to refer to species that have not been declared for that 57 * reaction. 58 * 59 * <li> For SBML Levels 1, 2, and SBML Level 3 Version 1, a 60 * reaction definition can contain an empty list of reactants 61 * <em>or</em> an empty list of products, but it must have at least one 62 * reactant or product; in other words, a reaction without any reactant or 63 * product species is not permitted. (This restriction does not apply to 64 * modifier species, which remain optional in all cases.) In SBML 65 * Level 3 Version 2, this requirement was dropped, allowing 66 * the creation of reactions with neither reactants nor products. 67 * </ul> 68 * 69 * A reaction can contain up to one KineticLaw object in a subelement named 70 * 'kineticLaw'. It defines the speed at which the process defined by the 71 * reaction takes place. The description of KineticLaw provides more 72 * details about its use. Note that although the inclusion of a KineticLaw 73 * object in an instance of a Reaction component is optional, there is no 74 * useful default that can be substituted in place of a missing rate 75 * expression in a reaction. Moreover, a reaction's rate cannot be defined 76 * in any other way in SBML---InitialAssignment, AssignmentRule, 77 * RateRule, AlgebraicRule, Event, and other constructs in SBML cannot be 78 * used to set the reaction rate separately. Nevertheless, for some 79 * modeling applications, reactions without any defined rate can be 80 * perfectly acceptable. 81 * 82 * Reaction also has a boolean attribute named 'reversible' for indicating 83 * whether the reaction is reversible. This attribute is optional in SBML 84 * Level 2, with a default of @c true; it is mandatory in SBML 85 * Level 3 (with no default value). To say that a reaction is @em 86 * reversible is to say it can proceed in either the forward or the reverse 87 * direction. Although the reversibility of a reaction can sometimes be 88 * deduced by inspecting its rate expression, this is not always the case, 89 * especially for complicated expressions. Moreover, the need in SBML to 90 * allow rate expressions (i.e., KineticLaw) to be optional leads to the 91 * need for a separate flag indicating reversibility. Note that labeling a 92 * reaction as irreversible is an assertion that the reaction always 93 * proceeds in the given forward direction. (Why else would it be flagged 94 * as irreversible?) This implies the rate expression in the KineticLaw 95 * always has a non-negative value during simulations. Software tools 96 * could provide a means of optionally testing that this condition holds. 97 * The presence of reversibility information in two places (i.e., the rate 98 * expression and the 'reversible' attribute on Reaction) leaves open the 99 * possibility that a model could contain contradictory information, but 100 * the creation of such a model would be an error on the part of the 101 * software generating it. 102 * 103 * The Reaction object class has another boolean attribute called 'fast'. 104 * This attribute is optional in SBML Level 2, with a default of 105 * @c false; it is mandatory in SBML Level 3 (with no default value). 106 * In SBML Level 3 Version 2, a value of @c true for the 'fast' 107 * attribute is deprecated in favor of all reactions having a 'fast' value 108 * of @c false. It 109 * is used to indicate that a reaction occurs on a vastly faster time scale 110 * than others in a system. Readers are directed to the SBML Level 2 111 * Version 4 specification, which provides more detail about the 112 * conditions under which a reaction can be considered to be fast in this 113 * sense. SBML Level 1 114 * and Level 2 Version 1 incorrectly claimed that software tools 115 * could ignore this attribute if they did not implement support for the 116 * corresponding concept; however, further research in SBML has revealed 117 * that this is not true, and 'fast' <em>cannot be ignored</em> if it is 118 * set to @c true. SBML Level 2 Versions 2–4 therefore 119 * stipulate that if a model has any reactions with 'fast' set to @c true, 120 * a software tool must be able to respect the attribute or else indicate 121 * to the user that it does not have the capacity to do so. Analysis 122 * software cannot ignore the value of the 'fast' attribute because doing 123 * so may lead to different results as compared to a software system that 124 * <em>does</em> make use of 'fast'. 125 * 126 * 127 * 128 * In SBML Level 3 Version 2, the 'fast' attribute was 129 * removed. All reactions are assumed to be equivalent to reactions 130 * in previous levels/versions that have a 'fast' attribute value 131 * of @c false. Users should be aware that even for previous 132 * levels/versions of the specification, 'fast' attribute values of 133 * @c true never achieved widespread support, and many software 134 * packages may ignore it. To achieve the same or similar 135 * effects as setting the fast attribute to @c true for a given 136 * reaction, the KineticLaw attribute should be constructed to 137 * produce a value in the desired time scale, or else the 138 * reaction could be replaced with an AssignmentRule or 139 * AlgebraicRule. 140 * 141 * 142 * 143 * In SBML Level 3, the Reaction object has an 144 * additional optional attribute named 'compartment', whose value must be 145 * the identifier of a compartment defined in the enclosing Model object. 146 * The 'compartment' attribute can be used to indicate the compartment in 147 * which the reaction is assumed to take place. If the attribute is 148 * present, its value must be the identifier of a Compartment object 149 * defined in the enclosing Model object. Similar to the 'reversible' 150 * attribute, the value of the 'compartment' attribute has no direct impact 151 * on the construction of mathematical equations for the SBML model. When 152 * a kinetic law is given for a reaction, the compartment location may 153 * already be implicit in the kinetic law (although this cannot always be 154 * guaranteed). Nevertheless, software tools may find the 'compartment' 155 * attribute value useful for such purposes as analyzing the structure of 156 * the model, guiding the modeler in constructing correct rate formulas, 157 * and visualization purposes. 158 * 159 * Readers are urged to read the SBML specification for more details about 160 * the proper use of Reaction. 161 * 162 * 163 * 164 */ 165 166 public class Reaction : SBase { 167 private HandleRef swigCPtr; 168 Reaction(IntPtr cPtr, bool cMemoryOwn)169 internal Reaction(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.Reaction_SWIGUpcast(cPtr), cMemoryOwn) 170 { 171 //super(libsbmlPINVOKE.ReactionUpcast(cPtr), cMemoryOwn); 172 swigCPtr = new HandleRef(this, cPtr); 173 } 174 getCPtr(Reaction obj)175 internal static HandleRef getCPtr(Reaction obj) 176 { 177 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 178 } 179 getCPtrAndDisown(Reaction obj)180 internal static HandleRef getCPtrAndDisown (Reaction obj) 181 { 182 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 183 184 if (obj != null) 185 { 186 ptr = obj.swigCPtr; 187 obj.swigCMemOwn = false; 188 } 189 190 return ptr; 191 } 192 Dispose(bool disposing)193 protected override void Dispose(bool disposing) { 194 lock(this) { 195 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 196 if (swigCMemOwn) { 197 swigCMemOwn = false; 198 libsbmlPINVOKE.delete_Reaction(swigCPtr); 199 } 200 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 201 } 202 base.Dispose(disposing); 203 } 204 } 205 206 207 /** 208 * Creates a new Reaction using the given SBML @p level and @p version 209 * values. 210 * 211 * @param level a long integer, the SBML Level to assign to this Reaction. 212 * 213 * @param version a long integer, the SBML Version to assign to this 214 * Reaction. 215 * 216 * 217 * @throws SBMLConstructorException 218 * Thrown if the given @p level and @p version combination are invalid 219 * or if this object is incompatible with the given level and version. 220 * 221 * 222 * 223 * 224 * @note Attempting to add an object to an SBMLDocument having a different 225 * combination of SBML Level, Version and XML namespaces than the object 226 * itself will result in an error at the time a caller attempts to make the 227 * addition. A parent object must have compatible Level, Version and XML 228 * namespaces. (Strictly speaking, a parent may also have more XML 229 * namespaces than a child, but the reverse is not permitted.) The 230 * restriction is necessary to ensure that an SBML model has a consistent 231 * overall structure. This requires callers to manage their objects 232 * carefully, but the benefit is increased flexibility in how models can be 233 * created by permitting callers to create objects bottom-up if desired. In 234 * situations where objects are not yet attached to parents (e.g., 235 * SBMLDocument), knowledge of the intented SBML Level and Version help 236 * libSBML determine such things as whether it is valid to assign a 237 * particular value to an attribute. 238 * 239 * 240 */ public Reaction(long level, long version)241 Reaction(long level, long version) : this(libsbmlPINVOKE.new_Reaction__SWIG_0(level, version), true) { 242 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 243 } 244 245 246 /** 247 * Creates a new Reaction using the given SBMLNamespaces object 248 * @p sbmlns. 249 * 250 * 251 * 252 * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces 253 * information. It is used to communicate the SBML Level, Version, and (in 254 * Level 3) packages used in addition to SBML Level 3 Core. A 255 * common approach to using libSBML's SBMLNamespaces facilities is to create an 256 * SBMLNamespaces object somewhere in a program once, then hand that object 257 * as needed to object constructors that accept SBMLNamespaces as arguments. 258 * 259 * 260 * 261 * @param sbmlns an SBMLNamespaces object. 262 * 263 * 264 * @throws SBMLConstructorException 265 * Thrown if the given @p sbmlns is inconsistent or incompatible 266 * with this object. 267 * 268 * 269 * 270 * 271 * @note Attempting to add an object to an SBMLDocument having a different 272 * combination of SBML Level, Version and XML namespaces than the object 273 * itself will result in an error at the time a caller attempts to make the 274 * addition. A parent object must have compatible Level, Version and XML 275 * namespaces. (Strictly speaking, a parent may also have more XML 276 * namespaces than a child, but the reverse is not permitted.) The 277 * restriction is necessary to ensure that an SBML model has a consistent 278 * overall structure. This requires callers to manage their objects 279 * carefully, but the benefit is increased flexibility in how models can be 280 * created by permitting callers to create objects bottom-up if desired. In 281 * situations where objects are not yet attached to parents (e.g., 282 * SBMLDocument), knowledge of the intented SBML Level and Version help 283 * libSBML determine such things as whether it is valid to assign a 284 * particular value to an attribute. 285 * 286 * 287 */ public Reaction(SBMLNamespaces sbmlns)288 Reaction(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_Reaction__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) { 289 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 290 } 291 292 293 /** 294 * Copy constructor; creates a copy of this Reaction. 295 * 296 * @param orig the object to copy. 297 */ public Reaction(Reaction orig)298 Reaction(Reaction orig) : this(libsbmlPINVOKE.new_Reaction__SWIG_2(Reaction.getCPtr(orig)), true) { 299 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 300 } 301 302 303 /** 304 * Creates and returns a deep copy of this Reaction object. 305 * 306 * @return the (deep) copy of this Reaction object. 307 */ public new clone()308 Reaction clone() { 309 Reaction ret = (Reaction) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_clone(swigCPtr), true); 310 return ret; 311 } 312 313 314 /** 315 * Returns the first child element found that has the given @p id in the 316 * model-wide SId namespace, or @c null if no such object is found. 317 * 318 * @param id string representing the id of the object to find. 319 * 320 * @return pointer to the first element found with the given @p id. 321 */ public new getElementBySId(string id)322 SBase getElementBySId(string id) { 323 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_getElementBySId(swigCPtr, id), false); 324 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 325 return ret; 326 } 327 328 329 /** 330 * Returns the first child element it can find with the given @p metaid, or 331 * @c null if no such object is found. 332 * 333 * @param metaid string representing the metaid of the object to find. 334 * 335 * @return pointer to the first element found with the given @p metaid. 336 */ public new getElementByMetaId(string metaid)337 SBase getElementByMetaId(string metaid) { 338 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_getElementByMetaId(swigCPtr, metaid), false); 339 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 340 return ret; 341 } 342 343 344 /** 345 * 346 * Replaces all uses of a given @c SIdRef type attribute value with another 347 * value. 348 * 349 * 350 * 351 352 * In SBML, object identifiers are of a data type called <code>SId</code>. 353 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 354 * introduced for attribute values that refer to <code>SId</code> values; in 355 * previous Levels of SBML, this data type did not exist and attributes were 356 * simply described to as 'referring to an identifier', but the effective 357 * data type was the same as <code>SIdRef</code> in Level 3. These and 358 * other methods of libSBML refer to the type <code>SIdRef</code> for all 359 * Levels of SBML, even if the corresponding SBML specification did not 360 * explicitly name the data type. 361 * 362 * 363 * 364 * This method works by looking at all attributes and (if appropriate) 365 * mathematical formulas in MathML content, comparing the referenced 366 * identifiers to the value of @p oldid. If any matches are found, the 367 * matching values are replaced with @p newid. The method does @em not 368 * descend into child elements. 369 * 370 * @param oldid the old identifier. 371 * @param newid the new identifier. 372 * 373 * 374 */ public new renameSIdRefs(string oldid, string newid)375 void renameSIdRefs(string oldid, string newid) { 376 libsbmlPINVOKE.Reaction_renameSIdRefs(swigCPtr, oldid, newid); 377 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 378 } 379 380 381 /** 382 * Initializes the fields of this Reaction object to 'typical' default 383 * values. 384 * 385 * The SBML Reaction component has slightly different aspects and 386 * default attribute values in different SBML Levels and Versions. 387 * This method sets the values to certain common defaults, based 388 * mostly on what they are in SBML Level 2. Specifically: 389 * 390 * @li Sets the 'reversible' attribute to @c true 391 * @li Sets the 'fast' attribute to @c false 392 * @li Marks the 'fast' attribute as @em not having been set for 393 * SBML Level 2, but @em as having been set for 394 * SBML Level 1 and SBML Level 3. 395 * 396 * 397 * @warning <span class='warning'>SBML definitions before SBML Level 2 398 * Version 2 incorrectly indicated that software tools could ignore the 399 * 'fast' attribute if they did not implement support for the corresponding 400 * concept; however, further research in SBML has revealed that this is not 401 * true, and 'fast' <em>cannot be ignored</em> if it is set to @c true. 402 * Beginning with SBML Level 2 Versions 2, the SBML specifications 403 * therefore stipulate that if a model has any reactions with 'fast' set to 404 * @c true, a software tool must be able to respect the attribute or else 405 * indicate to the user that it does not have the capacity to do so. Readers 406 * are directed to the SBML specifications, which provides more detail about 407 * the conditions under which a reaction can be considered to be fast in this 408 * sense.</span> 409 * 410 */ public initDefaults()411 void initDefaults() { 412 libsbmlPINVOKE.Reaction_initDefaults(swigCPtr); 413 } 414 415 416 /** 417 * Returns the value of the 'id' attribute of this Reaction. 418 * 419 * @note Because of the inconsistent behavior of this function with 420 * respect to assignments and rules, it is now recommended to 421 * use the getIdAttribute() function instead. 422 * 423 * 424 * 425 * The identifier given by an object's 'id' attribute value 426 * is used to identify the object within the SBML model definition. 427 * Other objects can refer to the component using this identifier. The 428 * data type of 'id' is always <code>SId</code> or a type derived 429 * from that, such as <code>UnitSId</code>, depending on the object in 430 * question. All data types are defined as follows: 431 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 432 * letter ::= 'a'..'z','A'..'Z' 433 * digit ::= '0'..'9' 434 * idChar ::= letter | digit | '_' 435 * SId ::= ( letter | '_' ) idChar* 436 * </pre> 437 * The characters <code>(</code> and <code>)</code> are used for grouping, 438 * the character <code>*</code> 'zero or more times', and the character 439 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 440 * is determined by an exact character sequence match; i.e., comparisons must 441 * be performed in a case-sensitive manner. This applies to all uses of 442 * <code>SId</code>, <code>SIdRef</code>, and derived types. 443 * 444 * Users need to be aware of some important API issues that are the result of 445 * the history of SBML and libSBML. Prior to SBML Level 3 446 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 447 * of SBML objects. To simplify the work of programmers, libSBML's API 448 * provided get, set, check, and unset on the SBase object class itself 449 * instead of on individual subobject classes. This made the 450 * get/set/etc. methods uniformly available on all objects in the libSBML 451 * API. LibSBML simply returned empty strings or otherwise did not act when 452 * the methods were applied to SBML objects that were not defined by the SBML 453 * specification to have 'id' or 'name' attributes. Additional complications 454 * arose with the rule and assignment objects: InitialAssignment, 455 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 456 * the rule object hierarchy was different, and in addition, then as now, 457 * they possess different attributes: 'variable' (for the rules and event 458 * assignments), 'symbol' (for initial assignments), or neither (for 459 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 460 * would always return an empty string, and isSetId() would always return @c 461 * false for objects of these classes. 462 * 463 * With the addition of 'id' and 'name' attributes on SBase in Level 3 464 * Version 2, it became necessary to introduce a new way to interact 465 * with the attributes more consistently in libSBML to avoid breaking 466 * backward compatibility in the behavior of the original 'id' methods. For 467 * this reason, libSBML provides four functions (getIdAttribute(), 468 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 469 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 470 * from SBase, regardless of the object's type. <strong>These new methods 471 * should be used instead of the older getId()/setId()/etc. methods</strong> 472 * unless the old behavior is somehow necessary. Regardless of the Level and 473 * Version of the SBML, these functions allow client applications to use more 474 * generalized code in some situations (for instance, when manipulating 475 * objects that are all known to have identifiers). If the object in 476 * question does not posess an 'id' attribute according to the SBML 477 * specification for the Level and Version in use, libSBML will not allow the 478 * identifier to be set, nor will it read or write 'id' attributes for those 479 * objects. 480 * 481 * 482 * 483 * @return the id of this Reaction. 484 * 485 * @see getIdAttribute() 486 * @see setIdAttribute(string sid) 487 * @see isSetIdAttribute() 488 * @see unsetIdAttribute() 489 */ public new getId()490 string getId() { 491 string ret = libsbmlPINVOKE.Reaction_getId(swigCPtr); 492 return ret; 493 } 494 495 496 /** 497 * Returns the value of the 'name' attribute of this Reaction object. 498 * 499 * 500 * 501 * 502 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 503 * moved to SBase directly, instead of being defined individually for many 504 * (but not all) objects. LibSBML has for a long time provided functions 505 * defined on SBase itself to get, set, and unset those attributes, which 506 * would fail or otherwise return empty strings if executed on any object 507 * for which those attributes were not defined. Now that all SBase objects 508 * define those attributes, those functions now succeed for any object with 509 * the appropriate level and version. 510 * 511 * The 'name' attribute is 512 * optional and is not intended to be used for cross-referencing purposes 513 * within a model. Its purpose instead is to provide a human-readable 514 * label for the component. The data type of 'name' is the type 515 * <code>string</code> defined in XML Schema. SBML imposes no 516 * restrictions as to the content of 'name' attributes beyond those 517 * restrictions defined by the <code>string</code> type in XML Schema. 518 * 519 * The recommended practice for handling 'name' is as follows. If a 520 * software tool has the capability for displaying the content of 'name' 521 * attributes, it should display this content to the user as a 522 * component's label instead of the component's 'id'. If the user 523 * interface does not have this capability (e.g., because it cannot 524 * display or use special characters in symbol names), or if the 'name' 525 * attribute is missing on a given component, then the user interface 526 * should display the value of the 'id' attribute instead. (Script 527 * language interpreters are especially likely to display 'id' instead of 528 * 'name'.) 529 * 530 * As a consequence of the above, authors of systems that automatically 531 * generate the values of 'id' attributes should be aware some systems 532 * may display the 'id''s to the user. Authors therefore may wish to 533 * take some care to have their software create 'id' values that are: (a) 534 * reasonably easy for humans to type and read; and (b) likely to be 535 * meaningful, for example by making the 'id' attribute be an abbreviated 536 * form of the name attribute value. 537 * 538 * An additional point worth mentioning is although there are 539 * restrictions on the uniqueness of 'id' values, there are no 540 * restrictions on the uniqueness of 'name' values in a model. This 541 * allows software applications leeway in assigning component identifiers. 542 * 543 * Regardless of the level and version of the SBML, these functions allow 544 * client applications to use more generalized code in some situations 545 * (for instance, when manipulating objects that are all known to have 546 * names). If the object in question does not posess a 'name' attribute 547 * according to the SBML specification for the Level and Version in use, 548 * libSBML will not allow the name to be set, nor will it read or 549 * write 'name' attributes for those objects. 550 * 551 * 552 * 553 * @return the name of this SBML object, or the empty string if not set or unsettable. 554 * 555 * @see getIdAttribute() 556 * @see isSetName() 557 * @see setName(string sid) 558 * @see unsetName() 559 * 560 * 561 */ public new getName()562 string getName() { 563 string ret = libsbmlPINVOKE.Reaction_getName(swigCPtr); 564 return ret; 565 } 566 567 568 /** 569 * Returns the KineticLaw object contained in this Reaction. 570 * 571 * @return the KineticLaw instance. 572 */ public getKineticLaw()573 KineticLaw getKineticLaw() { 574 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_getKineticLaw__SWIG_0(swigCPtr); 575 KineticLaw ret = (cPtr == global::System.IntPtr.Zero) ? null : new KineticLaw(cPtr, false); 576 return ret; 577 } 578 579 580 /** 581 * Returns the value of the 'reversible' attribute on the Reaction as a 582 * boolean value. 583 * 584 * @return the reversibility status of this Reaction. 585 */ public getReversible()586 bool getReversible() { 587 bool ret = libsbmlPINVOKE.Reaction_getReversible(swigCPtr); 588 return ret; 589 } 590 591 592 /** 593 * Returns the value of the 'fast' attribute of this Reaction. 594 * 595 * 596 * 597 * In SBML Level 3 Version 2, the 'fast' attribute was 598 * removed. All reactions are assumed to be equivalent to reactions 599 * in previous levels/versions that have a 'fast' attribute value 600 * of @c false. Users should be aware that even for previous 601 * levels/versions of the specification, 'fast' attribute values of 602 * @c true never achieved widespread support, and many software 603 * packages may ignore it. To achieve the same or similar 604 * effects as setting the fast attribute to @c true for a given 605 * reaction, the KineticLaw attribute should be constructed to 606 * produce a value in the desired time scale, or else the 607 * reaction could be replaced with an AssignmentRule or 608 * AlgebraicRule. 609 * 610 * 611 * 612 * @return the 'fast' status of this Reaction. 613 * 614 * 615 * @warning <span class='warning'>SBML definitions before SBML Level 2 616 * Version 2 incorrectly indicated that software tools could ignore the 617 * 'fast' attribute if they did not implement support for the corresponding 618 * concept; however, further research in SBML has revealed that this is not 619 * true, and 'fast' <em>cannot be ignored</em> if it is set to @c true. 620 * Beginning with SBML Level 2 Versions 2, the SBML specifications 621 * therefore stipulate that if a model has any reactions with 'fast' set to 622 * @c true, a software tool must be able to respect the attribute or else 623 * indicate to the user that it does not have the capacity to do so. Readers 624 * are directed to the SBML specifications, which provides more detail about 625 * the conditions under which a reaction can be considered to be fast in this 626 * sense.</span> 627 * 628 */ public getFast()629 bool getFast() { 630 bool ret = libsbmlPINVOKE.Reaction_getFast(swigCPtr); 631 return ret; 632 } 633 634 635 /** 636 * (SBML Level 3 only) Returns the value of the 'compartment' 637 * attribute on the Reaction. 638 * 639 * @return the compartment of this Reaction. 640 * 641 * @note The 'compartment' attribute is available in SBML Level 3, 642 * but is not present on Reaction in lower Levels of 643 * SBML. 644 */ public getCompartment()645 string getCompartment() { 646 string ret = libsbmlPINVOKE.Reaction_getCompartment(swigCPtr); 647 return ret; 648 } 649 650 651 /** 652 * Predicate returning @c true if this 653 * Reaction's 'id' attribute is set. 654 * 655 * 656 * 657 * 658 * The identifier given by an object's 'id' attribute value 659 * is used to identify the object within the SBML model definition. 660 * Other objects can refer to the component using this identifier. The 661 * data type of 'id' is always <code>SId</code> or a type derived 662 * from that, such as <code>UnitSId</code>, depending on the object in 663 * question. All data types are defined as follows: 664 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 665 * letter ::= 'a'..'z','A'..'Z' 666 * digit ::= '0'..'9' 667 * idChar ::= letter | digit | '_' 668 * SId ::= ( letter | '_' ) idChar* 669 * </pre> 670 * The characters <code>(</code> and <code>)</code> are used for grouping, 671 * the character <code>*</code> 'zero or more times', and the character 672 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 673 * is determined by an exact character sequence match; i.e., comparisons must 674 * be performed in a case-sensitive manner. This applies to all uses of 675 * <code>SId</code>, <code>SIdRef</code>, and derived types. 676 * 677 * Users need to be aware of some important API issues that are the result of 678 * the history of SBML and libSBML. Prior to SBML Level 3 679 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 680 * of SBML objects. To simplify the work of programmers, libSBML's API 681 * provided get, set, check, and unset on the SBase object class itself 682 * instead of on individual subobject classes. This made the 683 * get/set/etc. methods uniformly available on all objects in the libSBML 684 * API. LibSBML simply returned empty strings or otherwise did not act when 685 * the methods were applied to SBML objects that were not defined by the SBML 686 * specification to have 'id' or 'name' attributes. Additional complications 687 * arose with the rule and assignment objects: InitialAssignment, 688 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 689 * the rule object hierarchy was different, and in addition, then as now, 690 * they possess different attributes: 'variable' (for the rules and event 691 * assignments), 'symbol' (for initial assignments), or neither (for 692 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 693 * would always return an empty string, and isSetId() would always return @c 694 * false for objects of these classes. 695 * 696 * With the addition of 'id' and 'name' attributes on SBase in Level 3 697 * Version 2, it became necessary to introduce a new way to interact 698 * with the attributes more consistently in libSBML to avoid breaking 699 * backward compatibility in the behavior of the original 'id' methods. For 700 * this reason, libSBML provides four functions (getIdAttribute(), 701 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 702 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 703 * from SBase, regardless of the object's type. <strong>These new methods 704 * should be used instead of the older getId()/setId()/etc. methods</strong> 705 * unless the old behavior is somehow necessary. Regardless of the Level and 706 * Version of the SBML, these functions allow client applications to use more 707 * generalized code in some situations (for instance, when manipulating 708 * objects that are all known to have identifiers). If the object in 709 * question does not posess an 'id' attribute according to the SBML 710 * specification for the Level and Version in use, libSBML will not allow the 711 * identifier to be set, nor will it read or write 'id' attributes for those 712 * objects. 713 * 714 * 715 * 716 * @return @c true if the 'id' attribute of this SBML object is 717 * set, @c false otherwise. 718 * 719 * @note Because of the inconsistent behavior of this function with 720 * respect to assignments and rules, it is recommended that callers 721 * use isSetIdAttribute() instead. 722 * 723 * @see getIdAttribute() 724 * @see setIdAttribute(string sid) 725 * @see unsetIdAttribute() 726 * @see isSetIdAttribute() 727 * 728 * 729 */ public new isSetId()730 bool isSetId() { 731 bool ret = libsbmlPINVOKE.Reaction_isSetId(swigCPtr); 732 return ret; 733 } 734 735 736 /** 737 * Predicate returning @c true if this 738 * Reaction's 'name' attribute is set. 739 * 740 * 741 * 742 * 743 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 744 * moved to SBase directly, instead of being defined individually for many 745 * (but not all) objects. LibSBML has for a long time provided functions 746 * defined on SBase itself to get, set, and unset those attributes, which 747 * would fail or otherwise return empty strings if executed on any object 748 * for which those attributes were not defined. Now that all SBase objects 749 * define those attributes, those functions now succeed for any object with 750 * the appropriate level and version. 751 * 752 * The 'name' attribute is 753 * optional and is not intended to be used for cross-referencing purposes 754 * within a model. Its purpose instead is to provide a human-readable 755 * label for the component. The data type of 'name' is the type 756 * <code>string</code> defined in XML Schema. SBML imposes no 757 * restrictions as to the content of 'name' attributes beyond those 758 * restrictions defined by the <code>string</code> type in XML Schema. 759 * 760 * The recommended practice for handling 'name' is as follows. If a 761 * software tool has the capability for displaying the content of 'name' 762 * attributes, it should display this content to the user as a 763 * component's label instead of the component's 'id'. If the user 764 * interface does not have this capability (e.g., because it cannot 765 * display or use special characters in symbol names), or if the 'name' 766 * attribute is missing on a given component, then the user interface 767 * should display the value of the 'id' attribute instead. (Script 768 * language interpreters are especially likely to display 'id' instead of 769 * 'name'.) 770 * 771 * As a consequence of the above, authors of systems that automatically 772 * generate the values of 'id' attributes should be aware some systems 773 * may display the 'id''s to the user. Authors therefore may wish to 774 * take some care to have their software create 'id' values that are: (a) 775 * reasonably easy for humans to type and read; and (b) likely to be 776 * meaningful, for example by making the 'id' attribute be an abbreviated 777 * form of the name attribute value. 778 * 779 * An additional point worth mentioning is although there are 780 * restrictions on the uniqueness of 'id' values, there are no 781 * restrictions on the uniqueness of 'name' values in a model. This 782 * allows software applications leeway in assigning component identifiers. 783 * 784 * Regardless of the level and version of the SBML, these functions allow 785 * client applications to use more generalized code in some situations 786 * (for instance, when manipulating objects that are all known to have 787 * names). If the object in question does not posess a 'name' attribute 788 * according to the SBML specification for the Level and Version in use, 789 * libSBML will not allow the name to be set, nor will it read or 790 * write 'name' attributes for those objects. 791 * 792 * 793 * 794 * @return @c true if the 'name' attribute of this SBML object is 795 * set, @c false otherwise. 796 * 797 * @see getName() 798 * @see setName(string sid) 799 * @see unsetName() 800 * 801 * 802 */ public new isSetName()803 bool isSetName() { 804 bool ret = libsbmlPINVOKE.Reaction_isSetName(swigCPtr); 805 return ret; 806 } 807 808 809 /** 810 * Predicate returning @c true if this 811 * Reaction contains a kinetic law object. 812 * 813 * @return @c true if a KineticLaw is present in this Reaction,, @c false 814 * otherwise. 815 */ public isSetKineticLaw()816 bool isSetKineticLaw() { 817 bool ret = libsbmlPINVOKE.Reaction_isSetKineticLaw(swigCPtr); 818 return ret; 819 } 820 821 822 /** 823 * Predicate returning @c true if the value of 824 * the 'fast' attribute on this Reaction is set. 825 * 826 * 827 * 828 * In SBML Level 3 Version 2, the 'fast' attribute was 829 * removed. All reactions are assumed to be equivalent to reactions 830 * in previous levels/versions that have a 'fast' attribute value 831 * of @c false. Users should be aware that even for previous 832 * levels/versions of the specification, 'fast' attribute values of 833 * @c true never achieved widespread support, and many software 834 * packages may ignore it. To achieve the same or similar 835 * effects as setting the fast attribute to @c true for a given 836 * reaction, the KineticLaw attribute should be constructed to 837 * produce a value in the desired time scale, or else the 838 * reaction could be replaced with an AssignmentRule or 839 * AlgebraicRule. 840 * 841 * 842 * 843 * @return @c true if the 'fast' attribute is set, @c false otherwise. 844 * 845 * 846 * @warning <span class='warning'>SBML definitions before SBML Level 2 847 * Version 2 incorrectly indicated that software tools could ignore the 848 * 'fast' attribute if they did not implement support for the corresponding 849 * concept; however, further research in SBML has revealed that this is not 850 * true, and 'fast' <em>cannot be ignored</em> if it is set to @c true. 851 * Beginning with SBML Level 2 Versions 2, the SBML specifications 852 * therefore stipulate that if a model has any reactions with 'fast' set to 853 * @c true, a software tool must be able to respect the attribute or else 854 * indicate to the user that it does not have the capacity to do so. Readers 855 * are directed to the SBML specifications, which provides more detail about 856 * the conditions under which a reaction can be considered to be fast in this 857 * sense.</span> 858 * 859 */ public isSetFast()860 bool isSetFast() { 861 bool ret = libsbmlPINVOKE.Reaction_isSetFast(swigCPtr); 862 return ret; 863 } 864 865 866 /** 867 * Predicate returning @c true if this 868 * Reaction's 'compartment' attribute is set. 869 * 870 * @return @c true if the 'compartment' attribute of this Reaction is 871 * set, @c false otherwise. 872 * 873 * @note The 'compartment' attribute is available in SBML 874 * Level 3, but is not present on Reaction in 875 * lower Levels of SBML. 876 */ public isSetCompartment()877 bool isSetCompartment() { 878 bool ret = libsbmlPINVOKE.Reaction_isSetCompartment(swigCPtr); 879 return ret; 880 } 881 882 883 /** 884 * Predicate returning @c true if this 885 * Reaction's 'reversible' attribute is set. 886 * 887 * @return @c true if the 'reversible' attribute of this Reaction is 888 * set, @c false otherwise. 889 */ public isSetReversible()890 bool isSetReversible() { 891 bool ret = libsbmlPINVOKE.Reaction_isSetReversible(swigCPtr); 892 return ret; 893 } 894 895 896 /** 897 * Sets the value of the 'id' attribute of this Reaction. 898 * 899 * 900 * 901 * The string @p sid is copied. 902 * 903 * 904 * 905 * The identifier given by an object's 'id' attribute value 906 * is used to identify the object within the SBML model definition. 907 * Other objects can refer to the component using this identifier. The 908 * data type of 'id' is always <code>SId</code> or a type derived 909 * from that, such as <code>UnitSId</code>, depending on the object in 910 * question. All data types are defined as follows: 911 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 912 * letter ::= 'a'..'z','A'..'Z' 913 * digit ::= '0'..'9' 914 * idChar ::= letter | digit | '_' 915 * SId ::= ( letter | '_' ) idChar* 916 * </pre> 917 * The characters <code>(</code> and <code>)</code> are used for grouping, 918 * the character <code>*</code> 'zero or more times', and the character 919 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers 920 * is determined by an exact character sequence match; i.e., comparisons must 921 * be performed in a case-sensitive manner. This applies to all uses of 922 * <code>SId</code>, <code>SIdRef</code>, and derived types. 923 * 924 * Users need to be aware of some important API issues that are the result of 925 * the history of SBML and libSBML. Prior to SBML Level 3 926 * Version 2, SBML defined 'id' and 'name' attributes on only a subset 927 * of SBML objects. To simplify the work of programmers, libSBML's API 928 * provided get, set, check, and unset on the SBase object class itself 929 * instead of on individual subobject classes. This made the 930 * get/set/etc. methods uniformly available on all objects in the libSBML 931 * API. LibSBML simply returned empty strings or otherwise did not act when 932 * the methods were applied to SBML objects that were not defined by the SBML 933 * specification to have 'id' or 'name' attributes. Additional complications 934 * arose with the rule and assignment objects: InitialAssignment, 935 * EventAssignment, AssignmentRule, and RateRule. In early versions of SBML, 936 * the rule object hierarchy was different, and in addition, then as now, 937 * they possess different attributes: 'variable' (for the rules and event 938 * assignments), 'symbol' (for initial assignments), or neither (for 939 * algebraic rules). Prior to SBML Level 3 Version 2, getId() 940 * would always return an empty string, and isSetId() would always return @c 941 * false for objects of these classes. 942 * 943 * With the addition of 'id' and 'name' attributes on SBase in Level 3 944 * Version 2, it became necessary to introduce a new way to interact 945 * with the attributes more consistently in libSBML to avoid breaking 946 * backward compatibility in the behavior of the original 'id' methods. For 947 * this reason, libSBML provides four functions (getIdAttribute(), 948 * setIdAttribute(@if java String@endif), isSetIdAttribute(), and 949 * unsetIdAttribute()) that always act on the actual 'id' attribute inherited 950 * from SBase, regardless of the object's type. <strong>These new methods 951 * should be used instead of the older getId()/setId()/etc. methods</strong> 952 * unless the old behavior is somehow necessary. Regardless of the Level and 953 * Version of the SBML, these functions allow client applications to use more 954 * generalized code in some situations (for instance, when manipulating 955 * objects that are all known to have identifiers). If the object in 956 * question does not posess an 'id' attribute according to the SBML 957 * specification for the Level and Version in use, libSBML will not allow the 958 * identifier to be set, nor will it read or write 'id' attributes for those 959 * objects. 960 * 961 * 962 * 963 * @param sid the string to use as the identifier of this object. 964 * 965 * 966 * @return integer value indicating success/failure of the 967 * function. @if clike The value is drawn from the 968 * enumeration #OperationReturnValues_t. @endif The possible values 969 * returned by this function are: 970 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 971 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 972 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 973 * 974 * @see getIdAttribute() 975 * @see setIdAttribute(string sid) 976 * @see isSetIdAttribute() 977 * @see unsetIdAttribute() 978 * 979 * 980 */ public new setId(string sid)981 int setId(string sid) { 982 int ret = libsbmlPINVOKE.Reaction_setId(swigCPtr, sid); 983 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 984 return ret; 985 } 986 987 988 /** 989 * Sets the value of the 'name' attribute of this Reaction. 990 * 991 * 992 * 993 * 994 * The string in @p name is copied. 995 * 996 * @param name the new name for the SBML object. 997 * 998 * 999 * @return integer value indicating success/failure of the 1000 * function. @if clike The value is drawn from the 1001 * enumeration #OperationReturnValues_t. @endif The possible values 1002 * returned by this function are: 1003 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1004 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1005 * 1006 * 1007 */ public new setName(string name)1008 int setName(string name) { 1009 int ret = libsbmlPINVOKE.Reaction_setName(swigCPtr, name); 1010 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 1011 return ret; 1012 } 1013 1014 1015 /** 1016 * Sets the 'kineticLaw' subelement of this Reaction to a copy of the 1017 * given KineticLaw object. 1018 * 1019 * @param kl the KineticLaw object to use. 1020 * 1021 * 1022 * @return integer value indicating success/failure of the 1023 * function. @if clike The value is drawn from the 1024 * enumeration #OperationReturnValues_t. @endif The possible values 1025 * returned by this function are: 1026 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1027 * @li @link libsbml#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH@endlink 1028 * @li @link libsbml#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH@endlink 1029 */ public setKineticLaw(KineticLaw kl)1030 int setKineticLaw(KineticLaw kl) { 1031 int ret = libsbmlPINVOKE.Reaction_setKineticLaw(swigCPtr, KineticLaw.getCPtr(kl)); 1032 return ret; 1033 } 1034 1035 1036 /** 1037 * Sets the value of the 'reversible' attribute of this Reaction. 1038 * 1039 * @param value the value of the 'reversible' attribute. 1040 * 1041 * 1042 * @return integer value indicating success/failure of the 1043 * function. @if clike The value is drawn from the 1044 * enumeration #OperationReturnValues_t. @endif The possible values 1045 * returned by this function are: 1046 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1047 */ public setReversible(bool value)1048 int setReversible(bool value) { 1049 int ret = libsbmlPINVOKE.Reaction_setReversible(swigCPtr, value); 1050 return ret; 1051 } 1052 1053 1054 /** 1055 * Sets the value of the 'fast' attribute of this Reaction. 1056 * 1057 * 1058 * 1059 * In SBML Level 3 Version 2, the 'fast' attribute was 1060 * removed. All reactions are assumed to be equivalent to reactions 1061 * in previous levels/versions that have a 'fast' attribute value 1062 * of @c false. Users should be aware that even for previous 1063 * levels/versions of the specification, 'fast' attribute values of 1064 * @c true never achieved widespread support, and many software 1065 * packages may ignore it. To achieve the same or similar 1066 * effects as setting the fast attribute to @c true for a given 1067 * reaction, the KineticLaw attribute should be constructed to 1068 * produce a value in the desired time scale, or else the 1069 * reaction could be replaced with an AssignmentRule or 1070 * AlgebraicRule. 1071 * 1072 * 1073 * 1074 * Calling this function with an argument of @c true for an 1075 * SBML Level 3 Version 2 Reaction will not set 1076 * the value, as the attribute does not exist for that level/version. 1077 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1078 * 1079 * @param value the value of the 'fast' attribute. 1080 * 1081 * 1082 * @return integer value indicating success/failure of the 1083 * function. @if clike The value is drawn from the 1084 * enumeration #OperationReturnValues_t. @endif The possible values 1085 * returned by this function are: 1086 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1087 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1088 * 1089 * 1090 * @warning <span class='warning'>SBML definitions before SBML Level 2 1091 * Version 2 incorrectly indicated that software tools could ignore the 1092 * 'fast' attribute if they did not implement support for the corresponding 1093 * concept; however, further research in SBML has revealed that this is not 1094 * true, and 'fast' <em>cannot be ignored</em> if it is set to @c true. 1095 * Beginning with SBML Level 2 Versions 2, the SBML specifications 1096 * therefore stipulate that if a model has any reactions with 'fast' set to 1097 * @c true, a software tool must be able to respect the attribute or else 1098 * indicate to the user that it does not have the capacity to do so. Readers 1099 * are directed to the SBML specifications, which provides more detail about 1100 * the conditions under which a reaction can be considered to be fast in this 1101 * sense.</span> 1102 * 1103 */ public setFast(bool value)1104 int setFast(bool value) { 1105 int ret = libsbmlPINVOKE.Reaction_setFast(swigCPtr, value); 1106 return ret; 1107 } 1108 1109 1110 /** 1111 * Sets the value of the 'compartment' attribute of this Reaction. 1112 * 1113 * The string @p sid is copied. 1114 * 1115 * @param sid the string to use as the compartment of this Reaction. 1116 * 1117 * 1118 * @return integer value indicating success/failure of the 1119 * function. @if clike The value is drawn from the 1120 * enumeration #OperationReturnValues_t. @endif The possible values 1121 * returned by this function are: 1122 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1123 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1124 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1125 * 1126 * @note The 'compartment' attribute is available in SBML 1127 * Level 3, but is not present on Reaction in 1128 * lower Levels of SBML. 1129 */ public setCompartment(string sid)1130 int setCompartment(string sid) { 1131 int ret = libsbmlPINVOKE.Reaction_setCompartment(swigCPtr, sid); 1132 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 1133 return ret; 1134 } 1135 1136 1137 /** 1138 * Unsets the value of the 'name' attribute of this Reaction. 1139 * 1140 * 1141 * 1142 * 1143 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 1144 * moved to SBase directly, instead of being defined individually for many 1145 * (but not all) objects. LibSBML has for a long time provided functions 1146 * defined on SBase itself to get, set, and unset those attributes, which 1147 * would fail or otherwise return empty strings if executed on any object 1148 * for which those attributes were not defined. Now that all SBase objects 1149 * define those attributes, those functions now succeed for any object with 1150 * the appropriate level and version. 1151 * 1152 * The 'name' attribute is 1153 * optional and is not intended to be used for cross-referencing purposes 1154 * within a model. Its purpose instead is to provide a human-readable 1155 * label for the component. The data type of 'name' is the type 1156 * <code>string</code> defined in XML Schema. SBML imposes no 1157 * restrictions as to the content of 'name' attributes beyond those 1158 * restrictions defined by the <code>string</code> type in XML Schema. 1159 * 1160 * The recommended practice for handling 'name' is as follows. If a 1161 * software tool has the capability for displaying the content of 'name' 1162 * attributes, it should display this content to the user as a 1163 * component's label instead of the component's 'id'. If the user 1164 * interface does not have this capability (e.g., because it cannot 1165 * display or use special characters in symbol names), or if the 'name' 1166 * attribute is missing on a given component, then the user interface 1167 * should display the value of the 'id' attribute instead. (Script 1168 * language interpreters are especially likely to display 'id' instead of 1169 * 'name'.) 1170 * 1171 * As a consequence of the above, authors of systems that automatically 1172 * generate the values of 'id' attributes should be aware some systems 1173 * may display the 'id''s to the user. Authors therefore may wish to 1174 * take some care to have their software create 'id' values that are: (a) 1175 * reasonably easy for humans to type and read; and (b) likely to be 1176 * meaningful, for example by making the 'id' attribute be an abbreviated 1177 * form of the name attribute value. 1178 * 1179 * An additional point worth mentioning is although there are 1180 * restrictions on the uniqueness of 'id' values, there are no 1181 * restrictions on the uniqueness of 'name' values in a model. This 1182 * allows software applications leeway in assigning component identifiers. 1183 * 1184 * Regardless of the level and version of the SBML, these functions allow 1185 * client applications to use more generalized code in some situations 1186 * (for instance, when manipulating objects that are all known to have 1187 * names). If the object in question does not posess a 'name' attribute 1188 * according to the SBML specification for the Level and Version in use, 1189 * libSBML will not allow the name to be set, nor will it read or 1190 * write 'name' attributes for those objects. 1191 * 1192 * 1193 * 1194 * 1195 * @return integer value indicating success/failure of the 1196 * function. @if clike The value is drawn from the 1197 * enumeration #OperationReturnValues_t. @endif The possible values 1198 * returned by this function are: 1199 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1200 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1201 * 1202 * @see getName() 1203 * @see setName(string sid) 1204 * @see isSetName() 1205 * 1206 * 1207 */ public new unsetName()1208 int unsetName() { 1209 int ret = libsbmlPINVOKE.Reaction_unsetName(swigCPtr); 1210 return ret; 1211 } 1212 1213 1214 /** 1215 * Unsets the 'kineticLaw' subelement of this Reaction. 1216 * 1217 * 1218 * @return integer value indicating success/failure of the 1219 * function. @if clike The value is drawn from the 1220 * enumeration #OperationReturnValues_t. @endif The possible values 1221 * returned by this function are: 1222 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1223 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1224 */ public unsetKineticLaw()1225 int unsetKineticLaw() { 1226 int ret = libsbmlPINVOKE.Reaction_unsetKineticLaw(swigCPtr); 1227 return ret; 1228 } 1229 1230 1231 /** 1232 * Unsets the value of the 'fast' attribute of this Reaction. 1233 * 1234 * 1235 * 1236 * In SBML Level 3 Version 2, the 'fast' attribute was 1237 * removed. All reactions are assumed to be equivalent to reactions 1238 * in previous levels/versions that have a 'fast' attribute value 1239 * of @c false. Users should be aware that even for previous 1240 * levels/versions of the specification, 'fast' attribute values of 1241 * @c true never achieved widespread support, and many software 1242 * packages may ignore it. To achieve the same or similar 1243 * effects as setting the fast attribute to @c true for a given 1244 * reaction, the KineticLaw attribute should be constructed to 1245 * produce a value in the desired time scale, or else the 1246 * reaction could be replaced with an AssignmentRule or 1247 * AlgebraicRule. 1248 * 1249 * 1250 * 1251 * 1252 * @return integer value indicating success/failure of the 1253 * function. @if clike The value is drawn from the 1254 * enumeration #OperationReturnValues_t. @endif The possible values 1255 * returned by this function are: 1256 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1257 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1258 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1259 * 1260 * 1261 * @warning <span class='warning'>SBML definitions before SBML Level 2 1262 * Version 2 incorrectly indicated that software tools could ignore the 1263 * 'fast' attribute if they did not implement support for the corresponding 1264 * concept; however, further research in SBML has revealed that this is not 1265 * true, and 'fast' <em>cannot be ignored</em> if it is set to @c true. 1266 * Beginning with SBML Level 2 Versions 2, the SBML specifications 1267 * therefore stipulate that if a model has any reactions with 'fast' set to 1268 * @c true, a software tool must be able to respect the attribute or else 1269 * indicate to the user that it does not have the capacity to do so. Readers 1270 * are directed to the SBML specifications, which provides more detail about 1271 * the conditions under which a reaction can be considered to be fast in this 1272 * sense.</span> 1273 * 1274 */ public unsetFast()1275 int unsetFast() { 1276 int ret = libsbmlPINVOKE.Reaction_unsetFast(swigCPtr); 1277 return ret; 1278 } 1279 1280 1281 /** 1282 * Unsets the value of the 'compartment' attribute of this Reaction. 1283 * 1284 * 1285 * @return integer value indicating success/failure of the 1286 * function. @if clike The value is drawn from the 1287 * enumeration #OperationReturnValues_t. @endif The possible values 1288 * returned by this function are: 1289 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1290 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1291 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1292 * 1293 * @note The 'compartment' attribute is available in SBML 1294 * Level 3, but is not present on Reaction in 1295 * lower Levels of SBML. 1296 */ public unsetCompartment()1297 int unsetCompartment() { 1298 int ret = libsbmlPINVOKE.Reaction_unsetCompartment(swigCPtr); 1299 return ret; 1300 } 1301 1302 1303 /** 1304 * Unsets the value of the 'reversible' attribute of this Reaction. 1305 * 1306 * 1307 * @return integer value indicating success/failure of the 1308 * function. @if clike The value is drawn from the 1309 * enumeration #OperationReturnValues_t. @endif The possible values 1310 * returned by this function are: 1311 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1312 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1313 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1314 */ public unsetReversible()1315 int unsetReversible() { 1316 int ret = libsbmlPINVOKE.Reaction_unsetReversible(swigCPtr); 1317 return ret; 1318 } 1319 1320 1321 /** 1322 * Adds a given SpeciesReference object as a reactant in this Reaction. 1323 * 1324 * The SpeciesReference instance in @p sr is copied. 1325 * 1326 * @param sr a SpeciesReference object referring to a Species in the 1327 * enclosing Model. 1328 * 1329 * 1330 * @return integer value indicating success/failure of the 1331 * function. @if clike The value is drawn from the 1332 * enumeration #OperationReturnValues_t. @endif The possible values 1333 * returned by this function are: 1334 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1335 * @li @link libsbml#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH@endlink 1336 * @li @link libsbml#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH@endlink 1337 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1338 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1339 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1340 * 1341 * 1342 * @note This method should be used with some caution. The fact that this 1343 * method @em copies the object passed to it means that the caller will be 1344 * left holding a physically different object instance than the one contained 1345 * inside this object. Changes made to the original object instance (such as 1346 * resetting attribute values) will <em>not affect the instance in this 1347 * object</em>. In addition, the caller should make sure to free the 1348 * original object if it is no longer being used, or else a memory leak will 1349 * result. Please see other methods on this class (particularly a 1350 * corresponding method whose name begins with the word <code>create</code>) 1351 * for alternatives that do not lead to these issues. 1352 * 1353 * 1354 * 1355 * @see createReactant() 1356 */ public addReactant(SpeciesReference sr)1357 int addReactant(SpeciesReference sr) { 1358 int ret = libsbmlPINVOKE.Reaction_addReactant__SWIG_0(swigCPtr, SpeciesReference.getCPtr(sr)); 1359 return ret; 1360 } 1361 1362 1363 /** 1364 * Adds the given species as a reactant with the given stoichiometry 1365 * 1366 * @param species the species to be added as reactant. 1367 * 1368 * @param stoichiometry an optional parameter specifying the 1369 * stoichiometry of the added reactant (defaulting to 1). 1370 * 1371 * @param id an optional id to be given to the species reference that will 1372 * be created. (defaulting to empty string, i.e. not set). 1373 * 1374 * @param constant an attribute specifying whether the species reference is 1375 * constant or not (defaulting to true). 1376 * 1377 * 1378 * @return integer value indicating success/failure of the 1379 * function. @if clike The value is drawn from the 1380 * enumeration #OperationReturnValues_t. @endif The possible values 1381 * returned by this function are: 1382 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1383 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1384 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1385 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1386 * 1387 * 1388 * @note This method should be used with some caution. The fact that this 1389 * method @em copies the object passed to it means that the caller will be 1390 * left holding a physically different object instance than the one contained 1391 * inside this object. Changes made to the original object instance (such as 1392 * resetting attribute values) will <em>not affect the instance in this 1393 * object</em>. In addition, the caller should make sure to free the 1394 * original object if it is no longer being used, or else a memory leak will 1395 * result. Please see other methods on this class (particularly a 1396 * corresponding method whose name begins with the word <code>create</code>) 1397 * for alternatives that do not lead to these issues. 1398 * 1399 * 1400 * 1401 * @note the Species object itself is NOT added to the model 1402 * 1403 * @see createProduct() 1404 */ public addReactant(Species species, double stoichiometry, string id, bool constant)1405 int addReactant(Species species, double stoichiometry, string id, bool constant) { 1406 int ret = libsbmlPINVOKE.Reaction_addReactant__SWIG_1(swigCPtr, Species.getCPtr(species), stoichiometry, id, constant); 1407 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 1408 return ret; 1409 } 1410 1411 1412 /** 1413 * Adds the given species as a reactant with the given stoichiometry 1414 * 1415 * @param species the species to be added as reactant. 1416 * 1417 * @param stoichiometry an optional parameter specifying the 1418 * stoichiometry of the added reactant (defaulting to 1). 1419 * 1420 * @param id an optional id to be given to the species reference that will 1421 * be created. (defaulting to empty string, i.e. not set). 1422 * 1423 * @param constant an attribute specifying whether the species reference is 1424 * constant or not (defaulting to true). 1425 * 1426 * 1427 * @return integer value indicating success/failure of the 1428 * function. @if clike The value is drawn from the 1429 * enumeration #OperationReturnValues_t. @endif The possible values 1430 * returned by this function are: 1431 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1432 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1433 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1434 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1435 * 1436 * 1437 * @note This method should be used with some caution. The fact that this 1438 * method @em copies the object passed to it means that the caller will be 1439 * left holding a physically different object instance than the one contained 1440 * inside this object. Changes made to the original object instance (such as 1441 * resetting attribute values) will <em>not affect the instance in this 1442 * object</em>. In addition, the caller should make sure to free the 1443 * original object if it is no longer being used, or else a memory leak will 1444 * result. Please see other methods on this class (particularly a 1445 * corresponding method whose name begins with the word <code>create</code>) 1446 * for alternatives that do not lead to these issues. 1447 * 1448 * 1449 * 1450 * @note the Species object itself is NOT added to the model 1451 * 1452 * @see createProduct() 1453 */ public addReactant(Species species, double stoichiometry, string id)1454 int addReactant(Species species, double stoichiometry, string id) { 1455 int ret = libsbmlPINVOKE.Reaction_addReactant__SWIG_2(swigCPtr, Species.getCPtr(species), stoichiometry, id); 1456 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 1457 return ret; 1458 } 1459 1460 1461 /** 1462 * Adds the given species as a reactant with the given stoichiometry 1463 * 1464 * @param species the species to be added as reactant. 1465 * 1466 * @param stoichiometry an optional parameter specifying the 1467 * stoichiometry of the added reactant (defaulting to 1). 1468 * 1469 * @param id an optional id to be given to the species reference that will 1470 * be created. (defaulting to empty string, i.e. not set). 1471 * 1472 * @param constant an attribute specifying whether the species reference is 1473 * constant or not (defaulting to true). 1474 * 1475 * 1476 * @return integer value indicating success/failure of the 1477 * function. @if clike The value is drawn from the 1478 * enumeration #OperationReturnValues_t. @endif The possible values 1479 * returned by this function are: 1480 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1481 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1482 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1483 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1484 * 1485 * 1486 * @note This method should be used with some caution. The fact that this 1487 * method @em copies the object passed to it means that the caller will be 1488 * left holding a physically different object instance than the one contained 1489 * inside this object. Changes made to the original object instance (such as 1490 * resetting attribute values) will <em>not affect the instance in this 1491 * object</em>. In addition, the caller should make sure to free the 1492 * original object if it is no longer being used, or else a memory leak will 1493 * result. Please see other methods on this class (particularly a 1494 * corresponding method whose name begins with the word <code>create</code>) 1495 * for alternatives that do not lead to these issues. 1496 * 1497 * 1498 * 1499 * @note the Species object itself is NOT added to the model 1500 * 1501 * @see createProduct() 1502 */ public addReactant(Species species, double stoichiometry)1503 int addReactant(Species species, double stoichiometry) { 1504 int ret = libsbmlPINVOKE.Reaction_addReactant__SWIG_3(swigCPtr, Species.getCPtr(species), stoichiometry); 1505 return ret; 1506 } 1507 1508 1509 /** 1510 * Adds the given species as a reactant with the given stoichiometry 1511 * 1512 * @param species the species to be added as reactant. 1513 * 1514 * @param stoichiometry an optional parameter specifying the 1515 * stoichiometry of the added reactant (defaulting to 1). 1516 * 1517 * @param id an optional id to be given to the species reference that will 1518 * be created. (defaulting to empty string, i.e. not set). 1519 * 1520 * @param constant an attribute specifying whether the species reference is 1521 * constant or not (defaulting to true). 1522 * 1523 * 1524 * @return integer value indicating success/failure of the 1525 * function. @if clike The value is drawn from the 1526 * enumeration #OperationReturnValues_t. @endif The possible values 1527 * returned by this function are: 1528 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1529 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1530 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1531 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1532 * 1533 * 1534 * @note This method should be used with some caution. The fact that this 1535 * method @em copies the object passed to it means that the caller will be 1536 * left holding a physically different object instance than the one contained 1537 * inside this object. Changes made to the original object instance (such as 1538 * resetting attribute values) will <em>not affect the instance in this 1539 * object</em>. In addition, the caller should make sure to free the 1540 * original object if it is no longer being used, or else a memory leak will 1541 * result. Please see other methods on this class (particularly a 1542 * corresponding method whose name begins with the word <code>create</code>) 1543 * for alternatives that do not lead to these issues. 1544 * 1545 * 1546 * 1547 * @note the Species object itself is NOT added to the model 1548 * 1549 * @see createProduct() 1550 */ public addReactant(Species species)1551 int addReactant(Species species) { 1552 int ret = libsbmlPINVOKE.Reaction_addReactant__SWIG_4(swigCPtr, Species.getCPtr(species)); 1553 return ret; 1554 } 1555 1556 1557 /** 1558 * Adds a given SpeciesReference object as a product in this Reaction. 1559 * 1560 * The SpeciesReference instance in @p sr is copied. 1561 * 1562 * @param sr a SpeciesReference object referring to a Species in the 1563 * enclosing Model. 1564 * 1565 * 1566 * @return integer value indicating success/failure of the 1567 * function. @if clike The value is drawn from the 1568 * enumeration #OperationReturnValues_t. @endif The possible values 1569 * returned by this function are: 1570 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1571 * @li @link libsbml#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH@endlink 1572 * @li @link libsbml#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH@endlink 1573 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1574 * 1575 * 1576 * @note This method should be used with some caution. The fact that this 1577 * method @em copies the object passed to it means that the caller will be 1578 * left holding a physically different object instance than the one contained 1579 * inside this object. Changes made to the original object instance (such as 1580 * resetting attribute values) will <em>not affect the instance in this 1581 * object</em>. In addition, the caller should make sure to free the 1582 * original object if it is no longer being used, or else a memory leak will 1583 * result. Please see other methods on this class (particularly a 1584 * corresponding method whose name begins with the word <code>create</code>) 1585 * for alternatives that do not lead to these issues. 1586 * 1587 * 1588 * 1589 * @see createProduct() 1590 */ public addProduct(SpeciesReference sr)1591 int addProduct(SpeciesReference sr) { 1592 int ret = libsbmlPINVOKE.Reaction_addProduct__SWIG_0(swigCPtr, SpeciesReference.getCPtr(sr)); 1593 return ret; 1594 } 1595 1596 1597 /** 1598 * Adds the given species as a product with the given stoichiometry 1599 * 1600 * @param species the species to be added as product. 1601 * 1602 * @param stoichiometry an optional parameter specifying the 1603 * stoichiometry of the added product (defaulting to 1). 1604 * 1605 * @param id an optional id to be given to the species reference that will 1606 * be created. (defaulting to empty string, i.e. not set). 1607 * 1608 * @param constant an attribute specifying whether the species reference is 1609 * constant or not (defaulting to true). 1610 * 1611 * 1612 * @return integer value indicating success/failure of the 1613 * function. @if clike The value is drawn from the 1614 * enumeration #OperationReturnValues_t. @endif The possible values 1615 * returned by this function are: 1616 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1617 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1618 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1619 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1620 * 1621 * 1622 * @note This method should be used with some caution. The fact that this 1623 * method @em copies the object passed to it means that the caller will be 1624 * left holding a physically different object instance than the one contained 1625 * inside this object. Changes made to the original object instance (such as 1626 * resetting attribute values) will <em>not affect the instance in this 1627 * object</em>. In addition, the caller should make sure to free the 1628 * original object if it is no longer being used, or else a memory leak will 1629 * result. Please see other methods on this class (particularly a 1630 * corresponding method whose name begins with the word <code>create</code>) 1631 * for alternatives that do not lead to these issues. 1632 * 1633 * 1634 * 1635 * @note the Species object itself is NOT added to the model 1636 * 1637 * @see createProduct() 1638 */ public addProduct(Species species, double stoichiometry, string id, bool constant)1639 int addProduct(Species species, double stoichiometry, string id, bool constant) { 1640 int ret = libsbmlPINVOKE.Reaction_addProduct__SWIG_1(swigCPtr, Species.getCPtr(species), stoichiometry, id, constant); 1641 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 1642 return ret; 1643 } 1644 1645 1646 /** 1647 * Adds the given species as a product with the given stoichiometry 1648 * 1649 * @param species the species to be added as product. 1650 * 1651 * @param stoichiometry an optional parameter specifying the 1652 * stoichiometry of the added product (defaulting to 1). 1653 * 1654 * @param id an optional id to be given to the species reference that will 1655 * be created. (defaulting to empty string, i.e. not set). 1656 * 1657 * @param constant an attribute specifying whether the species reference is 1658 * constant or not (defaulting to true). 1659 * 1660 * 1661 * @return integer value indicating success/failure of the 1662 * function. @if clike The value is drawn from the 1663 * enumeration #OperationReturnValues_t. @endif The possible values 1664 * returned by this function are: 1665 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1666 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1667 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1668 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1669 * 1670 * 1671 * @note This method should be used with some caution. The fact that this 1672 * method @em copies the object passed to it means that the caller will be 1673 * left holding a physically different object instance than the one contained 1674 * inside this object. Changes made to the original object instance (such as 1675 * resetting attribute values) will <em>not affect the instance in this 1676 * object</em>. In addition, the caller should make sure to free the 1677 * original object if it is no longer being used, or else a memory leak will 1678 * result. Please see other methods on this class (particularly a 1679 * corresponding method whose name begins with the word <code>create</code>) 1680 * for alternatives that do not lead to these issues. 1681 * 1682 * 1683 * 1684 * @note the Species object itself is NOT added to the model 1685 * 1686 * @see createProduct() 1687 */ public addProduct(Species species, double stoichiometry, string id)1688 int addProduct(Species species, double stoichiometry, string id) { 1689 int ret = libsbmlPINVOKE.Reaction_addProduct__SWIG_2(swigCPtr, Species.getCPtr(species), stoichiometry, id); 1690 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 1691 return ret; 1692 } 1693 1694 1695 /** 1696 * Adds the given species as a product with the given stoichiometry 1697 * 1698 * @param species the species to be added as product. 1699 * 1700 * @param stoichiometry an optional parameter specifying the 1701 * stoichiometry of the added product (defaulting to 1). 1702 * 1703 * @param id an optional id to be given to the species reference that will 1704 * be created. (defaulting to empty string, i.e. not set). 1705 * 1706 * @param constant an attribute specifying whether the species reference is 1707 * constant or not (defaulting to true). 1708 * 1709 * 1710 * @return integer value indicating success/failure of the 1711 * function. @if clike The value is drawn from the 1712 * enumeration #OperationReturnValues_t. @endif The possible values 1713 * returned by this function are: 1714 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1715 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1716 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1717 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1718 * 1719 * 1720 * @note This method should be used with some caution. The fact that this 1721 * method @em copies the object passed to it means that the caller will be 1722 * left holding a physically different object instance than the one contained 1723 * inside this object. Changes made to the original object instance (such as 1724 * resetting attribute values) will <em>not affect the instance in this 1725 * object</em>. In addition, the caller should make sure to free the 1726 * original object if it is no longer being used, or else a memory leak will 1727 * result. Please see other methods on this class (particularly a 1728 * corresponding method whose name begins with the word <code>create</code>) 1729 * for alternatives that do not lead to these issues. 1730 * 1731 * 1732 * 1733 * @note the Species object itself is NOT added to the model 1734 * 1735 * @see createProduct() 1736 */ public addProduct(Species species, double stoichiometry)1737 int addProduct(Species species, double stoichiometry) { 1738 int ret = libsbmlPINVOKE.Reaction_addProduct__SWIG_3(swigCPtr, Species.getCPtr(species), stoichiometry); 1739 return ret; 1740 } 1741 1742 1743 /** 1744 * Adds the given species as a product with the given stoichiometry 1745 * 1746 * @param species the species to be added as product. 1747 * 1748 * @param stoichiometry an optional parameter specifying the 1749 * stoichiometry of the added product (defaulting to 1). 1750 * 1751 * @param id an optional id to be given to the species reference that will 1752 * be created. (defaulting to empty string, i.e. not set). 1753 * 1754 * @param constant an attribute specifying whether the species reference is 1755 * constant or not (defaulting to true). 1756 * 1757 * 1758 * @return integer value indicating success/failure of the 1759 * function. @if clike The value is drawn from the 1760 * enumeration #OperationReturnValues_t. @endif The possible values 1761 * returned by this function are: 1762 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1763 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1764 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1765 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1766 * 1767 * 1768 * @note This method should be used with some caution. The fact that this 1769 * method @em copies the object passed to it means that the caller will be 1770 * left holding a physically different object instance than the one contained 1771 * inside this object. Changes made to the original object instance (such as 1772 * resetting attribute values) will <em>not affect the instance in this 1773 * object</em>. In addition, the caller should make sure to free the 1774 * original object if it is no longer being used, or else a memory leak will 1775 * result. Please see other methods on this class (particularly a 1776 * corresponding method whose name begins with the word <code>create</code>) 1777 * for alternatives that do not lead to these issues. 1778 * 1779 * 1780 * 1781 * @note the Species object itself is NOT added to the model 1782 * 1783 * @see createProduct() 1784 */ public addProduct(Species species)1785 int addProduct(Species species) { 1786 int ret = libsbmlPINVOKE.Reaction_addProduct__SWIG_4(swigCPtr, Species.getCPtr(species)); 1787 return ret; 1788 } 1789 1790 1791 /** 1792 * Adds a given ModifierSpeciesReference object as a product in this 1793 * Reaction. 1794 * 1795 * The ModifierSpeciesReference instance in @p msr is copied. 1796 * 1797 * @param msr a ModifierSpeciesReference object referring to a Species in 1798 * the enclosing Model. 1799 * 1800 * 1801 * @return integer value indicating success/failure of the 1802 * function. @if clike The value is drawn from the 1803 * enumeration #OperationReturnValues_t. @endif The possible values 1804 * returned by this function are: 1805 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1806 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 1807 * @li @link libsbml#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH@endlink 1808 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1809 * @li @link libsbml#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH@endlink 1810 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 1811 * 1812 * 1813 * @note This method should be used with some caution. The fact that this 1814 * method @em copies the object passed to it means that the caller will be 1815 * left holding a physically different object instance than the one contained 1816 * inside this object. Changes made to the original object instance (such as 1817 * resetting attribute values) will <em>not affect the instance in this 1818 * object</em>. In addition, the caller should make sure to free the 1819 * original object if it is no longer being used, or else a memory leak will 1820 * result. Please see other methods on this class (particularly a 1821 * corresponding method whose name begins with the word <code>create</code>) 1822 * for alternatives that do not lead to these issues. 1823 * 1824 * 1825 * 1826 * @see createModifier() 1827 */ public addModifier(ModifierSpeciesReference msr)1828 int addModifier(ModifierSpeciesReference msr) { 1829 int ret = libsbmlPINVOKE.Reaction_addModifier__SWIG_0(swigCPtr, ModifierSpeciesReference.getCPtr(msr)); 1830 return ret; 1831 } 1832 1833 1834 /** 1835 * Adds the given species as a modifier to this reaction 1836 * 1837 * @param species the species to be added as modifier. 1838 * 1839 * @param id an optional id to be given to the species reference that will 1840 * be created. (defaulting to empty string, i.e. not set). 1841 * 1842 * 1843 * @return integer value indicating success/failure of the 1844 * function. @if clike The value is drawn from the 1845 * enumeration #OperationReturnValues_t. @endif The possible values 1846 * returned by this function are: 1847 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1848 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1849 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1850 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1851 * 1852 * 1853 * @note This method should be used with some caution. The fact that this 1854 * method @em copies the object passed to it means that the caller will be 1855 * left holding a physically different object instance than the one contained 1856 * inside this object. Changes made to the original object instance (such as 1857 * resetting attribute values) will <em>not affect the instance in this 1858 * object</em>. In addition, the caller should make sure to free the 1859 * original object if it is no longer being used, or else a memory leak will 1860 * result. Please see other methods on this class (particularly a 1861 * corresponding method whose name begins with the word <code>create</code>) 1862 * for alternatives that do not lead to these issues. 1863 * 1864 * 1865 * 1866 * @note the Species object itself is NOT added to the model 1867 * 1868 * @see createModifier() 1869 */ public addModifier(Species species, string id)1870 int addModifier(Species species, string id) { 1871 int ret = libsbmlPINVOKE.Reaction_addModifier__SWIG_1(swigCPtr, Species.getCPtr(species), id); 1872 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 1873 return ret; 1874 } 1875 1876 1877 /** 1878 * Adds the given species as a modifier to this reaction 1879 * 1880 * @param species the species to be added as modifier. 1881 * 1882 * @param id an optional id to be given to the species reference that will 1883 * be created. (defaulting to empty string, i.e. not set). 1884 * 1885 * 1886 * @return integer value indicating success/failure of the 1887 * function. @if clike The value is drawn from the 1888 * enumeration #OperationReturnValues_t. @endif The possible values 1889 * returned by this function are: 1890 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1891 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 1892 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1893 * @li @link libsbml#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID@endlink 1894 * 1895 * 1896 * @note This method should be used with some caution. The fact that this 1897 * method @em copies the object passed to it means that the caller will be 1898 * left holding a physically different object instance than the one contained 1899 * inside this object. Changes made to the original object instance (such as 1900 * resetting attribute values) will <em>not affect the instance in this 1901 * object</em>. In addition, the caller should make sure to free the 1902 * original object if it is no longer being used, or else a memory leak will 1903 * result. Please see other methods on this class (particularly a 1904 * corresponding method whose name begins with the word <code>create</code>) 1905 * for alternatives that do not lead to these issues. 1906 * 1907 * 1908 * 1909 * @note the Species object itself is NOT added to the model 1910 * 1911 * @see createModifier() 1912 */ public addModifier(Species species)1913 int addModifier(Species species) { 1914 int ret = libsbmlPINVOKE.Reaction_addModifier__SWIG_2(swigCPtr, Species.getCPtr(species)); 1915 return ret; 1916 } 1917 1918 1919 /** 1920 * Creates a new SpeciesReference, adds it to this Reaction's list of 1921 * reactants, and returns it. 1922 * 1923 * @return a new SpeciesReference object. 1924 */ public createReactant()1925 SpeciesReference createReactant() { 1926 SpeciesReference ret 1927 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_createReactant(swigCPtr), false); 1928 return ret; 1929 } 1930 1931 1932 /** 1933 * Creates a new SpeciesReference, adds it to this Reaction's list of 1934 * products, and returns it. 1935 * 1936 * @return a new SpeciesReference object. 1937 */ public createProduct()1938 SpeciesReference createProduct() { 1939 SpeciesReference ret 1940 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_createProduct(swigCPtr), false); 1941 return ret; 1942 } 1943 1944 1945 /** 1946 * Creates a new ModifierSpeciesReference, adds it to this Reaction's 1947 * list of modifiers and returns it. 1948 * 1949 * @return a new ModifierSpeciesReference object. 1950 */ public createModifier()1951 ModifierSpeciesReference createModifier() { 1952 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_createModifier(swigCPtr); 1953 ModifierSpeciesReference ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, false); 1954 return ret; 1955 } 1956 1957 1958 /** 1959 * Creates a new KineticLaw object, installs it as this Reaction's 1960 * 'kineticLaw' subelement, and returns it. 1961 * 1962 * If this Reaction had a previous KineticLaw, it will be destroyed. 1963 * 1964 * @return the new KineticLaw object. 1965 */ public createKineticLaw()1966 KineticLaw createKineticLaw() { 1967 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_createKineticLaw(swigCPtr); 1968 KineticLaw ret = (cPtr == global::System.IntPtr.Zero) ? null : new KineticLaw(cPtr, false); 1969 return ret; 1970 } 1971 1972 1973 /** 1974 * Returns the list of reactants in this Reaction object. 1975 * 1976 * @return the ListOfSpeciesReferences containing the references to the 1977 * species acting as reactants in this reaction. 1978 */ public getListOfReactants()1979 ListOfSpeciesReferences getListOfReactants() { 1980 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_getListOfReactants__SWIG_0(swigCPtr); 1981 ListOfSpeciesReferences ret = (cPtr == global::System.IntPtr.Zero) ? null : new ListOfSpeciesReferences(cPtr, false); 1982 return ret; 1983 } 1984 1985 1986 /** 1987 * Returns the list of products in this Reaction object. 1988 * 1989 * @return the ListOfSpeciesReferences containing the references to the 1990 * species acting as products in this reaction. 1991 */ public getListOfProducts()1992 ListOfSpeciesReferences getListOfProducts() { 1993 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_getListOfProducts__SWIG_0(swigCPtr); 1994 ListOfSpeciesReferences ret = (cPtr == global::System.IntPtr.Zero) ? null : new ListOfSpeciesReferences(cPtr, false); 1995 return ret; 1996 } 1997 1998 1999 /** 2000 * Returns the list of modifiers in this Reaction object. 2001 * 2002 * @return the ListOfSpeciesReferences containing the references to the 2003 * species acting as modifiers in this reaction. 2004 */ public getListOfModifiers()2005 ListOfSpeciesReferences getListOfModifiers() { 2006 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_getListOfModifiers__SWIG_0(swigCPtr); 2007 ListOfSpeciesReferences ret = (cPtr == global::System.IntPtr.Zero) ? null : new ListOfSpeciesReferences(cPtr, false); 2008 return ret; 2009 } 2010 2011 2012 /** 2013 * Returns the nth reactant species (as a SpeciesReference object) in 2014 * the list of reactants in this Reaction. 2015 * 2016 * Callers should first call getNumReactants() to find out how many 2017 * reactants there are, to avoid using an invalid index number. 2018 * 2019 * @param n the index of the reactant sought. 2020 * 2021 * @return the nth reactant (as a SpeciesReference object) of this 2022 * Reaction. 2023 * If the index @p n is invalid, @c null is returned. 2024 */ public getReactant(long n)2025 SpeciesReference getReactant(long n) { 2026 SpeciesReference ret 2027 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_getReactant__SWIG_0(swigCPtr, n), false); 2028 return ret; 2029 } 2030 2031 2032 /** 2033 * Returns the reactant species (as a SpeciesReference object) having 2034 * a specific identifier in this Reaction. 2035 * 2036 * @param species the identifier of the reactant Species ('species' 2037 * attribute of the reactant SpeciesReference object). 2038 * 2039 * @return a SpeciesReference object, or @c null if no species with the 2040 * given identifier @p species appears as a reactant in this Reaction. 2041 */ public getReactant(string species)2042 SpeciesReference getReactant(string species) { 2043 SpeciesReference ret 2044 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_getReactant__SWIG_2(swigCPtr, species), false); 2045 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2046 return ret; 2047 } 2048 2049 2050 /** 2051 * Returns the nth product species (as a SpeciesReference object) in 2052 * the list of products in this Reaction. 2053 * 2054 * Callers should first call getNumProducts() to find out how many 2055 * products there are, to avoid using an invalid index number. 2056 * 2057 * @param n the index of the product sought. 2058 * 2059 * @return the nth product (as a SpeciesReference object) of this 2060 * Reaction. 2061 * If the index @p n is invalid, @c null is returned. 2062 */ public getProduct(long n)2063 SpeciesReference getProduct(long n) { 2064 SpeciesReference ret 2065 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_getProduct__SWIG_0(swigCPtr, n), false); 2066 return ret; 2067 } 2068 2069 2070 /** 2071 * Returns the product species (as a SpeciesReference object) having 2072 * a specific identifier in this Reaction. 2073 * 2074 * @param species the identifier of the product Species ('species' 2075 * attribute of the product SpeciesReference object). 2076 * 2077 * @return a SpeciesReference object, or @c null if no species with the 2078 * given identifier @p species appears as a product in this Reaction. 2079 */ public getProduct(string species)2080 SpeciesReference getProduct(string species) { 2081 SpeciesReference ret 2082 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_getProduct__SWIG_2(swigCPtr, species), false); 2083 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2084 return ret; 2085 } 2086 2087 2088 /** 2089 * Returns the nth modifier species (as a ModifierSpeciesReference object) 2090 * in the list of modifiers of this Reaction. 2091 * 2092 * Callers should first call getNumModifiers() to find out how many 2093 * modifiers there are, to avoid using an invalid index number. 2094 * 2095 * @param n the index of the modifier species sought. 2096 * 2097 * @return the nth modifier (as a ModifierSpeciesReference object) of 2098 * this Reaction. 2099 * If the index @p n is invalid, @c null is returned. 2100 */ public getModifier(long n)2101 ModifierSpeciesReference getModifier(long n) { 2102 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_getModifier__SWIG_0(swigCPtr, n); 2103 ModifierSpeciesReference ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, false); 2104 return ret; 2105 } 2106 2107 2108 /** 2109 * Returns the modifier species (as a ModifierSpeciesReference object) 2110 * having a specific identifier in this Reaction. 2111 * 2112 * @param species the identifier of the modifier Species ('species' 2113 * attribute of the ModifierSpeciesReference object). 2114 * 2115 * @return a ModifierSpeciesReference object, or @c null if no species with 2116 * the given identifier @p species appears as a modifier in this 2117 * Reaction. 2118 */ public getModifier(string species)2119 ModifierSpeciesReference getModifier(string species) { 2120 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_getModifier__SWIG_2(swigCPtr, species); 2121 ModifierSpeciesReference ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, false); 2122 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2123 return ret; 2124 } 2125 2126 2127 /** 2128 * Returns the number of reactant species in this Reaction. 2129 * 2130 * @return the number of reactants in this Reaction. 2131 */ public getNumReactants()2132 long getNumReactants() { return (long)libsbmlPINVOKE.Reaction_getNumReactants(swigCPtr); } 2133 2134 2135 /** 2136 * Returns the number of product species in this Reaction. 2137 * 2138 * @return the number of products in this Reaction. 2139 */ public getNumProducts()2140 long getNumProducts() { return (long)libsbmlPINVOKE.Reaction_getNumProducts(swigCPtr); } 2141 2142 2143 /** 2144 * Returns the number of modifier species in this Reaction. 2145 * 2146 * @return the number of modifiers in this Reaction. 2147 */ public getNumModifiers()2148 long getNumModifiers() { return (long)libsbmlPINVOKE.Reaction_getNumModifiers(swigCPtr); } 2149 2150 2151 /** 2152 * Removes the nth reactant species (SpeciesReference object) in the list of 2153 * reactants in this Reaction and returns a pointer to it. 2154 * 2155 * The caller owns the returned object and is responsible for deleting it. 2156 * The caller should first call getNumReactants() to find out how many 2157 * reactants there are, to avoid using an invalid index number. 2158 * 2159 * @param n the index of the reactant SpeciesReference object to remove. 2160 * 2161 * @return the removed reactant SpeciesReference object, or @c null if the 2162 * given index is out of range. 2163 */ public removeReactant(long n)2164 SpeciesReference removeReactant(long n) { 2165 SpeciesReference ret 2166 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_removeReactant__SWIG_0(swigCPtr, n), true); 2167 return ret; 2168 } 2169 2170 2171 /** 2172 * Removes the reactant species (SpeciesReference object) having the given 2173 * 'species' attribute in this Reaction and returns a pointer to it. 2174 * 2175 * The caller owns the returned object and is responsible for deleting it. 2176 * 2177 * @param species the 'species' attribute of the reactant SpeciesReference 2178 * object. 2179 * 2180 * @return the removed reactant SpeciesReference object, or @c null if no 2181 * reactant SpeciesReference object with the given 'species' attribute 2182 * @p species exists in this Reaction. 2183 */ public removeReactant(string species)2184 SpeciesReference removeReactant(string species) { 2185 SpeciesReference ret 2186 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_removeReactant__SWIG_1(swigCPtr, species), true); 2187 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2188 return ret; 2189 } 2190 2191 2192 /** 2193 * Removes the nth product species (SpeciesReference object) in the list of 2194 * products in this Reaction and returns a pointer to it. 2195 * 2196 * The caller owns the returned object and is responsible for deleting it. 2197 * The caller should first call getNumProducts() to find out how many 2198 * products there are, to avoid using an invalid index number. 2199 * 2200 * @param n the index of the product SpeciesReference object to remove. 2201 * 2202 * @return the removed product SpeciesReference object, or @c null if the 2203 * given index is out of range. 2204 */ public removeProduct(long n)2205 SpeciesReference removeProduct(long n) { 2206 SpeciesReference ret 2207 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_removeProduct__SWIG_0(swigCPtr, n), true); 2208 return ret; 2209 } 2210 2211 2212 /** 2213 * Removes the product species (SpeciesReference object) having the given 2214 * 'species' attribute in this Reaction and returns a pointer to it. 2215 * 2216 * The caller owns the returned object and is responsible for deleting it. 2217 * 2218 * @param species the 'species' attribute of the product SpeciesReference 2219 * object. 2220 * 2221 * @return the removed product SpeciesReference object, or @c null if no 2222 * product SpeciesReference object with the given 'species' attribute 2223 * @p species exists in this Reaction. 2224 */ public removeProduct(string species)2225 SpeciesReference removeProduct(string species) { 2226 SpeciesReference ret 2227 = (SpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.Reaction_removeProduct__SWIG_1(swigCPtr, species), true); 2228 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2229 return ret; 2230 } 2231 2232 2233 /** 2234 * Removes the nth modifier species (ModifierSpeciesReference object) in 2235 * the list of modifiers in this Reaction and returns a pointer to it. 2236 * 2237 * The caller owns the returned object and is responsible for deleting it. 2238 * The caller should first call getNumModifiers() to find out how many 2239 * modifiers there are, to avoid using an invalid index number. 2240 * 2241 * @param n the index of the ModifierSpeciesReference object to remove. 2242 * 2243 * @return the removed ModifierSpeciesReference object, or @c null if the 2244 * given index is out of range. 2245 */ public removeModifier(long n)2246 ModifierSpeciesReference removeModifier(long n) { 2247 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_removeModifier__SWIG_0(swigCPtr, n); 2248 ModifierSpeciesReference ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, true); 2249 return ret; 2250 } 2251 2252 2253 /** 2254 * Removes the modifier species (ModifierSpeciesReference object) having 2255 * the given 'species' attribute in this Reaction and returns a pointer to it. 2256 * 2257 * The caller owns the returned object and is responsible for deleting it. 2258 * 2259 * @param species the 'species' attribute of the ModifierSpeciesReference 2260 * object. 2261 * 2262 * @return the removed ModifierSpeciesReference object, or @c null if no 2263 * ModifierSpeciesReference object with the given 'species' attribute @p 2264 * species exists in this Reaction. 2265 */ public removeModifier(string species)2266 ModifierSpeciesReference removeModifier(string species) { 2267 global::System.IntPtr cPtr = libsbmlPINVOKE.Reaction_removeModifier__SWIG_1(swigCPtr, species); 2268 ModifierSpeciesReference ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, true); 2269 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2270 return ret; 2271 } 2272 connectToChild()2273 public override void connectToChild() { 2274 libsbmlPINVOKE.Reaction_connectToChild(swigCPtr); 2275 } 2276 2277 2278 /** */ /* libsbml-internal */ public new enablePackageInternal(string pkgURI, string pkgPrefix, bool flag)2279 void enablePackageInternal(string pkgURI, string pkgPrefix, bool flag) { 2280 libsbmlPINVOKE.Reaction_enablePackageInternal(swigCPtr, pkgURI, pkgPrefix, flag); 2281 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2282 } 2283 2284 2285 /** */ /* libsbml-internal */ public new updateSBMLNamespace(string package, long level, long version)2286 void updateSBMLNamespace(string package, long level, long version) { 2287 libsbmlPINVOKE.Reaction_updateSBMLNamespace(swigCPtr, package, level, version); 2288 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2289 } 2290 2291 2292 /** 2293 * Returns the libSBML type code for this SBML object. 2294 * 2295 * 2296 * 2297 * LibSBML attaches an identifying code to every kind of SBML object. These 2298 * are integer constants known as <em>SBML type codes</em>. The names of all 2299 * the codes begin with the characters <code>SBML_</code>. 2300 * @if clike The set of possible type codes for core elements is defined in 2301 * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for 2302 * SBML Level 3 packages define their own extra enumerations of type 2303 * codes (e.g., #SBMLLayoutTypeCode_t for the Level 3 Layout 2304 * package).@endif@if java In the Java language interface for libSBML, the 2305 * type codes are defined as static integer constants in the interface class 2306 * {@link libsbmlConstants}. @endif@if python In the Python language 2307 * interface for libSBML, the type codes are defined as static integer 2308 * constants in the interface class @link libsbml@endlink.@endif@if csharp In 2309 * the C# language interface for libSBML, the type codes are defined as 2310 * static integer constants in the interface class 2311 * @link libsbmlcs.libsbml@endlink.@endif Note that different Level 3 2312 * package plug-ins may use overlapping type codes; to identify the package 2313 * to which a given object belongs, call the 2314 * <code>@if conly SBase_getPackageName() 2315 * @else SBase::getPackageName() 2316 * @endif</code> 2317 * method on the object. 2318 * 2319 * The exception to this is lists: all SBML-style list elements have the type 2320 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they 2321 * are from. 2322 * 2323 * 2324 * 2325 * @return the SBML type code for this object: 2326 * @link libsbml#SBML_REACTION SBML_REACTION@endlink (default). 2327 * 2328 * 2329 * @warning <span class='warning'>The specific integer values of the possible 2330 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 2331 * packages, To fully identify the correct code, <strong>it is necessary to 2332 * invoke both getPackageName() and getTypeCode()</strong> (or 2333 * ListOf::getItemTypeCode()).</span> 2334 * 2335 * 2336 * 2337 * @see getElementName() 2338 * @see getPackageName() 2339 */ public new getTypeCode()2340 int getTypeCode() { 2341 int ret = libsbmlPINVOKE.Reaction_getTypeCode(swigCPtr); 2342 return ret; 2343 } 2344 2345 2346 /** 2347 * Returns the XML element name of this object, which for Reaction, is 2348 * always @c 'reaction'. 2349 * 2350 * @return the name of this element, i.e., @c 'reaction'. 2351 */ public new getElementName()2352 string getElementName() { 2353 string ret = libsbmlPINVOKE.Reaction_getElementName(swigCPtr); 2354 return ret; 2355 } 2356 2357 2358 /** 2359 * Predicate returning @c true if all the required attributes for this 2360 * Reaction object have been set. 2361 * 2362 * The required attributes for a Reaction object are: 2363 * @li 'id' (or 'name' in SBML Level 1) 2364 * @li 'fast' (in Level 3 Version 1 only, where it is defined as a required attribute) 2365 * @li 'reversible' (in Level 3 only, where it is defined as a required attribute) 2366 * 2367 * @return @c true if the required attributes have been set, @c false 2368 * otherwise. 2369 */ public new hasRequiredAttributes()2370 bool hasRequiredAttributes() { 2371 bool ret = libsbmlPINVOKE.Reaction_hasRequiredAttributes(swigCPtr); 2372 return ret; 2373 } 2374 2375 } 2376 2377 } 2378