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 A parameter inside an SBML <em>reaction</em> definition.
20  *
21  * LocalParameter has been introduced in SBML Level&nbsp;3 to serve as the
22  * object class for parameter definitions that are intended to be local to
23  * a Reaction.  Objects of class LocalParameter never appear at the Model
24  * level; they are always contained within ListOfLocalParameters lists
25  * which are in turn contained within KineticLaw objects.
26  *
27  * Like its global Parameter counterpart, the LocalParameter object class
28  * is used to define a symbol associated with a value; this symbol can then
29  * be used in a model's mathematical formulas (and specifically, for
30  * LocalParameter, reaction rate formulas).  Unlike Parameter, the
31  * LocalParameter class does not have a 'constant' attribute: local
32  * parameters within reactions are @em always constant.
33  *
34  * LocalParameter has one required attribute, 'id', to give the
35  * parameter a unique identifier by which other parts of an SBML model
36  * definition can refer to it.  A parameter can also have an optional
37  * 'name' attribute of type @c string.  Identifiers and names must be used
38  * according to the guidelines described in the SBML specifications.
39  *
40  * The optional attribute 'value' determines the value (of type @c double)
41  * assigned to the parameter.  A missing value for 'value' implies that
42  * the value either is unknown, or to be obtained from an external source,
43  * or determined by an initial assignment.  The unit of measurement
44  * associated with the value of the parameter can be specified using the
45  * optional attribute 'units'.  Here we only mention briefly some notable
46  * points about the possible unit choices, but readers are urged to consult
47  * the SBML specification documents for more information:
48  * <ul>
49  *
50  * <li> In SBML Level&nbsp;3, there are no constraints on the units that
51  * can be assigned to parameters in a model; there are also no units to
52  * inherit from the enclosing Model object.
53  *
54  * <li> In SBML Level&nbsp;2, the value assigned to the parameter's 'units'
55  * attribute must be chosen from one of the following possibilities: one of
56  * the base unit identifiers defined in SBML; one of the built-in unit
57  * identifiers @c 'substance', @c 'time', @c 'volume', @c 'area' or
58  * @c 'length'; or the identifier of a new unit defined in the list of unit
59  * definitions in the enclosing Model structure.  There are no constraints
60  * on the units that can be chosen from these sets.  There are no default
61  * units for local parameters.
62  * </ul>
63  *
64  * As with all other major SBML components, LocalParameter is derived from
65  * SBase, and the methods defined on SBase are available on LocalParameter.
66  *
67  * In SBML Level&nbsp;3 Version&nbsp;2, the scope of the LocalParameter
68  * was expanded slightly to officially encompass the entire Reaction
69  * instead of just the KineticLaw in which it appears.  This has no
70  * effect on models using only SBML Level&nbsp;3 Core constructs,
71  * but has the potential to allow SBML Level&nbsp;3 Packages to
72  * include elements in a Reaction that could reference a
73  * LocalParameter from that Reaction's KineticLaw.  It also means that
74  * no LocalParameter may have the same @c 'id' as a referenced Species
75  * in any SimpleSpeciesReference in that Reaction.
76  *
77  * @warning <span class='warning'>LibSBML derives LocalParameter from
78  * Parameter; however, this does not precisely match the object hierarchy
79  * defined by SBML Level&nbsp;3, where LocalParameter is derived directly
80  * from SBase and not Parameter.  We believe this arrangement makes it easier
81  * for libSBML users to program applications that work with both SBML
82  * Level&nbsp;2 and SBML Level&nbsp;3, but programmers should also keep in
83  * mind this difference exists.  A side-effect of libSBML's scheme is that
84  * certain methods on LocalParameter that are inherited from Parameter do not
85  * actually have relevance to LocalParameter objects.  An example of this is
86  * the methods pertaining to Parameter's attribute 'constant' (i.e.,
87  * isSetConstant(), setConstant(), and getConstant()).</span>
88  *
89  * @see ListOfLocalParameters
90  * @see KineticLaw
91  *
92  *
93  *
94  */
95 
96 public class LocalParameter : Parameter {
97 	private HandleRef swigCPtr;
98 
LocalParameter(IntPtr cPtr, bool cMemoryOwn)99 	internal LocalParameter(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.LocalParameter_SWIGUpcast(cPtr), cMemoryOwn)
100 	{
101 		//super(libsbmlPINVOKE.LocalParameterUpcast(cPtr), cMemoryOwn);
102 		swigCPtr = new HandleRef(this, cPtr);
103 	}
104 
getCPtr(LocalParameter obj)105 	internal static HandleRef getCPtr(LocalParameter obj)
106 	{
107 		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
108 	}
109 
getCPtrAndDisown(LocalParameter obj)110 	internal static HandleRef getCPtrAndDisown (LocalParameter obj)
111 	{
112 		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
113 
114 		if (obj != null)
115 		{
116 			ptr             = obj.swigCPtr;
117 			obj.swigCMemOwn = false;
118 		}
119 
120 		return ptr;
121 	}
122 
Dispose(bool disposing)123   protected override void Dispose(bool disposing) {
124     lock(this) {
125       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
126         if (swigCMemOwn) {
127           swigCMemOwn = false;
128           libsbmlPINVOKE.delete_LocalParameter(swigCPtr);
129         }
130         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
131       }
132       base.Dispose(disposing);
133     }
134   }
135 
136 
137 /**
138    * Creates a new LocalParameter object with the given SBML @p level and
139    * @p version values.
140    *
141    * @param level a long integer, the SBML Level to assign to this
142    * LocalParameter.
143    *
144    * @param version a long integer, the SBML Version to assign to this
145    * LocalParameter.
146    *
147    *
148  * @throws SBMLConstructorException
149  * Thrown if the given @p level and @p version combination are invalid
150  * or if this object is incompatible with the given level and version.
151  *
152  *
153    *
154    *
155  * @note Attempting to add an object to an SBMLDocument having a different
156  * combination of SBML Level, Version and XML namespaces than the object
157  * itself will result in an error at the time a caller attempts to make the
158  * addition.  A parent object must have compatible Level, Version and XML
159  * namespaces.  (Strictly speaking, a parent may also have more XML
160  * namespaces than a child, but the reverse is not permitted.)  The
161  * restriction is necessary to ensure that an SBML model has a consistent
162  * overall structure.  This requires callers to manage their objects
163  * carefully, but the benefit is increased flexibility in how models can be
164  * created by permitting callers to create objects bottom-up if desired.  In
165  * situations where objects are not yet attached to parents (e.g.,
166  * SBMLDocument), knowledge of the intented SBML Level and Version help
167  * libSBML determine such things as whether it is valid to assign a
168  * particular value to an attribute.
169  *
170  *
171    */ public
LocalParameter(long level, long version)172  LocalParameter(long level, long version) : this(libsbmlPINVOKE.new_LocalParameter__SWIG_0(level, version), true) {
173     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
174   }
175 
176 
177 /**
178    * Creates a new LocalParameter object with the given SBMLNamespaces
179    * object @p sbmlns.
180    *
181    *
182  *
183  * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
184  * information.  It is used to communicate the SBML Level, Version, and (in
185  * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
186  * common approach to using libSBML's SBMLNamespaces facilities is to create an
187  * SBMLNamespaces object somewhere in a program once, then hand that object
188  * as needed to object constructors that accept SBMLNamespaces as arguments.
189  *
190  *
191    *
192    * It is worth emphasizing that although this constructor does not take
193    * an identifier argument, in SBML Level&nbsp;2 and beyond, the 'id'
194    * (identifier) attribute of a LocalParameter is required to have a value.
195    * Thus, callers are cautioned to assign a value after calling this
196    * constructor if no identifier is provided as an argument.  Setting the
197    * identifier can be accomplished using the method
198    * @if java setId(String id)@else setId()@endif.
199    *
200    * @param sbmlns an SBMLNamespaces object.
201    *
202    *
203  * @throws SBMLConstructorException
204  * Thrown if the given @p sbmlns is inconsistent or incompatible
205  * with this object.
206  *
207  *
208    *
209    *
210  * @note Attempting to add an object to an SBMLDocument having a different
211  * combination of SBML Level, Version and XML namespaces than the object
212  * itself will result in an error at the time a caller attempts to make the
213  * addition.  A parent object must have compatible Level, Version and XML
214  * namespaces.  (Strictly speaking, a parent may also have more XML
215  * namespaces than a child, but the reverse is not permitted.)  The
216  * restriction is necessary to ensure that an SBML model has a consistent
217  * overall structure.  This requires callers to manage their objects
218  * carefully, but the benefit is increased flexibility in how models can be
219  * created by permitting callers to create objects bottom-up if desired.  In
220  * situations where objects are not yet attached to parents (e.g.,
221  * SBMLDocument), knowledge of the intented SBML Level and Version help
222  * libSBML determine such things as whether it is valid to assign a
223  * particular value to an attribute.
224  *
225  *
226    */ public
LocalParameter(SBMLNamespaces sbmlns)227  LocalParameter(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_LocalParameter__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) {
228     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
229   }
230 
231 
232 /**
233    * Copy constructor; creates a copy of a given LocalParameter object.
234    *
235    * @param orig the LocalParameter instance to copy.
236    */ public
LocalParameter(LocalParameter orig)237  LocalParameter(LocalParameter orig) : this(libsbmlPINVOKE.new_LocalParameter__SWIG_2(LocalParameter.getCPtr(orig)), true) {
238     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
239   }
240 
241 
242 /**
243    * Copy constructor; creates a LocalParameter object by copying
244    * the attributes of a given Parameter object.
245    *
246    * @param orig the Parameter instance to copy.
247    */ public
LocalParameter(Parameter orig)248  LocalParameter(Parameter orig) : this(libsbmlPINVOKE.new_LocalParameter__SWIG_3(Parameter.getCPtr(orig)), true) {
249     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
250   }
251 
252 
253 /**
254    * Creates and returns a deep copy of this LocalParameter object.
255    *
256    * @return the (deep) copy of this LocalParameter object.
257    */ public new
clone()258  LocalParameter clone() {
259     global::System.IntPtr cPtr = libsbmlPINVOKE.LocalParameter_clone(swigCPtr);
260     LocalParameter ret = (cPtr == global::System.IntPtr.Zero) ? null : new LocalParameter(cPtr, true);
261     return ret;
262   }
263 
264 
265 /**
266    * Constructs and returns a UnitDefinition that corresponds to the units
267    * of this LocalParameter's value.
268    *
269    *
270  *
271  * LocalParameters in SBML have an attribute ('units') for declaring the
272  * units of measurement intended for the parameter's value.  <b>No
273  * defaults are defined</b> by SBML in the absence of a definition for
274  * 'units'.  This method returns a UnitDefinition object based on the
275  * units declared for this LocalParameter using its 'units' attribute, or
276  * it returns @c null if no units have been declared.
277  *
278  * Note that unit declarations for LocalParameter objects are specified
279  * in terms of the @em identifier of a unit (e.g., using setUnits()), but
280  * @em this method returns a UnitDefinition object, not a unit
281  * identifier.  It does this by constructing an appropriate
282  * UnitDefinition.  For SBML Level&nbsp;2 models, it will do this even
283  * when the value of the 'units' attribute is one of the predefined SBML
284  * units @c 'substance', @c 'volume', @c 'area', @c 'length' or
285  * @c 'time'.  Callers may find this useful in conjunction with the helper
286  * methods provided by the UnitDefinition class for comparing different
287  * UnitDefinition objects.
288  *
289    *
290    * @return a UnitDefinition that expresses the units of this
291    * LocalParameter, or @c null if one cannot be constructed.
292    *
293    * @note The libSBML system for unit analysis depends on the model as a
294    * whole.  In cases where the LocalParameter object has not yet been
295    * added to a model, or the model itself is incomplete, unit analysis is
296    * not possible, and consequently this method will return @c null.
297    *
298    * @see isSetUnits()
299    */ public new
getDerivedUnitDefinition()300  UnitDefinition getDerivedUnitDefinition() {
301     global::System.IntPtr cPtr = libsbmlPINVOKE.LocalParameter_getDerivedUnitDefinition__SWIG_0(swigCPtr);
302     UnitDefinition ret = (cPtr == global::System.IntPtr.Zero) ? null : new UnitDefinition(cPtr, false);
303     return ret;
304   }
305 
306 
307 /**
308    * Returns the libSBML type code for this SBML object.
309    *
310    *
311  *
312  * LibSBML attaches an identifying code to every kind of SBML object.  These
313  * are integer constants known as <em>SBML type codes</em>.  The names of all
314  * the codes begin with the characters <code>SBML_</code>.
315  * @if clike The set of possible type codes for core elements is defined in
316  * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for
317  * SBML Level&nbsp;3 packages define their own extra enumerations of type
318  * codes (e.g., #SBMLLayoutTypeCode_t for the Level&nbsp;3 Layout
319  * package).@endif@if java In the Java language interface for libSBML, the
320  * type codes are defined as static integer constants in the interface class
321  * {@link libsbmlConstants}.  @endif@if python In the Python language
322  * interface for libSBML, the type codes are defined as static integer
323  * constants in the interface class @link libsbml@endlink.@endif@if csharp In
324  * the C# language interface for libSBML, the type codes are defined as
325  * static integer constants in the interface class
326  * @link libsbmlcs.libsbml@endlink.@endif  Note that different Level&nbsp;3
327  * package plug-ins may use overlapping type codes; to identify the package
328  * to which a given object belongs, call the
329  * <code>@if conly SBase_getPackageName()
330  * @else SBase::getPackageName()
331  * @endif</code>
332  * method on the object.
333  *
334  * The exception to this is lists:  all SBML-style list elements have the type
335  * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they
336  * are from.
337  *
338  *
339    *
340    * @return the SBML type code for this object:
341    * @link libsbml#SBML_LOCAL_PARAMETER SBML_LOCAL_PARAMETER@endlink (default).
342    *
343    *
344  * @warning <span class='warning'>The specific integer values of the possible
345  * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
346  * packages,  To fully identify the correct code, <strong>it is necessary to
347  * invoke both getPackageName() and getTypeCode()</strong> (or
348  * ListOf::getItemTypeCode()).</span>
349  *
350  *
351    *
352    * @see getElementName()
353    * @see getPackageName()
354    */ public new
getTypeCode()355  int getTypeCode() {
356     int ret = libsbmlPINVOKE.LocalParameter_getTypeCode(swigCPtr);
357     return ret;
358   }
359 
360 
361 /**
362    * Returns the XML element name of this object, which for LocalParameter,
363    * is always @c 'localParameter'.
364    *
365    * @return the name of this element, i.e., @c 'localParameter'.
366    */ public new
getElementName()367  string getElementName() {
368     string ret = libsbmlPINVOKE.LocalParameter_getElementName(swigCPtr);
369     return ret;
370   }
371 
372 
373 /**
374    * Predicate returning @c true if all the required attributes for this
375    * LocalParameter object have been set.
376    *
377    * The required attributes for a LocalParameter object are:
378    * @li 'id'
379    * @li 'value'
380    *
381    * @return @c true if the required attributes have been set, @c false
382    * otherwise.
383    */ public new
hasRequiredAttributes()384  bool hasRequiredAttributes() {
385     bool ret = libsbmlPINVOKE.LocalParameter_hasRequiredAttributes(swigCPtr);
386     return ret;
387   }
388 
389 
390 /** */ /* libsbml-internal */ public new
getConstant()391  bool getConstant() {
392     bool ret = libsbmlPINVOKE.LocalParameter_getConstant(swigCPtr);
393     return ret;
394   }
395 
396 
397 /** */ /* libsbml-internal */ public new
isSetConstant()398  bool isSetConstant() {
399     bool ret = libsbmlPINVOKE.LocalParameter_isSetConstant(swigCPtr);
400     return ret;
401   }
402 
403 
404 /** */ /* libsbml-internal */ public new
setConstant(bool flag)405  int setConstant(bool flag) {
406     int ret = libsbmlPINVOKE.LocalParameter_setConstant(swigCPtr, flag);
407     return ret;
408   }
409 
410 
411 /** */ /* libsbml-internal */ public new
unsetConstant()412  int unsetConstant() {
413     int ret = libsbmlPINVOKE.LocalParameter_unsetConstant(swigCPtr);
414     return ret;
415   }
416 
417 }
418 
419 }
420