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 list of Parameter objects. 20 * 21 * 22 * 23 * The various ListOf___ @if conly structures @else classes@endif in SBML 24 * are merely containers used for organizing the main components of an SBML 25 * model. In libSBML's implementation, ListOf___ 26 * @if conly data structures @else classes@endif are derived from the 27 * intermediate utility @if conly structure @else class@endif ListOf, which 28 * is not defined by the SBML specifications but serves as a useful 29 * programmatic construct. ListOf is itself is in turn derived from SBase, 30 * which provides all of the various ListOf___ 31 * @if conly data structures @else classes@endif with common features 32 * defined by the SBML specification, such as 'metaid' attributes and 33 * annotations. 34 * 35 * The relationship between the lists and the rest of an SBML model is 36 * illustrated by the following (for SBML Level 2 Version 4): 37 * 38 * @htmlinclude listof-illustration.html 39 * 40 * SBML Level 3 Version 1 has essentially the same structure as 41 * Level 2 Version 4, depicted above, but SBML Level 3 42 * Version 2 allows 43 * containers to contain zero or more of the relevant object, instead of 44 * requiring at least one. As such, libsbml will write out an 45 * otherwise-empty ListOf___ element that has any optional attribute set 46 * (such as 'id' or 'metaid'), that has an optional child (such 47 * as a 'notes' or 'annotation'), or that has attributes or children set 48 * from any SBML Level 3 package, whether or not the ListOf___ has 49 * any other children. 50 * 51 * Readers may wonder about the motivations for using the ListOf___ 52 * containers in SBML. A simpler approach in XML might be to place the 53 * components all directly at the top level of the model definition. The 54 * choice made in SBML is to group them within XML elements named after 55 * %ListOf<em>Classname</em>, in part because it helps organize the 56 * components. More importantly, the fact that the container classes are 57 * derived from SBase means that software tools can add information @em about 58 * the lists themselves into each list container's 'annotation'. 59 * 60 * @see ListOfFunctionDefinitions 61 * @see ListOfUnitDefinitions 62 * @see ListOfCompartmentTypes 63 * @see ListOfSpeciesTypes 64 * @see ListOfCompartments 65 * @see ListOfSpecies 66 * @see ListOfParameters 67 * @see ListOfInitialAssignments 68 * @see ListOfRules 69 * @see ListOfConstraints 70 * @see ListOfReactions 71 * @see ListOfEvents 72 * 73 * @if conly 74 * @note In the C API for libSBML, functions that in other language APIs 75 * would be inherited by the various ListOf___ structures not shown in the 76 * pages for the individual ListOf___'s. Instead, the functions are defined 77 * on ListOf_t. <strong>Please consult the documentation for ListOf_t for 78 * the many common functions available for manipulating ListOf___ 79 * structures</strong>. The documentation for the individual ListOf___ 80 * structures (ListOfCompartments_t, ListOfReactions_t, etc.) does not reveal 81 * all of the functionality available. @endif 82 * 83 * 84 */ 85 86 public class ListOfParameters : ListOf { 87 private HandleRef swigCPtr; 88 ListOfParameters(IntPtr cPtr, bool cMemoryOwn)89 internal ListOfParameters(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.ListOfParameters_SWIGUpcast(cPtr), cMemoryOwn) 90 { 91 //super(libsbmlPINVOKE.ListOfParametersUpcast(cPtr), cMemoryOwn); 92 swigCPtr = new HandleRef(this, cPtr); 93 } 94 getCPtr(ListOfParameters obj)95 internal static HandleRef getCPtr(ListOfParameters obj) 96 { 97 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 98 } 99 getCPtrAndDisown(ListOfParameters obj)100 internal static HandleRef getCPtrAndDisown (ListOfParameters obj) 101 { 102 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 103 104 if (obj != null) 105 { 106 ptr = obj.swigCPtr; 107 obj.swigCMemOwn = false; 108 } 109 110 return ptr; 111 } 112 Dispose(bool disposing)113 protected override void Dispose(bool disposing) { 114 lock(this) { 115 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 116 if (swigCMemOwn) { 117 swigCMemOwn = false; 118 libsbmlPINVOKE.delete_ListOfParameters(swigCPtr); 119 } 120 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 121 } 122 base.Dispose(disposing); 123 } 124 } 125 126 127 /** 128 * Creates a new ListOfParameters object. 129 * 130 * The object is constructed such that it is valid for the given SBML 131 * Level and Version combination. 132 * 133 * @param level the SBML Level. 134 * 135 * @param version the Version within the SBML Level. 136 * 137 * 138 * @throws SBMLConstructorException 139 * Thrown if the given @p level and @p version combination are invalid 140 * or if this object is incompatible with the given level and version. 141 * 142 * 143 * 144 * 145 * @note Attempting to add an object to an SBMLDocument having a different 146 * combination of SBML Level, Version and XML namespaces than the object 147 * itself will result in an error at the time a caller attempts to make the 148 * addition. A parent object must have compatible Level, Version and XML 149 * namespaces. (Strictly speaking, a parent may also have more XML 150 * namespaces than a child, but the reverse is not permitted.) The 151 * restriction is necessary to ensure that an SBML model has a consistent 152 * overall structure. This requires callers to manage their objects 153 * carefully, but the benefit is increased flexibility in how models can be 154 * created by permitting callers to create objects bottom-up if desired. In 155 * situations where objects are not yet attached to parents (e.g., 156 * SBMLDocument), knowledge of the intented SBML Level and Version help 157 * libSBML determine such things as whether it is valid to assign a 158 * particular value to an attribute. 159 * 160 * 161 */ public ListOfParameters(long level, long version)162 ListOfParameters(long level, long version) : this(libsbmlPINVOKE.new_ListOfParameters__SWIG_0(level, version), true) { 163 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 164 } 165 166 167 /** 168 * Creates a new ListOfParameters object. 169 * 170 * The object is constructed such that it is valid for the SBML Level and 171 * Version combination determined by the SBMLNamespaces object in @p 172 * sbmlns. 173 * 174 * @param sbmlns an SBMLNamespaces object that is used to determine the 175 * characteristics of the ListOfParameters object to be created. 176 * 177 * 178 * @throws SBMLConstructorException 179 * Thrown if the given @p sbmlns is inconsistent or incompatible 180 * with this object. 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 ListOfParameters(SBMLNamespaces sbmlns)202 ListOfParameters(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_ListOfParameters__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) { 203 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 204 } 205 206 207 /** 208 * Creates and returns a deep copy of this ListOfParameters object. 209 * 210 * @return the (deep) copy of this ListOfParameters object. 211 */ public new clone()212 ListOfParameters clone() { 213 global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfParameters_clone(swigCPtr); 214 ListOfParameters ret = (cPtr == global::System.IntPtr.Zero) ? null : new ListOfParameters(cPtr, true); 215 return ret; 216 } 217 218 219 /** 220 * Returns the libSBML type code for the objects contained in this ListOf 221 * (i.e., Parameter objects, if the list is non-empty). 222 * 223 * 224 * 225 * LibSBML attaches an identifying code to every kind of SBML object. These 226 * are integer constants known as <em>SBML type codes</em>. The names of all 227 * the codes begin with the characters <code>SBML_</code>. 228 * @if clike The set of possible type codes for core elements is defined in 229 * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for 230 * SBML Level 3 packages define their own extra enumerations of type 231 * codes (e.g., #SBMLLayoutTypeCode_t for the Level 3 Layout 232 * package).@endif@if java In the Java language interface for libSBML, the 233 * type codes are defined as static integer constants in the interface class 234 * {@link libsbmlConstants}. @endif@if python In the Python language 235 * interface for libSBML, the type codes are defined as static integer 236 * constants in the interface class @link libsbml@endlink.@endif@if csharp In 237 * the C# language interface for libSBML, the type codes are defined as 238 * static integer constants in the interface class 239 * @link libsbmlcs.libsbml@endlink.@endif Note that different Level 3 240 * package plug-ins may use overlapping type codes; to identify the package 241 * to which a given object belongs, call the 242 * <code>@if conly SBase_getPackageName() 243 * @else SBase::getPackageName() 244 * @endif</code> 245 * method on the object. 246 * 247 * The exception to this is lists: all SBML-style list elements have the type 248 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they 249 * are from. 250 * 251 * 252 * 253 * @return the SBML type code for this objects contained in this list: 254 * @link libsbml#SBML_PARAMETER SBML_PARAMETER@endlink (default). 255 * 256 * @see getElementName() 257 * @see getPackageName() 258 */ public new getItemTypeCode()259 int getItemTypeCode() { 260 int ret = libsbmlPINVOKE.ListOfParameters_getItemTypeCode(swigCPtr); 261 return ret; 262 } 263 264 265 /** 266 * Returns the XML element name of this object. 267 * 268 * For ListOfParameters, the XML element name is @c 'listOfParameters'. 269 * 270 * @return the name of this element, i.e., @c 'listOfParameters'. 271 */ public new getElementName()272 string getElementName() { 273 string ret = libsbmlPINVOKE.ListOfParameters_getElementName(swigCPtr); 274 return ret; 275 } 276 277 278 /** 279 * Returns the Parameter object located at position @p n within this 280 * ListOfParameters instance. 281 * 282 * @param n the index number of the Parameter to get. 283 * 284 * @return the nth Parameter in this ListOfParameters. If the index @p n 285 * is out of bounds for the length of the list, then @c null is returned. 286 * 287 * @see size() 288 * @see get(string sid) 289 */ public new get(long n)290 Parameter get(long n) { 291 global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfParameters_get__SWIG_0(swigCPtr, n); 292 Parameter ret = (cPtr == global::System.IntPtr.Zero) ? null : new Parameter(cPtr, false); 293 return ret; 294 } 295 296 297 /** 298 * Returns the first Parameter object matching the given identifier. 299 * 300 * @param sid a string, the identifier of the Parameter to get. 301 * 302 * @return the Parameter object found. The caller owns the returned 303 * object and is responsible for deleting it. If none of the items have 304 * an identifier matching @p sid, then @c null is returned. 305 * 306 * @see get(unsigned int n) 307 * @see size() 308 */ public new get(string sid)309 Parameter get(string sid) { 310 global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfParameters_get__SWIG_2(swigCPtr, sid); 311 Parameter ret = (cPtr == global::System.IntPtr.Zero) ? null : new Parameter(cPtr, false); 312 return ret; 313 } 314 315 316 /** 317 * Removes the nth item from this ListOfParameters, and returns a pointer 318 * to it. 319 * 320 * @param n the index of the item to remove. 321 * 322 * @return the item removed. The caller owns the returned object and is 323 * responsible for deleting it. If the index number @p n is out of 324 * bounds for the length of the list, then @c null is returned. 325 * 326 * @see size() 327 */ public new remove(long n)328 Parameter remove(long n) { 329 global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfParameters_remove__SWIG_0(swigCPtr, n); 330 Parameter ret = (cPtr == global::System.IntPtr.Zero) ? null : new Parameter(cPtr, true); 331 return ret; 332 } 333 334 335 /** 336 * Removes the first Parameter object in this ListOfParameters 337 * matching the given identifier, and returns a pointer to it. 338 * 339 * @param sid the identifier of the item to remove. 340 * 341 * @return the item removed. The caller owns the returned object and is 342 * responsible for deleting it. If none of the items have an identifier 343 * matching @p sid, then @c null is returned. 344 */ public new remove(string sid)345 Parameter remove(string sid) { 346 global::System.IntPtr cPtr = libsbmlPINVOKE.ListOfParameters_remove__SWIG_1(swigCPtr, sid); 347 Parameter ret = (cPtr == global::System.IntPtr.Zero) ? null : new Parameter(cPtr, true); 348 return ret; 349 } 350 351 } 352 353 } 354