1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 4.0.2
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10 
11 namespace libsbml {
12 
13  using System;
14  using System.Runtime.InteropServices;
15 
16 /**
17  * @sbmlpackage{core}
18  *
19 @htmlinclude pkg-marker-core.html The trigger expression for an SBML <em>event</em>.
20  *
21  * An Event object defines when the event can occur, the variables that are
22  * affected by the event, and how the variables are affected.  The Trigger
23  * construct in SBML is used to define a mathematical expression that
24  * determines when an Event is @em triggered.
25  *
26  * A Trigger object in SBML Level&nbsp;2 and Level&nbsp;3 contains one
27  * subelement named 'math' containing a MathML expression.  The expression
28  * is evaluated as a value of type @c boolean.  The exact moment at which
29  * the expression evaluates to @c true is the time point when the Event is
30  * @em triggered.  In SBML Level&nbsp;3, Trigger has additional attributes
31  * that must be assigned values; they are discussed in a separate section
32  * below.
33  *
34  * In SBML Level&nbsp;2 and SBML Level&nbsp;3 Version&nbsp;1, the 'math'
35  * subelement is required, and it must evaluate to a @c boolean expression.
36  * In SBML Level&nbsp;3 Version&nbsp;2, those restrictions are relaxed:
37  * the 'math' element is optional, and numeric values are allowed in
38  * Boolean contexts (a '0' is interpreted as @c false, and all other
39  * values are interpreted as @c true).  If a Trigger with no 'math'
40  * is present in an Event, that Event will never @em trigger, unless that
41  * missing information is included in an SBML Level&nbsp;3 package.
42  *
43  * An event only @em triggers when its Trigger expression makes the
44  * transition in value from @c false to @c true.  The event will also
45  * trigger at any subsequent time points when the trigger makes this
46  * transition; in other words, an event can be triggered multiple times
47  * during a simulation if its trigger condition makes the transition from
48  * @c false to @c true more than once.  In SBML Level&nbsp;3, the behavior
49  * at the very start of simulation (i.e., at <em>t = 0</em>, where
50  * <em>t</em> stands for time) is determined in part by the boolean flag
51  * 'initialValue'.  This and other additional features introduced in SBML
52  * Level&nbsp;3 are discussed further below.
53  *
54  * @section trigger-version-diffs Version differences
55  *
56  * SBML Level&nbsp;3 Version&nbsp;1 introduces two required attributes
57  * on the Trigger object: 'persistent' and 'initialValue'.  The rest of
58  * this introduction describes these two attributes.
59  *
60  * @subsection trigger-persistent The 'persistent' attribute on Trigger
61  *
62  * In the interval between when an Event object <em>triggers</em> (i.e.,
63  * its Trigger object expression transitions in value from @c false to
64  * @c true) and when its assignments are to be <em>executed</em>, conditions
65  * in the model may change such that the trigger expression transitions
66  * back from @c true to @c false.  Should the event's assignments still be
67  * made if this happens?  Answering this question is the purpose of the
68  * 'persistent' attribute on Trigger.
69  *
70  * If the boolean attribute 'persistent' has a value of @c true, then once
71  * the event is triggered, all of its assignments are always performed when
72  * the time of execution is reached.  The name @em persistent is meant to
73  * evoke the idea that the trigger expression does not have to be
74  * re-checked after it triggers if 'persistent'=@c true.  Conversely, if
75  * the attribute value is @c false, then the trigger expression is not
76  * assumed to persist: if the expression transitions in value back to
77  * @c false at any time between when the event triggered and when it is to be
78  * executed, the event is no longer considered to have triggered and its
79  * assignments are not executed.  (If the trigger expression transitions
80  * once more to @c true after that point, then the event is triggered, but
81  * this then constitutes a whole new event trigger-and-execute sequence.)
82  *
83  * The 'persistent' attribute can be especially useful when Event objects
84  * contain Delay objects, but it is relevant even in a model without delays
85  * if the model contains two or more events.  As explained in the
86  * introduction to this section, the operation of all events in SBML
87  * (delayed or not) is conceptually divided into two phases,
88  * <em>triggering</em> and <em>execution</em>; however, unless events have
89  * priorities associated with them, SBML does not mandate a particular
90  * ordering of event execution in the case of simultaneous events.  Models
91  * with multiple events can lead to situations where the execution of one
92  * event affects another event's trigger expression value.  If that other
93  * event has 'persistent'=@c false, and its trigger expression evaluates to
94  * @c false before it is to be executed, the event must not be executed
95  * after all.
96  *
97  * @subsection trigger-initialvalue The 'initialValue' attribute on Trigger
98  *
99  * As mentioned above, an event <em>triggers</em> when the mathematical
100  * expression in its Trigger object transitions in value from @c false to
101  * @c true.  An unanswered question concerns what happens at the start of a
102  * simulation: can event triggers make this transition at <em>t = 0</em>,
103  * where <em>t</em> stands for time?
104  *
105  * In order to determine whether an event may trigger at <em>t = 0</em>, it
106  * is necessary to know what value the Trigger object's 'math' expression
107  * had immediately prior to <em>t = 0</em>.  This starting value of the
108  * trigger expression is determined by the value of the boolean attribute
109  * 'initialValue'.  A value of @c true means the trigger expression is
110  * taken to have the value @c true immediately prior to <em>t = 0</em>.  In
111  * that case, the trigger cannot transition in value from @c false to
112  * @c true at the moment simulation begins (because it has the value @c true
113  * both before and after <em>t = 0</em>), and can only make the transition
114  * from @c false to @c true sometime <em>after</em> <em>t = 0</em>.  (To do
115  * that, it would also first have to transition to @c false before it could
116  * make the transition from @c false back to @c true.)  Conversely, if
117  * 'initialValue'=@c false, then the trigger expression is assumed to start
118  * with the value @c false, and therefore may trigger at <em>t = 0</em> if
119  * the expression evaluates to @c true at that moment.
120  *
121  *
122  * @see Event
123  * @see Delay
124  * @see EventAssignment
125  */
126 
127 public class Trigger : SBase {
128 	private HandleRef swigCPtr;
129 
Trigger(IntPtr cPtr, bool cMemoryOwn)130 	internal Trigger(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.Trigger_SWIGUpcast(cPtr), cMemoryOwn)
131 	{
132 		//super(libsbmlPINVOKE.TriggerUpcast(cPtr), cMemoryOwn);
133 		swigCPtr = new HandleRef(this, cPtr);
134 	}
135 
getCPtr(Trigger obj)136 	internal static HandleRef getCPtr(Trigger obj)
137 	{
138 		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
139 	}
140 
getCPtrAndDisown(Trigger obj)141 	internal static HandleRef getCPtrAndDisown (Trigger obj)
142 	{
143 		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
144 
145 		if (obj != null)
146 		{
147 			ptr             = obj.swigCPtr;
148 			obj.swigCMemOwn = false;
149 		}
150 
151 		return ptr;
152 	}
153 
Dispose(bool disposing)154   protected override void Dispose(bool disposing) {
155     lock(this) {
156       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
157         if (swigCMemOwn) {
158           swigCMemOwn = false;
159           libsbmlPINVOKE.delete_Trigger(swigCPtr);
160         }
161         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
162       }
163       base.Dispose(disposing);
164     }
165   }
166 
167 
168 /**
169    * Creates a new Trigger using the given SBML @p level and @p version
170    * values.
171    *
172    * @param level a long integer, the SBML Level to assign to this Trigger.
173    *
174    * @param version a long integer, the SBML Version to assign to this
175    * Trigger.
176    *
177    *
178  * @throws SBMLConstructorException
179  * Thrown if the given @p level and @p version combination are invalid
180  * or if this object is incompatible with the given level and version.
181  *
182  *
183    *
184    *
185  * @note Attempting to add an object to an SBMLDocument having a different
186  * combination of SBML Level, Version and XML namespaces than the object
187  * itself will result in an error at the time a caller attempts to make the
188  * addition.  A parent object must have compatible Level, Version and XML
189  * namespaces.  (Strictly speaking, a parent may also have more XML
190  * namespaces than a child, but the reverse is not permitted.)  The
191  * restriction is necessary to ensure that an SBML model has a consistent
192  * overall structure.  This requires callers to manage their objects
193  * carefully, but the benefit is increased flexibility in how models can be
194  * created by permitting callers to create objects bottom-up if desired.  In
195  * situations where objects are not yet attached to parents (e.g.,
196  * SBMLDocument), knowledge of the intented SBML Level and Version help
197  * libSBML determine such things as whether it is valid to assign a
198  * particular value to an attribute.
199  *
200  *
201    */ public
Trigger(long level, long version)202  Trigger(long level, long version) : this(libsbmlPINVOKE.new_Trigger__SWIG_0(level, version), true) {
203     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
204   }
205 
206 
207 /**
208    * Creates a new Trigger using the given SBMLNamespaces object
209    * @p sbmlns.
210    *
211    *
212  *
213  * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
214  * information.  It is used to communicate the SBML Level, Version, and (in
215  * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
216  * common approach to using libSBML's SBMLNamespaces facilities is to create an
217  * SBMLNamespaces object somewhere in a program once, then hand that object
218  * as needed to object constructors that accept SBMLNamespaces as arguments.
219  *
220  *
221    *
222    * @param sbmlns an SBMLNamespaces object.
223    *
224    *
225  * @throws SBMLConstructorException
226  * Thrown if the given @p sbmlns is inconsistent or incompatible
227  * with this object.
228  *
229  *
230    *
231    *
232  * @note Attempting to add an object to an SBMLDocument having a different
233  * combination of SBML Level, Version and XML namespaces than the object
234  * itself will result in an error at the time a caller attempts to make the
235  * addition.  A parent object must have compatible Level, Version and XML
236  * namespaces.  (Strictly speaking, a parent may also have more XML
237  * namespaces than a child, but the reverse is not permitted.)  The
238  * restriction is necessary to ensure that an SBML model has a consistent
239  * overall structure.  This requires callers to manage their objects
240  * carefully, but the benefit is increased flexibility in how models can be
241  * created by permitting callers to create objects bottom-up if desired.  In
242  * situations where objects are not yet attached to parents (e.g.,
243  * SBMLDocument), knowledge of the intented SBML Level and Version help
244  * libSBML determine such things as whether it is valid to assign a
245  * particular value to an attribute.
246  *
247  *
248    */ public
Trigger(SBMLNamespaces sbmlns)249  Trigger(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_Trigger__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) {
250     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
251   }
252 
253 
254 /**
255    * Copy constructor; creates a copy of this Trigger.
256    *
257    * @param orig the object to copy.
258    */ public
Trigger(Trigger orig)259  Trigger(Trigger orig) : this(libsbmlPINVOKE.new_Trigger__SWIG_2(Trigger.getCPtr(orig)), true) {
260     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
261   }
262 
263 
264 /**
265    * Creates and returns a deep copy of this Trigger object.
266    *
267    * @return the (deep) copy of this Trigger object.
268    */ public new
clone()269  Trigger clone() {
270     global::System.IntPtr cPtr = libsbmlPINVOKE.Trigger_clone(swigCPtr);
271     Trigger ret = (cPtr == global::System.IntPtr.Zero) ? null : new Trigger(cPtr, true);
272     return ret;
273   }
274 
275 
276 /**
277    * Get the mathematical formula for the trigger and return it
278    * as an AST.
279    *
280    * @return the math of this Trigger, or @c null if the math is not set.
281    */ public new
getMath()282  ASTNode getMath() {
283     global::System.IntPtr cPtr = libsbmlPINVOKE.Trigger_getMath(swigCPtr);
284     ASTNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new ASTNode(cPtr, false);
285     return ret;
286   }
287 
288 
289 /**
290    * (SBML Level&nbsp;3 only) Get the value of the 'initialValue' attribute
291    * of this Trigger.
292    *
293    * @return the boolean value stored as the 'initialValue' attribute value
294    * in this Trigger.
295    *
296    * @note The attribute 'initialValue' is available in SBML Level&nbsp;3,
297    * but is not present in lower Levels of SBML.
298    */ public
getInitialValue()299  bool getInitialValue() {
300     bool ret = libsbmlPINVOKE.Trigger_getInitialValue(swigCPtr);
301     return ret;
302   }
303 
304 
305 /**
306    * (SBML Level&nbsp;3 only) Get the value of the 'persistent' attribute
307    * of this Trigger.
308    *
309    * @return the boolean value stored as the 'persistent' attribute value
310    * in this Trigger.
311    *
312    * @note The attribute 'persistent' is available in SBML Level&nbsp;3,
313    * but is not present in lower Levels of SBML.
314    */ public
getPersistent()315  bool getPersistent() {
316     bool ret = libsbmlPINVOKE.Trigger_getPersistent(swigCPtr);
317     return ret;
318   }
319 
320 
321 /**
322    * Predicate to test whether the math for this trigger is set.
323    *
324    * @return @c true if the formula (meaning the 'math' subelement) of
325    * this Trigger is set, @c false otherwise.
326    */ public
isSetMath()327  bool isSetMath() {
328     bool ret = libsbmlPINVOKE.Trigger_isSetMath(swigCPtr);
329     return ret;
330   }
331 
332 
333 /**
334    * (SBML Level&nbsp;3 only) Predicate to test whether the 'initialValue'
335    * attribute for this trigger is set.
336    *
337    * @return @c true if the initialValue attribute of
338    * this Trigger is set, @c false otherwise.
339    *
340    * @note The attribute 'initialValue' is available in SBML Level&nbsp;3,
341    * but is not present in lower Levels of SBML.
342    */ public
isSetInitialValue()343  bool isSetInitialValue() {
344     bool ret = libsbmlPINVOKE.Trigger_isSetInitialValue(swigCPtr);
345     return ret;
346   }
347 
348 
349 /**
350    * (SBML Level&nbsp;3 only) Predicate to test whether the 'persistent'
351    * attribute for this trigger is set.
352    *
353    * @return @c true if the persistent attribute of
354    * this Trigger is set, @c false otherwise.
355    *
356    * @note The attribute 'persistent' is available in SBML Level&nbsp;3,
357    * but is not present in lower Levels of SBML.
358    */ public
isSetPersistent()359  bool isSetPersistent() {
360     bool ret = libsbmlPINVOKE.Trigger_isSetPersistent(swigCPtr);
361     return ret;
362   }
363 
364 
365 /**
366    * Sets the trigger expression of this Trigger instance to a copy of the given
367    * ASTNode.
368    *
369    * @param math an ASTNode representing a formula tree.
370    *
371    *
372  * @return integer value indicating success/failure of the
373  * function.  @if clike The value is drawn from the
374  * enumeration #OperationReturnValues_t. @endif The possible values
375  * returned by this function are:
376  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
377    * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink
378    */ public new
setMath(ASTNode math)379  int setMath(ASTNode math) {
380     int ret = libsbmlPINVOKE.Trigger_setMath(swigCPtr, ASTNode.getCPtr(math));
381     return ret;
382   }
383 
384 
385 /**
386    * (SBML Level&nbsp;3 only) Sets the 'initialValue' attribute of this Trigger instance.
387    *
388    * @param initialValue a boolean representing the initialValue to be set.
389    *
390    *
391  * @return integer value indicating success/failure of the
392  * function.  @if clike The value is drawn from the
393  * enumeration #OperationReturnValues_t. @endif The possible values
394  * returned by this function are:
395  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
396    * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink
397    *
398    * @note The attribute 'initialValue' is available in SBML Level&nbsp;3,
399    * but is not present in lower Levels of SBML.
400    */ public
setInitialValue(bool initialValue)401  int setInitialValue(bool initialValue) {
402     int ret = libsbmlPINVOKE.Trigger_setInitialValue(swigCPtr, initialValue);
403     return ret;
404   }
405 
406 
407 /**
408    * (SBML Level&nbsp;3 only) Sets the 'persistent' attribute of this Trigger instance.
409    *
410    * @param persistent a boolean representing the persistent value to be set.
411    *
412    *
413  * @return integer value indicating success/failure of the
414  * function.  @if clike The value is drawn from the
415  * enumeration #OperationReturnValues_t. @endif The possible values
416  * returned by this function are:
417  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
418    * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink
419    *
420    * @note The attribute 'persistent' is available in SBML Level&nbsp;3,
421    * but is not present in lower Levels of SBML.
422    */ public
setPersistent(bool persistent)423  int setPersistent(bool persistent) {
424     int ret = libsbmlPINVOKE.Trigger_setPersistent(swigCPtr, persistent);
425     return ret;
426   }
427 
428 
429 /**
430    * (SBML Level&nbsp;3 only) Unsets the 'initialValue' attribute of this
431    * Trigger instance.
432    *
433    *
434  * @return integer value indicating success/failure of the
435  * function.  @if clike The value is drawn from the
436  * enumeration #OperationReturnValues_t. @endif The possible values
437  * returned by this function are:
438  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
439    * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink
440    *
441    * @note The attribute 'initialValue' is available in SBML Level&nbsp;3,
442    * but is not present in lower Levels of SBML.
443    */ public
unsetInitialValue()444  int unsetInitialValue() {
445     int ret = libsbmlPINVOKE.Trigger_unsetInitialValue(swigCPtr);
446     return ret;
447   }
448 
449 
450 /**
451    * (SBML Level&nbsp;3 only) Unsets the 'persistent' attribute of this
452    * Trigger instance.
453    *
454    *
455  * @return integer value indicating success/failure of the
456  * function.  @if clike The value is drawn from the
457  * enumeration #OperationReturnValues_t. @endif The possible values
458  * returned by this function are:
459  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
460    * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink
461    *
462    * @note The attribute 'persistent' is available in SBML Level&nbsp;3,
463    * but is not present in lower Levels of SBML.
464    */ public
unsetPersistent()465  int unsetPersistent() {
466     int ret = libsbmlPINVOKE.Trigger_unsetPersistent(swigCPtr);
467     return ret;
468   }
469 
470 
471 /**
472    * Returns the libSBML type code of this object instance.
473    *
474    *
475  *
476  * LibSBML attaches an identifying code to every kind of SBML object.  These
477  * are integer constants known as <em>SBML type codes</em>.  The names of all
478  * the codes begin with the characters <code>SBML_</code>.
479  * @if clike The set of possible type codes for core elements is defined in
480  * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for
481  * SBML Level&nbsp;3 packages define their own extra enumerations of type
482  * codes (e.g., #SBMLLayoutTypeCode_t for the Level&nbsp;3 Layout
483  * package).@endif@if java In the Java language interface for libSBML, the
484  * type codes are defined as static integer constants in the interface class
485  * {@link libsbmlConstants}.  @endif@if python In the Python language
486  * interface for libSBML, the type codes are defined as static integer
487  * constants in the interface class @link libsbml@endlink.@endif@if csharp In
488  * the C# language interface for libSBML, the type codes are defined as
489  * static integer constants in the interface class
490  * @link libsbmlcs.libsbml@endlink.@endif  Note that different Level&nbsp;3
491  * package plug-ins may use overlapping type codes; to identify the package
492  * to which a given object belongs, call the
493  * <code>@if conly SBase_getPackageName()
494  * @else SBase::getPackageName()
495  * @endif</code>
496  * method on the object.
497  *
498  * The exception to this is lists:  all SBML-style list elements have the type
499  * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they
500  * are from.
501  *
502  *
503    *
504    * @return the SBML type code for this object:
505    * @link libsbml#SBML_TRIGGER SBML_TRIGGER@endlink (default).
506    *
507    *
508  * @warning <span class='warning'>The specific integer values of the possible
509  * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
510  * packages,  To fully identify the correct code, <strong>it is necessary to
511  * invoke both getPackageName() and getTypeCode()</strong> (or
512  * ListOf::getItemTypeCode()).</span>
513  *
514  *
515    *
516    * @see getElementName()
517    * @see getPackageName()
518    */ public new
getTypeCode()519  int getTypeCode() {
520     int ret = libsbmlPINVOKE.Trigger_getTypeCode(swigCPtr);
521     return ret;
522   }
523 
524 
525 /**
526    * Returns the XML element name of this object, which for Trigger, is
527    * always @c 'trigger'.
528    *
529    * @return the name of this element, i.e., @c 'trigger'.
530    */ public new
getElementName()531  string getElementName() {
532     string ret = libsbmlPINVOKE.Trigger_getElementName(swigCPtr);
533     return ret;
534   }
535 
536 
537 /**
538    *
539  * Replaces all uses of a given @c SIdRef type attribute value with another
540  * value.
541  *
542  *
543  *
544 
545  * In SBML, object identifiers are of a data type called <code>SId</code>.
546  * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
547  * introduced for attribute values that refer to <code>SId</code> values; in
548  * previous Levels of SBML, this data type did not exist and attributes were
549  * simply described to as 'referring to an identifier', but the effective
550  * data type was the same as <code>SIdRef</code> in Level&nbsp;3.  These and
551  * other methods of libSBML refer to the type <code>SIdRef</code> for all
552  * Levels of SBML, even if the corresponding SBML specification did not
553  * explicitly name the data type.
554  *
555  *
556  *
557  * This method works by looking at all attributes and (if appropriate)
558  * mathematical formulas in MathML content, comparing the referenced
559  * identifiers to the value of @p oldid.  If any matches are found, the
560  * matching values are replaced with @p newid.  The method does @em not
561  * descend into child elements.
562  *
563  * @param oldid the old identifier.
564  * @param newid the new identifier.
565  *
566  *
567    */ public new
renameSIdRefs(string oldid, string newid)568  void renameSIdRefs(string oldid, string newid) {
569     libsbmlPINVOKE.Trigger_renameSIdRefs(swigCPtr, oldid, newid);
570   }
571 
572 
573 /**
574    *
575  * Replaces all uses of a given @c UnitSIdRef type attribute value with
576  * another value.
577  *
578  *
579  *
580  * In SBML, unit definitions have identifiers of type <code>UnitSId</code>.  In
581  * SBML Level&nbsp;3, an explicit data type called <code>UnitSIdRef</code> was
582  * introduced for attribute values that refer to <code>UnitSId</code> values; in
583  * previous Levels of SBML, this data type did not exist and attributes were
584  * simply described to as 'referring to a unit identifier', but the effective
585  * data type was the same as <code>UnitSIdRef</code> in Level&nbsp;3.  These and
586  * other methods of libSBML refer to the type <code>UnitSIdRef</code> for all
587  * Levels of SBML, even if the corresponding SBML specification did not
588  * explicitly name the data type.
589  *
590  *
591  *
592  * This method works by looking at all unit identifier attribute values
593  * (including, if appropriate, inside mathematical formulas), comparing the
594  * referenced unit identifiers to the value of @p oldid.  If any matches
595  * are found, the matching values are replaced with @p newid.  The method
596  * does @em not descend into child elements.
597  *
598  * @param oldid the old identifier.
599  * @param newid the new identifier.
600  *
601  *
602    */ public new
renameUnitSIdRefs(string oldid, string newid)603  void renameUnitSIdRefs(string oldid, string newid) {
604     libsbmlPINVOKE.Trigger_renameUnitSIdRefs(swigCPtr, oldid, newid);
605   }
606 
607 
608 /** */ /* libsbml-internal */ public new
replaceSIDWithFunction(string id, ASTNode function)609  void replaceSIDWithFunction(string id, ASTNode function) {
610     libsbmlPINVOKE.Trigger_replaceSIDWithFunction(swigCPtr, id, ASTNode.getCPtr(function));
611   }
612 
613 
614 /**
615    * Predicate returning @c true if
616    * all the required elements for this Trigger object
617    * have been set.
618    *
619    * @note The required elements for a Trigger object are:
620    * @li 'math' inSBML Level&nbsp;2 and Level&nbsp;3 Version&nbsp;1.
621    *     (In SBML Level&nbsp;3 Version&nbsp;2+, it is no longer required.)
622    *
623    * @return a boolean value indicating whether all the required
624    * elements for this object have been defined.
625    */ public new
hasRequiredElements()626  bool hasRequiredElements() {
627     bool ret = libsbmlPINVOKE.Trigger_hasRequiredElements(swigCPtr);
628     return ret;
629   }
630 
631 
632 /**
633    * Predicate returning @c true if
634    * all the required attributes for this Trigger object
635    * have been set.
636    *
637    * The required attributes for a Trigger object are:
638    * @li 'persistent' (required in SBML Level&nbsp;3)
639    * @li 'initialValue' (required in SBML Level&nbsp;3)
640    *
641    * @return a boolean value indicating whether all the required
642    * attributes for this object have been defined.
643    */ public new
hasRequiredAttributes()644  bool hasRequiredAttributes() {
645     bool ret = libsbmlPINVOKE.Trigger_hasRequiredAttributes(swigCPtr);
646     return ret;
647   }
648 
649 
650 /**
651    * Finds this Trigger's Event parent and calls unsetTrigger() on it, indirectly deleting itself.  Overridden from the SBase function since the parent is not a ListOf.
652    *
653    *
654  * @return integer value indicating success/failure of the
655  * function.  @if clike The value is drawn from the
656  * enumeration #OperationReturnValues_t. @endif The possible values
657  * returned by this function are:
658  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
659    * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink
660    */ public new
removeFromParentAndDelete()661  int removeFromParentAndDelete() {
662     int ret = libsbmlPINVOKE.Trigger_removeFromParentAndDelete(swigCPtr);
663     return ret;
664   }
665 
666 }
667 
668 }
669