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 reference to an SBML <em>modifier species</em>. 20 * 21 * Sometimes a species appears in the kinetic rate formula of a reaction 22 * but is itself neither created nor destroyed in that reaction (for 23 * example, because it acts as a catalyst or inhibitor). In SBML, all such 24 * species are simply called @em modifiers without regard to the detailed 25 * role of those species in the model. The Reaction structure provides a 26 * way to express which species act as modifiers in a given reaction. This 27 * is the purpose of the list of modifiers available in Reaction. The list 28 * contains instances of ModifierSpeciesReference structures. 29 * 30 * The ModifierSpeciesReference structure inherits the mandatory attribute 31 * 'species' and optional attributes 'id' and 'name' from the parent class 32 * SimpleSpeciesReference. See the description of SimpleSpeciesReference 33 * for more information about these. 34 * 35 * The value of the 'species' attribute must be the identifier of a species 36 * defined in the enclosing Model; this species is designated as a modifier 37 * for the current reaction. A reaction may have any number of modifiers. 38 * It is permissible for a modifier species to appear simultaneously in the 39 * list of reactants and products of the same reaction where it is 40 * designated as a modifier, as well as to appear in the list of reactants, 41 * products and modifiers of other reactions in the model. 42 * 43 */ 44 45 public class ModifierSpeciesReference : SimpleSpeciesReference { 46 private HandleRef swigCPtr; 47 ModifierSpeciesReference(IntPtr cPtr, bool cMemoryOwn)48 internal ModifierSpeciesReference(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.ModifierSpeciesReference_SWIGUpcast(cPtr), cMemoryOwn) 49 { 50 //super(libsbmlPINVOKE.ModifierSpeciesReferenceUpcast(cPtr), cMemoryOwn); 51 swigCPtr = new HandleRef(this, cPtr); 52 } 53 getCPtr(ModifierSpeciesReference obj)54 internal static HandleRef getCPtr(ModifierSpeciesReference obj) 55 { 56 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 57 } 58 getCPtrAndDisown(ModifierSpeciesReference obj)59 internal static HandleRef getCPtrAndDisown (ModifierSpeciesReference obj) 60 { 61 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 62 63 if (obj != null) 64 { 65 ptr = obj.swigCPtr; 66 obj.swigCMemOwn = false; 67 } 68 69 return ptr; 70 } 71 Dispose(bool disposing)72 protected override void Dispose(bool disposing) { 73 lock(this) { 74 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 75 if (swigCMemOwn) { 76 swigCMemOwn = false; 77 libsbmlPINVOKE.delete_ModifierSpeciesReference(swigCPtr); 78 } 79 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 80 } 81 base.Dispose(disposing); 82 } 83 } 84 85 86 /** 87 * Creates a new ModifierSpeciesReference using the given SBML @p level and 88 * @p version values. 89 * 90 * @param level a long integer, the SBML Level to assign to this 91 * ModifierSpeciesReference. 92 * 93 * @param version a long integer, the SBML Version to assign to this 94 * ModifierSpeciesReference. 95 * 96 * 97 * @throws SBMLConstructorException 98 * Thrown if the given @p level and @p version combination are invalid 99 * or if this object is incompatible with the given level and version. 100 * 101 * 102 * 103 * 104 * @note Attempting to add an object to an SBMLDocument having a different 105 * combination of SBML Level, Version and XML namespaces than the object 106 * itself will result in an error at the time a caller attempts to make the 107 * addition. A parent object must have compatible Level, Version and XML 108 * namespaces. (Strictly speaking, a parent may also have more XML 109 * namespaces than a child, but the reverse is not permitted.) The 110 * restriction is necessary to ensure that an SBML model has a consistent 111 * overall structure. This requires callers to manage their objects 112 * carefully, but the benefit is increased flexibility in how models can be 113 * created by permitting callers to create objects bottom-up if desired. In 114 * situations where objects are not yet attached to parents (e.g., 115 * SBMLDocument), knowledge of the intented SBML Level and Version help 116 * libSBML determine such things as whether it is valid to assign a 117 * particular value to an attribute. 118 * 119 * 120 */ public ModifierSpeciesReference(long level, long version)121 ModifierSpeciesReference(long level, long version) : this(libsbmlPINVOKE.new_ModifierSpeciesReference__SWIG_0(level, version), true) { 122 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 123 } 124 125 126 /** 127 * Creates a new ModifierSpeciesReference using the given SBMLNamespaces 128 * object @p sbmlns. 129 * 130 * @param sbmlns an SBMLNamespaces object. 131 * 132 * 133 * @throws SBMLConstructorException 134 * Thrown if the given @p sbmlns is inconsistent or incompatible 135 * with this object. 136 * 137 * 138 * 139 * 140 * @note Attempting to add an object to an SBMLDocument having a different 141 * combination of SBML Level, Version and XML namespaces than the object 142 * itself will result in an error at the time a caller attempts to make the 143 * addition. A parent object must have compatible Level, Version and XML 144 * namespaces. (Strictly speaking, a parent may also have more XML 145 * namespaces than a child, but the reverse is not permitted.) The 146 * restriction is necessary to ensure that an SBML model has a consistent 147 * overall structure. This requires callers to manage their objects 148 * carefully, but the benefit is increased flexibility in how models can be 149 * created by permitting callers to create objects bottom-up if desired. In 150 * situations where objects are not yet attached to parents (e.g., 151 * SBMLDocument), knowledge of the intented SBML Level and Version help 152 * libSBML determine such things as whether it is valid to assign a 153 * particular value to an attribute. 154 * 155 * 156 */ public ModifierSpeciesReference(SBMLNamespaces sbmlns)157 ModifierSpeciesReference(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_ModifierSpeciesReference__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) { 158 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 159 } 160 161 162 /** 163 * Creates and returns a deep copy of this ModifierSpeciesReference object. 164 * 165 * @return the (deep) copy of this ModifierSpeciesReference object. 166 */ public new clone()167 SBase clone() { 168 global::System.IntPtr cPtr = libsbmlPINVOKE.ModifierSpeciesReference_clone(swigCPtr); 169 ModifierSpeciesReference ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, true); 170 return ret; 171 } 172 173 174 /** 175 * Returns the libSBML type code for this %SBML object. 176 * 177 * 178 * 179 * LibSBML attaches an identifying code to every kind of SBML object. These 180 * are integer constants known as <em>SBML type codes</em>. The names of all 181 * the codes begin with the characters <code>SBML_</code>. 182 * @if clike The set of possible type codes for core elements is defined in 183 * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for 184 * SBML Level 3 packages define their own extra enumerations of type 185 * codes (e.g., #SBMLLayoutTypeCode_t for the Level 3 Layout 186 * package).@endif@if java In the Java language interface for libSBML, the 187 * type codes are defined as static integer constants in the interface class 188 * {@link libsbmlConstants}. @endif@if python In the Python language 189 * interface for libSBML, the type codes are defined as static integer 190 * constants in the interface class @link libsbml@endlink.@endif@if csharp In 191 * the C# language interface for libSBML, the type codes are defined as 192 * static integer constants in the interface class 193 * @link libsbmlcs.libsbml@endlink.@endif Note that different Level 3 194 * package plug-ins may use overlapping type codes; to identify the package 195 * to which a given object belongs, call the 196 * <code>@if conly SBase_getPackageName() 197 * @else SBase::getPackageName() 198 * @endif</code> 199 * method on the object. 200 * 201 * The exception to this is lists: all SBML-style list elements have the type 202 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they 203 * are from. 204 * 205 * 206 * 207 * @return the SBML type code for this object: 208 * @link libsbml#SBML_MODIFIER_SPECIES_REFERENCE SBML_MODIFIER_SPECIES_REFERENCE@endlink (default). 209 * 210 * 211 * @warning <span class='warning'>The specific integer values of the possible 212 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 213 * packages, To fully identify the correct code, <strong>it is necessary to 214 * invoke both getPackageName() and getTypeCode()</strong> (or 215 * ListOf::getItemTypeCode()).</span> 216 * 217 * 218 * 219 * @see getElementName() 220 * @see getPackageName() 221 */ public new getTypeCode()222 int getTypeCode() { 223 int ret = libsbmlPINVOKE.ModifierSpeciesReference_getTypeCode(swigCPtr); 224 return ret; 225 } 226 227 228 /** 229 * Returns the XML element name of this object, which for Species, is 230 * always @c 'modifierSpeciesReference'. 231 * 232 * @return the name of this element, i.e., @c 'modifierSpeciesReference'. 233 */ public new getElementName()234 string getElementName() { 235 string ret = libsbmlPINVOKE.ModifierSpeciesReference_getElementName(swigCPtr); 236 return ret; 237 } 238 239 240 /** 241 * Predicate returning @c true if 242 * all the required attributes for this ModifierSpeciesReference object 243 * have been set. 244 * 245 * The required attributes for a ModifierSpeciesReference object are: 246 * species 247 * 248 * @return @c true if the required attributes have been set, @c false 249 * otherwise. 250 */ public new hasRequiredAttributes()251 bool hasRequiredAttributes() { 252 bool ret = libsbmlPINVOKE.ModifierSpeciesReference_hasRequiredAttributes(swigCPtr); 253 return ret; 254 } 255 256 } 257 258 } 259