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 MIRIAM-compliant data about a model's history. 20 * 21 * @htmlinclude not-sbml-warning.html 22 * 23 * The SBML specification beginning with Level 2 Version 2 defines 24 * a standard approach to recording optional model history and model creator 25 * information in a form that complies with MIRIAM (<a target='_blank' 26 * href='http://www.nature.com/nbt/journal/v23/n12/abs/nbt1156.html'>'Minimum 27 * Information Requested in the Annotation of biochemical Models'</a>, 28 * <i>Nature Biotechnology</i>, vol. 23, no. 12, Dec. 2005). LibSBML 29 * provides the ModelHistory class as a convenient high-level interface for 30 * working with model history data. 31 * 32 * Model histories in SBML consist of one or more <em>model creators</em>, 33 * a single date of @em creation, and one or more @em modification dates. 34 * The overall XML form of this data takes the following form: 35 * 36 <pre class='fragment'> 37 <dc:creator> 38 <rdf:Bag> 39 <rdf:li rdf:parseType='Resource'> 40 <span style='background-color: #d0eed0'>+++</span> 41 <vCard:N rdf:parseType='Resource'> 42 <vCard:Family><span style='background-color: #bbb'>family name</span></vCard:Family> 43 <vCard:Given><span style='background-color: #bbb'>given name</span></vCard:Given> 44 </vCard:N> 45 <span style='background-color: #d0eed0'>+++</span> 46 <span style='border-bottom: 2px dotted #888'><vCard:EMAIL><span style='background-color: #bbb'>email address</span></vCard:EMAIL></span> 47 <span style='background-color: #d0eed0'>+++</span> 48 <span style='border-bottom: 2px dotted #888'><vCard:ORG rdf:parseType='Resource'></span> 49 <span style='border-bottom: 2px dotted #888'><vCard:Orgname><span style='background-color: #bbb'>organization name</span></vCard:Orgname></span> 50 <span style='border-bottom: 2px dotted #888'></vCard:ORG></span> 51 <span style='background-color: #d0eed0'>+++</span> 52 </rdf:li> 53 <span style='background-color: #edd'>...</span> 54 </rdf:Bag> 55 </dc:creator> 56 <dcterms:created rdf:parseType='Resource'> 57 <dcterms:W3CDTF><span style='background-color: #bbb'>creation date</span></dcterms:W3CDTF> 58 </dcterms:created> 59 <dcterms:modified rdf:parseType='Resource'> 60 <dcterms:W3CDTF><span style='background-color: #bbb'>modification date</span></dcterms:W3CDTF> 61 </dcterms:modified> 62 <span style='background-color: #edd'>...</span> 63 </pre> 64 * 65 * In the template above, the <span style='border-bottom: 2px dotted #888'>underlined</span> 66 * portions are optional, the symbol 67 * <span class='code' style='background-color: #d0eed0'>+++</span> is a placeholder 68 * for either no content or valid XML content that is not defined by 69 * the annotation scheme, and the ellipses 70 * <span class='code' style='background-color: #edd'>...</span> 71 * are placeholders for zero or more elements of the same form as the 72 * immediately preceding element. The various placeholders for content, namely 73 * <span class='code' style='background-color: #bbb'>family name</span>, 74 * <span class='code' style='background-color: #bbb'>given name</span>, 75 * <span class='code' style='background-color: #bbb'>email address</span>, 76 * <span class='code' style='background-color: #bbb'>organization</span>, 77 * <span class='code' style='background-color: #bbb'>creation date</span>, and 78 * <span class='code' style='background-color: #bbb'>modification date</span> 79 * are data that can be filled in using the various methods on 80 * the ModelHistory class described below. 81 * 82 * @see ModelCreator 83 * @see Date 84 */ 85 86 public class ModelHistory : global::System.IDisposable { 87 private HandleRef swigCPtr; 88 protected bool swigCMemOwn; 89 ModelHistory(IntPtr cPtr, bool cMemoryOwn)90 internal ModelHistory(IntPtr cPtr, bool cMemoryOwn) 91 { 92 swigCMemOwn = cMemoryOwn; 93 swigCPtr = new HandleRef(this, cPtr); 94 } 95 getCPtr(ModelHistory obj)96 internal static HandleRef getCPtr(ModelHistory obj) 97 { 98 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 99 } 100 getCPtrAndDisown(ModelHistory obj)101 internal static HandleRef getCPtrAndDisown (ModelHistory obj) 102 { 103 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 104 105 if (obj != null) 106 { 107 ptr = obj.swigCPtr; 108 obj.swigCMemOwn = false; 109 } 110 111 return ptr; 112 } 113 ~ModelHistory()114 ~ModelHistory() { 115 Dispose(false); 116 } 117 Dispose()118 public void Dispose() { 119 Dispose(true); 120 global::System.GC.SuppressFinalize(this); 121 } 122 Dispose(bool disposing)123 protected virtual void Dispose(bool disposing) { 124 lock(this) { 125 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 126 if (swigCMemOwn) { 127 swigCMemOwn = false; 128 libsbmlPINVOKE.delete_ModelHistory(swigCPtr); 129 } 130 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 131 } 132 } 133 } 134 operator ==(ModelHistory lhs, ModelHistory rhs)135 public static bool operator==(ModelHistory lhs, ModelHistory rhs) 136 { 137 if((Object)lhs == (Object)rhs) 138 { 139 return true; 140 } 141 142 if( ((Object)lhs == null) || ((Object)rhs == null) ) 143 { 144 return false; 145 } 146 147 return (getCPtr(lhs).Handle.ToString() == getCPtr(rhs).Handle.ToString()); 148 } 149 operator !=(ModelHistory lhs, ModelHistory rhs)150 public static bool operator!=(ModelHistory lhs, ModelHistory rhs) 151 { 152 return !(lhs == rhs); 153 } 154 Equals(Object sb)155 public override bool Equals(Object sb) 156 { 157 if ( ! (sb is ModelHistory) ) 158 { 159 return false; 160 } 161 162 return this == (ModelHistory)sb; 163 } 164 GetHashCode()165 public override int GetHashCode() 166 { 167 return swigCPtr.Handle.ToInt32(); 168 } 169 170 171 /** 172 * Creates a new ModelHistory object. 173 */ public ModelHistory()174 ModelHistory() : this(libsbmlPINVOKE.new_ModelHistory__SWIG_0(), true) { 175 } 176 177 178 /** 179 * Copy constructor; creates a copy of this ModelHistory object. 180 * 181 * @param orig the object to copy. 182 */ public ModelHistory(ModelHistory orig)183 ModelHistory(ModelHistory orig) : this(libsbmlPINVOKE.new_ModelHistory__SWIG_1(ModelHistory.getCPtr(orig)), true) { 184 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 185 } 186 187 188 /** 189 * Creates and returns a deep copy of this ModelHistory object. 190 * 191 * @return the (deep) copy of this ModelHistory object. 192 */ public clone()193 ModelHistory clone() { 194 global::System.IntPtr cPtr = libsbmlPINVOKE.ModelHistory_clone(swigCPtr); 195 ModelHistory ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModelHistory(cPtr, true); 196 return ret; 197 } 198 199 200 /** 201 * Returns the 'creation date' portion of this ModelHistory object. 202 * 203 * @return a Date object representing the creation date stored in 204 * this ModelHistory object. 205 */ public getCreatedDate()206 Date getCreatedDate() { 207 global::System.IntPtr cPtr = libsbmlPINVOKE.ModelHistory_getCreatedDate(swigCPtr); 208 Date ret = (cPtr == global::System.IntPtr.Zero) ? null : new Date(cPtr, false); 209 return ret; 210 } 211 212 213 /** 214 * Returns the 'modified date' portion of this ModelHistory object. 215 * 216 * Note that in the MIRIAM format for annotations, there can be multiple 217 * modification dates. The libSBML ModelHistory class supports this by 218 * storing a list of 'modified date' values. If this ModelHistory object 219 * contains more than one 'modified date' value in the list, this method 220 * will return the first one in the list. 221 * 222 * @return a Date object representing the date of modification 223 * stored in this ModelHistory object. 224 */ public getModifiedDate()225 Date getModifiedDate() { 226 global::System.IntPtr cPtr = libsbmlPINVOKE.ModelHistory_getModifiedDate__SWIG_0(swigCPtr); 227 Date ret = (cPtr == global::System.IntPtr.Zero) ? null : new Date(cPtr, false); 228 return ret; 229 } 230 231 232 /** 233 * Predicate returning @c true or @c false depending on whether this 234 * ModelHistory's 'creation date' is set. 235 * 236 * @return @c true if the creation date value of this ModelHistory is 237 * set, @c false otherwise. 238 */ public isSetCreatedDate()239 bool isSetCreatedDate() { 240 bool ret = libsbmlPINVOKE.ModelHistory_isSetCreatedDate(swigCPtr); 241 return ret; 242 } 243 244 245 /** 246 * Predicate returning @c true or @c false depending on whether this 247 * ModelHistory's 'modified date' is set. 248 * 249 * @return @c true if the modification date value of this ModelHistory 250 * object is set, @c false otherwise. 251 */ public isSetModifiedDate()252 bool isSetModifiedDate() { 253 bool ret = libsbmlPINVOKE.ModelHistory_isSetModifiedDate(swigCPtr); 254 return ret; 255 } 256 257 258 /** 259 * Sets the creation date of this ModelHistory object. 260 * 261 * @param date a Date object representing the date to which the 'created 262 * date' portion of this ModelHistory should be set. 263 * 264 * 265 * @return integer value indicating success/failure of the 266 * function. @if clike The value is drawn from the 267 * enumeration #OperationReturnValues_t. @endif The possible values 268 * returned by this function are: 269 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 270 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 271 */ public setCreatedDate(Date date)272 int setCreatedDate(Date date) { 273 int ret = libsbmlPINVOKE.ModelHistory_setCreatedDate(swigCPtr, Date.getCPtr(date)); 274 return ret; 275 } 276 277 278 /** 279 * Sets the modification date of this ModelHistory object. 280 * 281 * @param date a Date object representing the date to which the 'modified 282 * date' portion of this ModelHistory should be set. 283 * 284 * 285 * @return integer value indicating success/failure of the 286 * function. @if clike The value is drawn from the 287 * enumeration #OperationReturnValues_t. @endif The possible values 288 * returned by this function are: 289 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 290 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 291 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 292 */ public setModifiedDate(Date date)293 int setModifiedDate(Date date) { 294 int ret = libsbmlPINVOKE.ModelHistory_setModifiedDate(swigCPtr, Date.getCPtr(date)); 295 return ret; 296 } 297 298 299 /** 300 * Adds a copy of a Date object to the list of 'modified date' values 301 * stored in this ModelHistory object. 302 * 303 * In the MIRIAM format for annotations, there can be multiple 304 * modification dates. The libSBML ModelHistory class supports this by 305 * storing a list of 'modified date' values. 306 * 307 * @param date a Date object representing the 'modified date' that should 308 * be added to this ModelHistory object. 309 * 310 * 311 * @return integer value indicating success/failure of the 312 * function. @if clike The value is drawn from the 313 * enumeration #OperationReturnValues_t. @endif The possible values 314 * returned by this function are: 315 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 316 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 317 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 318 */ public addModifiedDate(Date date)319 int addModifiedDate(Date date) { 320 int ret = libsbmlPINVOKE.ModelHistory_addModifiedDate(swigCPtr, Date.getCPtr(date)); 321 return ret; 322 } 323 324 325 /** 326 * Returns the list of 'modified date' values (as Date objects) stored in 327 * this ModelHistory object. 328 * 329 * In the MIRIAM format for annotations, there can be multiple 330 * modification dates. The libSBML ModelHistory class supports this by 331 * storing a list of 'modified date' values. 332 * 333 * @return the list of modification dates for this ModelHistory object. 334 */ public getListModifiedDates()335 DateList getListModifiedDates() { 336 IntPtr cPtr = libsbmlPINVOKE.ModelHistory_getListModifiedDates(swigCPtr); 337 return (cPtr == IntPtr.Zero) ? null : new DateList(cPtr, true); 338 } 339 340 341 /** 342 * Get the nth Date object in the list of 'modified date' values stored 343 * in this ModelHistory object. 344 * 345 * In the MIRIAM format for annotations, there can be multiple 346 * modification dates. The libSBML ModelHistory class supports this by 347 * storing a list of 'modified date' values. 348 * 349 * @return the nth Date in the list of ModifiedDates of this 350 * ModelHistory or @c null if no such object exists. 351 */ public getModifiedDate(long n)352 Date getModifiedDate(long n) { 353 global::System.IntPtr cPtr = libsbmlPINVOKE.ModelHistory_getModifiedDate__SWIG_1(swigCPtr, n); 354 Date ret = (cPtr == global::System.IntPtr.Zero) ? null : new Date(cPtr, false); 355 return ret; 356 } 357 358 359 /** 360 * Get the number of Date objects in this ModelHistory object's list of 361 * 'modified dates'. 362 * 363 * In the MIRIAM format for annotations, there can be multiple 364 * modification dates. The libSBML ModelHistory class supports this by 365 * storing a list of 'modified date' values. 366 * 367 * @return the number of ModifiedDates in this ModelHistory. 368 */ public getNumModifiedDates()369 long getNumModifiedDates() { return (long)libsbmlPINVOKE.ModelHistory_getNumModifiedDates(swigCPtr); } 370 371 372 /** 373 * Adds a copy of a ModelCreator object to the list of 'model creator' 374 * values stored in this ModelHistory object. 375 * 376 * In the MIRIAM format for annotations, there can be multiple model 377 * creators. The libSBML ModelHistory class supports this by storing a 378 * list of 'model creator' values. 379 * 380 * @param mc the ModelCreator to add. 381 * 382 * 383 * @return integer value indicating success/failure of the 384 * function. @if clike The value is drawn from the 385 * enumeration #OperationReturnValues_t. @endif The possible values 386 * returned by this function are: 387 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 388 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 389 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 390 */ public addCreator(ModelCreator mc)391 int addCreator(ModelCreator mc) { 392 int ret = libsbmlPINVOKE.ModelHistory_addCreator(swigCPtr, ModelCreator.getCPtr(mc)); 393 return ret; 394 } 395 396 397 /** 398 * Returns the list of ModelCreator objects stored in this ModelHistory 399 * object. 400 * 401 * In the MIRIAM format for annotations, there can be multiple model 402 * creators. The libSBML ModelHistory class supports this by storing a 403 * list of 'model creator' values. 404 * 405 * @return the list of ModelCreator objects. 406 */ public getListCreators()407 ModelCreatorList getListCreators() { 408 IntPtr cPtr = libsbmlPINVOKE.ModelHistory_getListCreators(swigCPtr); 409 return (cPtr == IntPtr.Zero) ? null : new ModelCreatorList(cPtr, true); 410 } 411 412 413 /** 414 * Get the nth ModelCreator object stored in this ModelHistory object. 415 * 416 * In the MIRIAM format for annotations, there can be multiple model 417 * creators. The libSBML ModelHistory class supports this by storing a 418 * list of 'model creator' values. 419 * 420 * @return the nth ModelCreator object or @c null if no such object exists. 421 */ public getCreator(long n)422 ModelCreator getCreator(long n) { 423 global::System.IntPtr cPtr = libsbmlPINVOKE.ModelHistory_getCreator(swigCPtr, n); 424 ModelCreator ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModelCreator(cPtr, false); 425 return ret; 426 } 427 428 429 /** 430 * Get the number of ModelCreator objects stored in this ModelHistory 431 * object. 432 * 433 * In the MIRIAM format for annotations, there can be multiple model 434 * creators. The libSBML ModelHistory class supports this by storing a 435 * list of 'model creator' values. 436 * 437 * @return the number of ModelCreators objects. 438 */ public getNumCreators()439 long getNumCreators() { return (long)libsbmlPINVOKE.ModelHistory_getNumCreators(swigCPtr); } 440 441 442 /** 443 * Predicate returning @c true if all the required elements for this 444 * ModelHistory object have been set. 445 * 446 * The required elements for a ModelHistory object are 'created 447 * name', 'modified date', and at least one 'model creator'. 448 * 449 * @return a boolean value indicating whether all the required 450 * elements for this object have been defined. 451 */ public hasRequiredAttributes()452 bool hasRequiredAttributes() { 453 bool ret = libsbmlPINVOKE.ModelHistory_hasRequiredAttributes(swigCPtr); 454 return ret; 455 } 456 457 458 /** */ /* libsbml-internal */ public hasBeenModified()459 bool hasBeenModified() { 460 bool ret = libsbmlPINVOKE.ModelHistory_hasBeenModified(swigCPtr); 461 return ret; 462 } 463 464 465 /** */ /* libsbml-internal */ public resetModifiedFlags()466 void resetModifiedFlags() { 467 libsbmlPINVOKE.ModelHistory_resetModifiedFlags(swigCPtr); 468 } 469 470 } 471 472 } 473