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 assignment to a variable by an SBML <em>event</em>. 23 * 24 * Event contains an optional element called 'listOfEventAssignments', of 25 * class ListOfEventAssignments. In every instance of an event definition 26 * in a model, the object's 'listOfEventAssignments' element must have a 27 * non-empty list of one or more 'eventAssignment' elements of class 28 * EventAssignment. The object class EventAssignment has one required 29 * attribute, 'variable', and a required element, 'math'. Being derived 30 * from SBase, it also has all the usual attributes and elements of its 31 * parent class. 32 * 33 * An Event object defines when the event can occur, the variables that are 34 * affected by the event, and how the variables are affected. The purpose 35 * of the EventAssignment object class is to define how variables are 36 * affected by an Event. In SBML Level 2, every Event object instance 37 * must have a nonempty list of event assignments; in SBML Level 3, 38 * the list of assignments is optional. 39 * 40 * The operation of an Event is divided into two phases (regardless of 41 * whether a delay is involved): one phase when the event is @em triggered, 42 * and the other when the event is @em executed. EventAssignment objects 43 * are interpreted when an event is executed. The effects are described 44 * below. 45 * 46 * @section event-variable The attribute 'variable' 47 * 48 * The EventAssignment attribute 'variable' must be the identifier of an 49 * existing Compartment, Species, SpeciesReference, or Parameter 50 * instance defined in the model. In SBML Level 3 Version 2, 51 * this list was expanded to include identifiers of SBML Level 3 52 * package variables that have both mathematical meaning and the 53 * ability to be assigned. When the event is executed, the value of 54 * the model component identified by 'variable' is changed by the 55 * EventAssignment to the value computed by the 'math' element; that is, a 56 * species' quantity, species reference's stoichiometry, compartment's size 57 * or parameter's value are reset to the value computed by 'math'. 58 * 59 * Certain restrictions are placed on what can appear in 'variable': 60 * <ul> 61 * <li> The object identified by the value of the EventAssignment attribute 62 * 'variable' must not have its 'constant' attribute set to or default to 63 * @c true. (Constants cannot be affected by events.) 64 * 65 * <li> The 'variable' attribute must not contain the identifier of a 66 * reaction. In SBML Level 2 and SBML Level 3 Version 1, 67 * only species, species references, compartment and parameter 68 * values may be set by an Event. In SBML Level 3 Version 2, 69 * the 'variable' attribute may also be the identifier of an SBML 70 * Level 3 package element with mathematical meaning and the 71 * ability to be assigned a value. This situation may only arise if 72 * the SBML package is present in the SBML document with a 73 * package:required attribute of @c true 74 * 75 * <li> The value of every 'variable' attribute must be unique among the set 76 * of EventAssignment structures within a given Event structure. In other 77 * words, a single event cannot have multiple EventAssignment objects 78 * assigning the same variable. (All of them would be performed at the 79 * same time when that particular Event triggers, resulting in 80 * indeterminacy.) However, @em separate Event instances can refer to the 81 * same variable. 82 * 83 * <li> A variable cannot be assigned a value in an EventAssignment object 84 * instance and also be assigned a value by an AssignmentRule; i.e., the 85 * value of an EventAssignment's 'variable' attribute cannot be the same as 86 * the value of a AssignmentRule' 'variable' attribute. (Assignment rules 87 * hold at all times, therefore it would be inconsistent to also define an 88 * event that reassigns the value of the same variable.) 89 * </ul> 90 * 91 * If the variable attribute of an EventAssignment object references an 92 * object in an SBML namespace that is not understood by the interpreter 93 * reading a given SBML document (that is, if the object is defined by an 94 * SBML Level 3 package that the software does not support), the 95 * event assignment must be ignored--the object's value will not need to 96 * be set, as the interpreter could not understand that package. If an 97 * interpreter cannot establish whether a referenced object is missing 98 * from the model or instead is defined in an SBML namespace not 99 * understood by the interpreter, it may produce a warning to the user. 100 * (The latter situation may only arise if an SBML package is present in 101 * the SBML document with a package:required attribute of 'true'.) 102 * 103 * Note that the time of assignment of the object identified by the 104 * value of the 'variable' attribute is always the time at which the Event 105 * is <em>executed</em>, not when it is <em>triggered</em>. The timing is 106 * controlled by the optional Delay in an Event. The time of 107 * assignment is not affected by the 'useValuesFromTriggerTime' 108 * attribute on Event---that attribute affects the time at which the 109 * EventAssignment's 'math' expression is @em evaluated. In other 110 * words, SBML allows decoupling the time at which the 111 * 'variable' is assigned from the time at which its value 112 * expression is calculated. 113 * 114 * @section event-math The 'math' subelement in an EventAssignment 115 * 116 * The MathML expression contained in an EventAssignment defines the new 117 * value of the variable being assigned by the Event. 118 * 119 * As mentioned above, the time at which the expression in 'math' is 120 * evaluated is determined by the attribute 'useValuesFromTriggerTime' on 121 * Event. If the attribute value is @c true, the expression must be 122 * evaluated when the event is @em triggered; more precisely, the values of 123 * identifiers occurring in MathML <code><ci></code> elements in the 124 * EventAssignment's 'math' expression are the values they have at the 125 * point when the event @em triggered. If, instead, 126 * 'useValuesFromTriggerTime''s value is @c false, it means the values at 127 * @em execution time should be used; that is, the values of identifiers 128 * occurring in MathML <code><ci></code> elements in the 129 * EventAssignment's 'math' expression are the values they have at the 130 * point when the event @em executed. 131 * 132 * @section eventassignment-version-diffs SBML Level/Version differences 133 * 134 * Between Version 4 and previous versions of SBML Level 2, the 135 * requirements regarding the matching of units between an 136 * EvengAssignment's formula and the units of the object identified by the 137 * 'variable' attribute changed. Previous versions required consistency, 138 * but in SBML Level 2 Version 4 and in SBML Level 3, unit 139 * consistency is only @em recommended. More precisely: 140 * <ul> 141 * 142 * <li> In the case of a species, an EventAssignment sets the referenced 143 * species' quantity (concentration or amount of substance) to the value 144 * determined by the formula in the EventAssignment's 'math' subelement. 145 * The units of the 'math' formula should (in SBML Level 2 146 * Version 4 and in Level 3) or must (in previous Versions of 147 * Level 2) be identical to the units of the species. 148 * 149 * <li> (SBML Level 3 only.) In the case of a species reference, an 150 * EventAssignment sets the stoichiometry of the reactant or product 151 * referenced by the SpeciesReference object to the value determined by the 152 * formula in the 'math' element. The unit associated with the value 153 * produced by the 'math' formula should be @c dimensionless, because 154 * reactant and product stoichiometries in reactions are dimensionless 155 * quantities. 156 * 157 * <li> In the case of a compartment, an EventAssignment sets the 158 * referenced compartment's size to the size determined by the formula in 159 * the 'math' subelement of the EventAssignment. The overall units of the 160 * formula should (in SBML Level 2 Version 4 and in Level 3) 161 * or must (in previous Versions of Level 2) be identical to the units 162 * specified for the size of the compartment identified by the 163 * EventAssignment's 'variable' attribute. 164 * 165 * <li> In the case of a parameter, an EventAssignment sets the referenced 166 * parameter's value to that determined by the formula in 'math'. The 167 * overall units of the formula should (in SBML Level 2 Version 4 168 * and Level 3) or must (in previous Versions of Level 2) be 169 * identical to the units defined for the parameter. 170 * 171 * <li> (For SBML Level 3 Version 2 only) <em>In the case of 172 * an object from an SBML Level 3 package</em>, an EventAssignment sets 173 * the referenced object's value (as defined by that package) to the 174 * value of the formula in 'math'. The unit of measurement associated 175 * with the value produced by the formula should be the same as that 176 * object's units attribute value (if it has such an attribute), or be 177 * equal to the units of model components of that type (if objects of 178 * that class are defined by the package as having the same units). 179 * </ul> 180 * 181 * Note that the formula placed in the 'math' element <em>has no assumed 182 * units</em>. The consistency of the units of the formula, and the units 183 * of the entity which the assignment affects, must be explicitly 184 * established just as in the case of the value of the Delay subelement. 185 * An approach similar to the one discussed in the context of Delay may be 186 * used for the formula of an EventAssignment. 187 * 188 * @section event-asnt-restrictions Restrictions relaxed in SBML Level 3 Version 2 189 * 190 * In SBML Level 3 Version 2, the requirement that an EventAssignment 191 * have a 'math' subelement was relaxed, making it optional. In 192 * this case, the EventAssignment remains undefined, and unless that information 193 * is provided in some other form (such as with an SBML Level 3 194 * package), the Event behaves as if it had no EventAssignment. 195 * 196 * @see Event 197 * 198 * 199 * 200 */ 201 202 public class EventAssignment : SBase { 203 private HandleRef swigCPtr; 204 EventAssignment(IntPtr cPtr, bool cMemoryOwn)205 internal EventAssignment(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.EventAssignment_SWIGUpcast(cPtr), cMemoryOwn) 206 { 207 //super(libsbmlPINVOKE.EventAssignmentUpcast(cPtr), cMemoryOwn); 208 swigCPtr = new HandleRef(this, cPtr); 209 } 210 getCPtr(EventAssignment obj)211 internal static HandleRef getCPtr(EventAssignment obj) 212 { 213 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 214 } 215 getCPtrAndDisown(EventAssignment obj)216 internal static HandleRef getCPtrAndDisown (EventAssignment obj) 217 { 218 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 219 220 if (obj != null) 221 { 222 ptr = obj.swigCPtr; 223 obj.swigCMemOwn = false; 224 } 225 226 return ptr; 227 } 228 Dispose(bool disposing)229 protected override void Dispose(bool disposing) { 230 lock(this) { 231 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 232 if (swigCMemOwn) { 233 swigCMemOwn = false; 234 libsbmlPINVOKE.delete_EventAssignment(swigCPtr); 235 } 236 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 237 } 238 base.Dispose(disposing); 239 } 240 } 241 242 243 /** 244 * Creates a new EventAssignment using the given SBML @p level and @p version 245 * values. 246 * 247 * @param level a long integer, the SBML Level to assign to this EventAssignment. 248 * 249 * @param version a long integer, the SBML Version to assign to this 250 * EventAssignment. 251 * 252 * 253 * @throws SBMLConstructorException 254 * Thrown if the given @p level and @p version combination are invalid 255 * or if this object is incompatible with the given level and version. 256 * 257 * 258 * 259 * 260 * @note Attempting to add an object to an SBMLDocument having a different 261 * combination of SBML Level, Version and XML namespaces than the object 262 * itself will result in an error at the time a caller attempts to make the 263 * addition. A parent object must have compatible Level, Version and XML 264 * namespaces. (Strictly speaking, a parent may also have more XML 265 * namespaces than a child, but the reverse is not permitted.) The 266 * restriction is necessary to ensure that an SBML model has a consistent 267 * overall structure. This requires callers to manage their objects 268 * carefully, but the benefit is increased flexibility in how models can be 269 * created by permitting callers to create objects bottom-up if desired. In 270 * situations where objects are not yet attached to parents (e.g., 271 * SBMLDocument), knowledge of the intented SBML Level and Version help 272 * libSBML determine such things as whether it is valid to assign a 273 * particular value to an attribute. 274 * 275 * 276 */ public EventAssignment(long level, long version)277 EventAssignment(long level, long version) : this(libsbmlPINVOKE.new_EventAssignment__SWIG_0(level, version), true) { 278 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 279 } 280 281 282 /** 283 * Creates a new EventAssignment using the given SBMLNamespaces object 284 * @p sbmlns. 285 * 286 * 287 * 288 * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces 289 * information. It is used to communicate the SBML Level, Version, and (in 290 * Level 3) packages used in addition to SBML Level 3 Core. A 291 * common approach to using libSBML's SBMLNamespaces facilities is to create an 292 * SBMLNamespaces object somewhere in a program once, then hand that object 293 * as needed to object constructors that accept SBMLNamespaces as arguments. 294 * 295 * 296 * 297 * @param sbmlns an SBMLNamespaces object. 298 * 299 * 300 * @throws SBMLConstructorException 301 * Thrown if the given @p sbmlns is inconsistent or incompatible 302 * with this object. 303 * 304 * 305 * 306 * 307 * @note Attempting to add an object to an SBMLDocument having a different 308 * combination of SBML Level, Version and XML namespaces than the object 309 * itself will result in an error at the time a caller attempts to make the 310 * addition. A parent object must have compatible Level, Version and XML 311 * namespaces. (Strictly speaking, a parent may also have more XML 312 * namespaces than a child, but the reverse is not permitted.) The 313 * restriction is necessary to ensure that an SBML model has a consistent 314 * overall structure. This requires callers to manage their objects 315 * carefully, but the benefit is increased flexibility in how models can be 316 * created by permitting callers to create objects bottom-up if desired. In 317 * situations where objects are not yet attached to parents (e.g., 318 * SBMLDocument), knowledge of the intented SBML Level and Version help 319 * libSBML determine such things as whether it is valid to assign a 320 * particular value to an attribute. 321 * 322 * 323 */ public EventAssignment(SBMLNamespaces sbmlns)324 EventAssignment(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_EventAssignment__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) { 325 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 326 } 327 328 329 /** 330 * Copy constructor; creates a copy of this EventAssignment. 331 * 332 * @param orig the object to copy. 333 */ public EventAssignment(EventAssignment orig)334 EventAssignment(EventAssignment orig) : this(libsbmlPINVOKE.new_EventAssignment__SWIG_2(EventAssignment.getCPtr(orig)), true) { 335 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 336 } 337 338 339 /** 340 * Creates and returns a deep copy of this EventAssignment object. 341 * 342 * @return the (deep) copy of this EventAssignment object. 343 */ public new clone()344 EventAssignment clone() { 345 global::System.IntPtr cPtr = libsbmlPINVOKE.EventAssignment_clone(swigCPtr); 346 EventAssignment ret = (cPtr == global::System.IntPtr.Zero) ? null : new EventAssignment(cPtr, true); 347 return ret; 348 } 349 350 351 /** 352 * Get the value of this EventAssignment's 'variable' attribute. 353 * 354 * @return the identifier stored in the 'variable' attribute of this 355 * EventAssignment. 356 */ public getVariable()357 string getVariable() { 358 string ret = libsbmlPINVOKE.EventAssignment_getVariable(swigCPtr); 359 return ret; 360 } 361 362 363 /** 364 * Get the mathematical expression in this EventAssignment's 'math' 365 * subelement. 366 * 367 * @return the top ASTNode of an abstract syntax tree representing the 368 * mathematical formula in this EventAssignment, or @c null if the math is not set. 369 */ public new getMath()370 ASTNode getMath() { 371 global::System.IntPtr cPtr = libsbmlPINVOKE.EventAssignment_getMath(swigCPtr); 372 ASTNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new ASTNode(cPtr, false); 373 return ret; 374 } 375 376 377 /** 378 * Predicate for testing whether the attribute 'variable' of this 379 * EventAssignment is set. 380 * 381 * @return @c true if the 'variable' attribute of this EventAssignment 382 * is set, @c false otherwise. 383 */ public isSetVariable()384 bool isSetVariable() { 385 bool ret = libsbmlPINVOKE.EventAssignment_isSetVariable(swigCPtr); 386 return ret; 387 } 388 389 390 /** 391 * Predicate for testing whether the 'math' subelement of this 392 * EventAssignment is set. 393 * 394 * @return @c true if this EventAssignment has a 'math' subelement, 395 * @c false otherwise. 396 */ public isSetMath()397 bool isSetMath() { 398 bool ret = libsbmlPINVOKE.EventAssignment_isSetMath(swigCPtr); 399 return ret; 400 } 401 402 403 /** 404 * Sets the attribute 'variable' of this EventAssignment to a copy of 405 * the given identifier string. 406 * 407 * @param sid the identifier of an element defined in this model that 408 * can vary over time. 409 * 410 * 411 * @return integer value indicating success/failure of the 412 * function. @if clike The value is drawn from the 413 * enumeration #OperationReturnValues_t. @endif The possible values 414 * returned by this function are: 415 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 416 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 417 */ public setVariable(string sid)418 int setVariable(string sid) { 419 int ret = libsbmlPINVOKE.EventAssignment_setVariable(swigCPtr, sid); 420 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 421 return ret; 422 } 423 424 425 /** 426 * Unsets the attribute 'variable' of this EventAssignment. 427 * 428 * 429 * @return integer value indicating success/failure of the 430 * function. @if clike The value is drawn from the 431 * enumeration #OperationReturnValues_t. @endif The possible values 432 * returned by this function are: 433 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 434 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 435 */ public unsetVariable()436 int unsetVariable() { 437 int ret = libsbmlPINVOKE.EventAssignment_unsetVariable(swigCPtr); 438 return ret; 439 } 440 441 442 /** 443 * Sets the 'math' subelement of this EventAssignment to a copy of the 444 * given ASTNode. 445 * 446 * @param math an ASTNode that will be copied and stored as the 447 * mathematical formula for this EventAssignment. 448 * 449 * 450 * @return integer value indicating success/failure of the 451 * function. @if clike The value is drawn from the 452 * enumeration #OperationReturnValues_t. @endif The possible values 453 * returned by this function are: 454 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 455 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 456 */ public new setMath(ASTNode math)457 int setMath(ASTNode math) { 458 int ret = libsbmlPINVOKE.EventAssignment_setMath(swigCPtr, ASTNode.getCPtr(math)); 459 return ret; 460 } 461 462 463 /** 464 * Calculates and returns a UnitDefinition that expresses the units of 465 * measurement assumed for the 'math' expression of this EventAssignment. 466 * 467 * 468 * 469 * The units are calculated based on the mathematical expression in the 470 * EventAssignment and the model quantities referenced by 471 * <code><ci></code> elements used within that expression. The method 472 * getDerivedUnitDefinition() returns the calculated units, 473 * to the extent that libSBML can compute them. 474 * 475 * 476 * 477 * @note The functionality that facilitates unit analysis depends on the 478 * model as a whole. Thus, in cases where the object has not been added to 479 * a model or the model itself is incomplete, unit analysis is not possible 480 * and this method will return @c null. 481 * 482 * 483 * 484 * 485 * @warning Note that it is possible the 'math' expression in the 486 * EventAssignment contains literal numbers or parameters with undeclared 487 * units. In those cases, it is not possible to calculate the units of the 488 * overall expression without making assumptions. LibSBML does not make 489 * assumptions about the units, and 490 * getDerivedUnitDefinition() only returns the units as far 491 * as it is able to determine them. For example, in an expression <em>X + 492 * Y</em>, if <em>X</em> has unambiguously-defined units and <em>Y</em> does 493 * not, it will return the units of <em>X</em>. When using this method, 494 * <strong>it is critical that callers also invoke the method</strong> 495 * containsUndeclaredUnits() <strong>to determine whether 496 * this situation holds</strong>. Callers should take suitable action in 497 * those situations. 498 * 499 * 500 * 501 * @return a UnitDefinition that expresses the units of the math 502 * expression of this EventAssignment, or @c null if one cannot be constructed. 503 * 504 * @see containsUndeclaredUnits() 505 */ public getDerivedUnitDefinition()506 UnitDefinition getDerivedUnitDefinition() { 507 global::System.IntPtr cPtr = libsbmlPINVOKE.EventAssignment_getDerivedUnitDefinition__SWIG_0(swigCPtr); 508 UnitDefinition ret = (cPtr == global::System.IntPtr.Zero) ? null : new UnitDefinition(cPtr, false); 509 return ret; 510 } 511 512 513 /** 514 * Predicate returning @c true if the math expression of this 515 * EventAssignment contains literal numbers or parameters with undeclared 516 * units. 517 * 518 * 519 * 520 * The units are calculated based on the mathematical expression in the 521 * EventAssignment and the model quantities referenced by 522 * <code><ci></code> elements used within that expression. The method 523 * getDerivedUnitDefinition() returns the calculated units, 524 * to the extent that libSBML can compute them. 525 * 526 * 527 * If the expression contains literal numbers or parameters with undeclared 528 * units, libSBML may not be able to compute the full units of the 529 * expression and will only return what it can compute. Callers should 530 * always use containsUndeclaredUnits() when using 531 * getDerivedUnitDefinition() to decide whether the 532 * returned units may be incomplete. 533 * 534 * @return @c true if the math expression of this EventAssignment 535 * includes parameters/numbers 536 * with undeclared units, @c false otherwise. 537 * 538 * @note A return value of @c true indicates that the UnitDefinition 539 * returned by getDerivedUnitDefinition() may not 540 * accurately represent the units of the expression. 541 * 542 * @see getDerivedUnitDefinition() 543 */ public containsUndeclaredUnits()544 bool containsUndeclaredUnits() { 545 bool ret = libsbmlPINVOKE.EventAssignment_containsUndeclaredUnits__SWIG_0(swigCPtr); 546 return ret; 547 } 548 549 550 /** 551 * Returns the libSBML type code of this object instance. 552 * 553 * 554 * 555 * LibSBML attaches an identifying code to every kind of SBML object. These 556 * are integer constants known as <em>SBML type codes</em>. The names of all 557 * the codes begin with the characters <code>SBML_</code>. 558 * @if clike The set of possible type codes for core elements is defined in 559 * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for 560 * SBML Level 3 packages define their own extra enumerations of type 561 * codes (e.g., #SBMLLayoutTypeCode_t for the Level 3 Layout 562 * package).@endif@if java In the Java language interface for libSBML, the 563 * type codes are defined as static integer constants in the interface class 564 * {@link libsbmlConstants}. @endif@if python In the Python language 565 * interface for libSBML, the type codes are defined as static integer 566 * constants in the interface class @link libsbml@endlink.@endif@if csharp In 567 * the C# language interface for libSBML, the type codes are defined as 568 * static integer constants in the interface class 569 * @link libsbmlcs.libsbml@endlink.@endif Note that different Level 3 570 * package plug-ins may use overlapping type codes; to identify the package 571 * to which a given object belongs, call the 572 * <code>@if conly SBase_getPackageName() 573 * @else SBase::getPackageName() 574 * @endif</code> 575 * method on the object. 576 * 577 * The exception to this is lists: all SBML-style list elements have the type 578 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they 579 * are from. 580 * 581 * 582 * 583 * @return the SBML type code for this object: 584 * @link libsbml#SBML_EVENT_ASSIGNMENT SBML_EVENT_ASSIGNMENT@endlink (default). 585 * 586 * 587 * @warning <span class='warning'>The specific integer values of the possible 588 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 589 * packages, To fully identify the correct code, <strong>it is necessary to 590 * invoke both getPackageName() and getTypeCode()</strong> (or 591 * ListOf::getItemTypeCode()).</span> 592 * 593 * 594 * 595 * @see getElementName() 596 * @see getPackageName() 597 */ public new getTypeCode()598 int getTypeCode() { 599 int ret = libsbmlPINVOKE.EventAssignment_getTypeCode(swigCPtr); 600 return ret; 601 } 602 603 604 /** 605 * Returns the XML element name of this object, which for 606 * EventAssignment, is always @c 'eventAssignment'. 607 * 608 * @return the name of this element, i.e., @c 'eventAssignment'. 609 */ public new getElementName()610 string getElementName() { 611 string ret = libsbmlPINVOKE.EventAssignment_getElementName(swigCPtr); 612 return ret; 613 } 614 615 616 /** 617 * Predicate returning @c true if all the required attributes for this 618 * EventAssignment object have been set. 619 * 620 * The required attributes for a EventAssignment object are: 621 * @li 'variable' 622 * 623 * @return @c true if the required attributes have been set, @c false 624 * otherwise. 625 */ public new hasRequiredAttributes()626 bool hasRequiredAttributes() { 627 bool ret = libsbmlPINVOKE.EventAssignment_hasRequiredAttributes(swigCPtr); 628 return ret; 629 } 630 631 632 /** 633 * Predicate returning @c true if all the required elements for this 634 * EventAssignment object have been set. 635 * 636 * @note The required elements for an EventAssignment object are: 637 * @li 'math' in SBML Level 2 and Level 3 Version 1. 638 * (In SBML Level 3 Version 2+, it is no longer required.) 639 * 640 * @return a boolean value indicating whether all the required 641 * elements for this object have been defined. 642 */ public new hasRequiredElements()643 bool hasRequiredElements() { 644 bool ret = libsbmlPINVOKE.EventAssignment_hasRequiredElements(swigCPtr); 645 return ret; 646 } 647 648 649 /** 650 * Returns the value of the 'variable' attribute of this EventAssignment (NOT the 'id'). 651 * 652 * @note Because of the inconsistent behavior of this function with 653 * respect to assignments and rules, it is now recommended to 654 * use the getIdAttribute() or getVariable() instead. 655 * 656 * The 'variable' attribute of an EventAssignment indicates the element which 657 * the results of the 'math' are to be applied upon Event execution. 658 * 659 * @return the variable of this EventAssignment. 660 * 661 * @see getIdAttribute() 662 * @see setIdAttribute(string sid) 663 * @see isSetIdAttribute() 664 * @see unsetIdAttribute() 665 * @see getVariable() 666 */ public new getId()667 string getId() { 668 string ret = libsbmlPINVOKE.EventAssignment_getId(swigCPtr); 669 return ret; 670 } 671 672 673 /** 674 * 675 * Replaces all uses of a given @c SIdRef type attribute value with another 676 * value. 677 * 678 * 679 * 680 681 * In SBML, object identifiers are of a data type called <code>SId</code>. 682 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 683 * introduced for attribute values that refer to <code>SId</code> values; in 684 * previous Levels of SBML, this data type did not exist and attributes were 685 * simply described to as 'referring to an identifier', but the effective 686 * data type was the same as <code>SIdRef</code> in Level 3. These and 687 * other methods of libSBML refer to the type <code>SIdRef</code> for all 688 * Levels of SBML, even if the corresponding SBML specification did not 689 * explicitly name the data type. 690 * 691 * 692 * 693 * This method works by looking at all attributes and (if appropriate) 694 * mathematical formulas in MathML content, comparing the referenced 695 * identifiers to the value of @p oldid. If any matches are found, the 696 * matching values are replaced with @p newid. The method does @em not 697 * descend into child elements. 698 * 699 * @param oldid the old identifier. 700 * @param newid the new identifier. 701 * 702 * 703 */ public new renameSIdRefs(string oldid, string newid)704 void renameSIdRefs(string oldid, string newid) { 705 libsbmlPINVOKE.EventAssignment_renameSIdRefs(swigCPtr, oldid, newid); 706 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 707 } 708 709 710 /** 711 * 712 * Replaces all uses of a given @c UnitSIdRef type attribute value with 713 * another value. 714 * 715 * 716 * 717 * In SBML, unit definitions have identifiers of type <code>UnitSId</code>. In 718 * SBML Level 3, an explicit data type called <code>UnitSIdRef</code> was 719 * introduced for attribute values that refer to <code>UnitSId</code> values; in 720 * previous Levels of SBML, this data type did not exist and attributes were 721 * simply described to as 'referring to a unit identifier', but the effective 722 * data type was the same as <code>UnitSIdRef</code> in Level 3. These and 723 * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all 724 * Levels of SBML, even if the corresponding SBML specification did not 725 * explicitly name the data type. 726 * 727 * 728 * 729 * This method works by looking at all unit identifier attribute values 730 * (including, if appropriate, inside mathematical formulas), comparing the 731 * referenced unit identifiers to the value of @p oldid. If any matches 732 * are found, the matching values are replaced with @p newid. The method 733 * does @em not descend into child elements. 734 * 735 * @param oldid the old identifier. 736 * @param newid the new identifier. 737 * 738 * 739 */ public new renameUnitSIdRefs(string oldid, string newid)740 void renameUnitSIdRefs(string oldid, string newid) { 741 libsbmlPINVOKE.EventAssignment_renameUnitSIdRefs(swigCPtr, oldid, newid); 742 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 743 } 744 745 746 /** */ /* libsbml-internal */ public new replaceSIDWithFunction(string id, ASTNode function)747 void replaceSIDWithFunction(string id, ASTNode function) { 748 libsbmlPINVOKE.EventAssignment_replaceSIDWithFunction(swigCPtr, id, ASTNode.getCPtr(function)); 749 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 750 } 751 752 753 /** */ /* libsbml-internal */ public new divideAssignmentsToSIdByFunction(string id, ASTNode function)754 void divideAssignmentsToSIdByFunction(string id, ASTNode function) { 755 libsbmlPINVOKE.EventAssignment_divideAssignmentsToSIdByFunction(swigCPtr, id, ASTNode.getCPtr(function)); 756 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 757 } 758 759 760 /** */ /* libsbml-internal */ public new multiplyAssignmentsToSIdByFunction(string id, ASTNode function)761 void multiplyAssignmentsToSIdByFunction(string id, ASTNode function) { 762 libsbmlPINVOKE.EventAssignment_multiplyAssignmentsToSIdByFunction(swigCPtr, id, ASTNode.getCPtr(function)); 763 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 764 } 765 766 } 767 768 } 769