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 single configuration setting for an SBML converter. 20 * 21 * @htmlinclude libsbml-facility-only-warning.html 22 * 23 * LibSBML provides a number of converters that can perform transformations 24 * on SBML documents. These converters allow their behaviors to be 25 * controlled by setting property values. Converter properties are 26 * communicated using objects of class ConversionProperties, and within 27 * such objects, individual options are encapsulated using ConversionOption 28 * objects. 29 * 30 * A ConversionOption @if conly structure @else object@endif consists of 31 * four parts: 32 * @li A @em key, acting as the name of the option. 33 * @li A @em value of this option. 34 * @li A @em type for the value; the type code is chosen from @if clike 35 * an enumeration @else a set of integer constants@endif whose names all 36 * begin with the prefix <code>CNV_TYPE_</code>. (See the separate <a 37 * class='el' href='#ConversionOptionType_t'>subsection</a> below for more 38 * information.) 39 * @li A @em description consisting of a text string that describes the 40 * option in some way. 41 * 42 * There are no constraints on the values of keys or descriptions; 43 * authors of SBML converters are free to choose them as they see fit. 44 * 45 * @section ConversionOptionType_t Conversion option data types 46 * 47 * An option in ConversionOption must have a data type declared, to 48 * indicate whether it is a string value, an integer, and so forth. The 49 * possible types of values are taken from 50 * @if clike the enumeration #ConversionOptionType_t @else a set of 51 * constants whose symbol names begin with the prefix 52 * <code>CNV_TYPE_</code>@endif. The following are the possible values: 53 * 54 * <p> 55 * <center> 56 * <table width='90%' cellspacing='1' cellpadding='1' border='0' class='normal-font'> 57 * <tr style='background: lightgray' class='normal-font'> 58 * <td><strong>Enumerator</strong></td> 59 * <td><strong>Meaning</strong></td> 60 * </tr> 61 * <tr> 62 * <td><code>@link libsbml#CNV_TYPE_BOOL CNV_TYPE_BOOL@endlink</code></td> 63 * <td>Indicates the value type is a Boolean.</td> 64 * </tr> 65 * <tr> 66 * <td><code>@link libsbml#CNV_TYPE_DOUBLE CNV_TYPE_DOUBLE@endlink</code></td> 67 * <td>Indicates the value type is a double-sized float.</td> 68 * </tr> 69 * <tr> 70 * <td><code>@link libsbml#CNV_TYPE_INT CNV_TYPE_INT@endlink</code></td> 71 * <td>Indicates the value type is an integer.</td> 72 * </tr> 73 * <tr> 74 * <td><code>@link libsbml#CNV_TYPE_SINGLE CNV_TYPE_SINGLE@endlink</code></td> 75 * <td>Indicates the value type is a float.</td> 76 * </tr> 77 * <tr> 78 * <td><code>@link libsbml#CNV_TYPE_STRING CNV_TYPE_STRING@endlink</code></td> 79 * <td>Indicates the value type is a string.</td> 80 * </tr> 81 * </table> 82 * </center> 83 * 84 * @see ConversionProperties 85 */ 86 87 public class ConversionOption : global::System.IDisposable { 88 private HandleRef swigCPtr; 89 protected bool swigCMemOwn; 90 ConversionOption(IntPtr cPtr, bool cMemoryOwn)91 internal ConversionOption(IntPtr cPtr, bool cMemoryOwn) 92 { 93 swigCMemOwn = cMemoryOwn; 94 swigCPtr = new HandleRef(this, cPtr); 95 } 96 getCPtr(ConversionOption obj)97 internal static HandleRef getCPtr(ConversionOption obj) 98 { 99 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 100 } 101 getCPtrAndDisown(ConversionOption obj)102 internal static HandleRef getCPtrAndDisown (ConversionOption obj) 103 { 104 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 105 106 if (obj != null) 107 { 108 ptr = obj.swigCPtr; 109 obj.swigCMemOwn = false; 110 } 111 112 return ptr; 113 } 114 ~ConversionOption()115 ~ConversionOption() { 116 Dispose(false); 117 } 118 Dispose()119 public void Dispose() { 120 Dispose(true); 121 global::System.GC.SuppressFinalize(this); 122 } 123 Dispose(bool disposing)124 protected virtual void Dispose(bool disposing) { 125 lock(this) { 126 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 127 if (swigCMemOwn) { 128 swigCMemOwn = false; 129 libsbmlPINVOKE.delete_ConversionOption(swigCPtr); 130 } 131 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 132 } 133 } 134 } 135 136 137 /** 138 * Creates a new ConversionOption. 139 * 140 * This is the general constructor, taking arguments for all aspects of 141 * an option. Other constructors exist with different arguments. 142 * 143 * 144 * 145 * The conversion @p type argument value must be one of 146 * @if clike the values defined in the enumeration 147 * #ConversionOptionType_t.@endif@if java the constants whose names begin 148 * with the characters <code>CNV_TYPE_</code> in the interface class 149 * {@link libsbmlConstants}.@endif@if python the constants whose names begin 150 * with the characters <code>CNV_TYPE_</code> in the interface class 151 * @link libsbml libsbml@endlink.@endif 152 * 153 * @param key the key for this option. 154 * @param value an optional value for this option. 155 * @param type the type of this option. 156 * @param description the description for this option. 157 * 158 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 159 */ public ConversionOption(string key, string value, int type, string description)160 ConversionOption(string key, string value, int type, string description) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_0(key, value, type, description), true) { 161 } 162 163 164 /** 165 * Creates a new ConversionOption. 166 * 167 * This is the general constructor, taking arguments for all aspects of 168 * an option. Other constructors exist with different arguments. 169 * 170 * 171 * 172 * The conversion @p type argument value must be one of 173 * @if clike the values defined in the enumeration 174 * #ConversionOptionType_t.@endif@if java the constants whose names begin 175 * with the characters <code>CNV_TYPE_</code> in the interface class 176 * {@link libsbmlConstants}.@endif@if python the constants whose names begin 177 * with the characters <code>CNV_TYPE_</code> in the interface class 178 * @link libsbml libsbml@endlink.@endif 179 * 180 * @param key the key for this option. 181 * @param value an optional value for this option. 182 * @param type the type of this option. 183 * @param description the description for this option. 184 * 185 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 186 */ public ConversionOption(string key, string value, int type)187 ConversionOption(string key, string value, int type) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_1(key, value, type), true) { 188 } 189 190 191 /** 192 * Creates a new ConversionOption. 193 * 194 * This is the general constructor, taking arguments for all aspects of 195 * an option. Other constructors exist with different arguments. 196 * 197 * 198 * 199 * The conversion @p type argument value must be one of 200 * @if clike the values defined in the enumeration 201 * #ConversionOptionType_t.@endif@if java the constants whose names begin 202 * with the characters <code>CNV_TYPE_</code> in the interface class 203 * {@link libsbmlConstants}.@endif@if python the constants whose names begin 204 * with the characters <code>CNV_TYPE_</code> in the interface class 205 * @link libsbml libsbml@endlink.@endif 206 * 207 * @param key the key for this option. 208 * @param value an optional value for this option. 209 * @param type the type of this option. 210 * @param description the description for this option. 211 * 212 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 213 */ public ConversionOption(string key, string value)214 ConversionOption(string key, string value) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_2(key, value), true) { 215 } 216 217 218 /** 219 * Creates a new ConversionOption. 220 * 221 * This is the general constructor, taking arguments for all aspects of 222 * an option. Other constructors exist with different arguments. 223 * 224 * 225 * 226 * The conversion @p type argument value must be one of 227 * @if clike the values defined in the enumeration 228 * #ConversionOptionType_t.@endif@if java the constants whose names begin 229 * with the characters <code>CNV_TYPE_</code> in the interface class 230 * {@link libsbmlConstants}.@endif@if python the constants whose names begin 231 * with the characters <code>CNV_TYPE_</code> in the interface class 232 * @link libsbml libsbml@endlink.@endif 233 * 234 * @param key the key for this option. 235 * @param value an optional value for this option. 236 * @param type the type of this option. 237 * @param description the description for this option. 238 * 239 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 240 */ public ConversionOption(string key)241 ConversionOption(string key) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_3(key), true) { 242 } 243 244 245 /** 246 * Creates a new ConversionOption specialized for string-type options. 247 * 248 * @param key the key for this option. 249 * @param value the value for this option. 250 * @param description an optional description. 251 * 252 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 253 */ public ConversionOption(string key, string value, string description)254 ConversionOption(string key, string value, string description) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_4(key, value, description), true) { 255 } 256 257 258 /** 259 * Creates a new ConversionOption specialized for Boolean-type options. 260 * 261 * @param key the key for this option. 262 * @param value the value for this option. 263 * @param description an optional description. 264 * 265 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 266 */ public ConversionOption(string key, bool value, string description)267 ConversionOption(string key, bool value, string description) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_6(key, value, description), true) { 268 } 269 270 271 /** 272 * Creates a new ConversionOption specialized for Boolean-type options. 273 * 274 * @param key the key for this option. 275 * @param value the value for this option. 276 * @param description an optional description. 277 * 278 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 279 */ public ConversionOption(string key, bool value)280 ConversionOption(string key, bool value) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_7(key, value), true) { 281 } 282 283 284 /** 285 * Creates a new ConversionOption specialized for double-type options. 286 * 287 * @param key the key for this option. 288 * @param value the value for this option. 289 * @param description an optional description. 290 * 291 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 292 */ public ConversionOption(string key, double value, string description)293 ConversionOption(string key, double value, string description) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_8(key, value, description), true) { 294 } 295 296 297 /** 298 * Creates a new ConversionOption specialized for double-type options. 299 * 300 * @param key the key for this option. 301 * @param value the value for this option. 302 * @param description an optional description. 303 * 304 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 305 */ public ConversionOption(string key, double value)306 ConversionOption(string key, double value) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_9(key, value), true) { 307 } 308 309 310 /** 311 * Creates a new ConversionOption specialized for float-type options. 312 * 313 * @param key the key for this option. 314 * @param value the value for this option. 315 * @param description an optional description. 316 * 317 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 318 */ public ConversionOption(string key, float value, string description)319 ConversionOption(string key, float value, string description) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_10(key, value, description), true) { 320 } 321 322 323 /** 324 * Creates a new ConversionOption specialized for float-type options. 325 * 326 * @param key the key for this option. 327 * @param value the value for this option. 328 * @param description an optional description. 329 * 330 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 331 */ public ConversionOption(string key, float value)332 ConversionOption(string key, float value) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_11(key, value), true) { 333 } 334 335 336 /** 337 * Creates a new ConversionOption specialized for integer-type options. 338 * 339 * @param key the key for this option. 340 * @param value the value for this option. 341 * @param description an optional description. 342 * 343 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 344 */ public ConversionOption(string key, int value, string description)345 ConversionOption(string key, int value, string description) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_12(key, value, description), true) { 346 } 347 348 349 /** 350 * Creates a new ConversionOption specialized for integer-type options. 351 * 352 * @param key the key for this option. 353 * @param value the value for this option. 354 * @param description an optional description. 355 * 356 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 357 */ public ConversionOption(string key, int value)358 ConversionOption(string key, int value) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_13(key, value), true) { 359 } 360 361 362 /** 363 * Copy constructor; creates a copy of an ConversionOption object. 364 * 365 * @param orig the ConversionOption object to copy. 366 */ public ConversionOption(ConversionOption orig)367 ConversionOption(ConversionOption orig) : this(libsbmlPINVOKE.new_ConversionOption__SWIG_14(ConversionOption.getCPtr(orig)), true) { 368 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 369 } 370 371 372 /** 373 * Creates and returns a deep copy of this ConversionOption object. 374 * 375 * @return the (deep) copy of this ConversionOption object. 376 */ public new clone()377 ConversionOption clone() { 378 global::System.IntPtr cPtr = libsbmlPINVOKE.ConversionOption_clone(swigCPtr); 379 ConversionOption ret = (cPtr == global::System.IntPtr.Zero) ? null : new ConversionOption(cPtr, true); 380 return ret; 381 } 382 383 384 /** 385 * Returns the key for this option. 386 * 387 * @return the key, as a string. 388 */ public getKey()389 string getKey() { 390 string ret = libsbmlPINVOKE.ConversionOption_getKey(swigCPtr); 391 return ret; 392 } 393 394 395 /** 396 * Sets the key for this option. 397 * 398 * @param key a string representing the key to set. 399 */ public setKey(string key)400 void setKey(string key) { 401 libsbmlPINVOKE.ConversionOption_setKey(swigCPtr, key); 402 } 403 404 405 /** 406 * Returns the value of this option. 407 * 408 * @return the value of this option, as a string. 409 */ public getValue()410 string getValue() { 411 string ret = libsbmlPINVOKE.ConversionOption_getValue(swigCPtr); 412 return ret; 413 } 414 415 416 /** 417 * Sets the value for this option. 418 * 419 * @param value the value to set, as a string. 420 */ public setValue(string value)421 void setValue(string value) { 422 libsbmlPINVOKE.ConversionOption_setValue(swigCPtr, value); 423 } 424 425 426 /** 427 * Returns the description string for this option. 428 * 429 * @return the description of this option. 430 */ public getDescription()431 string getDescription() { 432 string ret = libsbmlPINVOKE.ConversionOption_getDescription(swigCPtr); 433 return ret; 434 } 435 436 437 /** 438 * Sets the description text for this option. 439 * 440 * @param description the description to set for this option. 441 */ public setDescription(string description)442 void setDescription(string description) { 443 libsbmlPINVOKE.ConversionOption_setDescription(swigCPtr, description); 444 } 445 446 447 /** 448 * Returns the type of this option 449 * 450 * @return the type of this option. 451 */ public getType()452 int getType() { 453 int ret = libsbmlPINVOKE.ConversionOption_getType(swigCPtr); 454 return ret; 455 } 456 457 458 /** 459 * Sets the type of this option. 460 * 461 * 462 * 463 * The conversion @p type argument value must be one of 464 * @if clike the values defined in the enumeration 465 * #ConversionOptionType_t.@endif@if java the constants whose names begin 466 * with the characters <code>CNV_TYPE_</code> in the interface class 467 * {@link libsbmlConstants}.@endif@if python the constants whose names begin 468 * with the characters <code>CNV_TYPE_</code> in the interface class 469 * @link libsbml libsbml@endlink.@endif 470 * 471 * @param type the type value to use. 472 */ public setType(int type)473 void setType(int type) { 474 libsbmlPINVOKE.ConversionOption_setType(swigCPtr, type); 475 } 476 477 478 /** 479 * Returns the value of this option as a Boolean. 480 * 481 * @return the value of this option. 482 */ public new getBoolValue()483 bool getBoolValue() { 484 bool ret = libsbmlPINVOKE.ConversionOption_getBoolValue(swigCPtr); 485 return ret; 486 } 487 488 489 /** 490 * Set the value of this option to a given Boolean value. 491 * 492 * Invoking this method will also set the type of the option to 493 * @link libsbml#CNV_TYPE_BOOL CNV_TYPE_BOOL@endlink. 494 * 495 * @param value the Boolean value to set. 496 */ public new setBoolValue(bool value)497 void setBoolValue(bool value) { 498 libsbmlPINVOKE.ConversionOption_setBoolValue(swigCPtr, value); 499 } 500 501 502 /** 503 * Returns the value of this option as a @c double. 504 * 505 * @return the value of this option. 506 */ public new getDoubleValue()507 double getDoubleValue() { 508 double ret = libsbmlPINVOKE.ConversionOption_getDoubleValue(swigCPtr); 509 return ret; 510 } 511 512 513 /** 514 * Set the value of this option to a given @c double value. 515 * 516 * Invoking this method will also set the type of the option to 517 * @link libsbml#CNV_TYPE_DOUBLE CNV_TYPE_DOUBLE@endlink. 518 * 519 * @param value the value to set. 520 */ public new setDoubleValue(double value)521 void setDoubleValue(double value) { 522 libsbmlPINVOKE.ConversionOption_setDoubleValue(swigCPtr, value); 523 } 524 525 526 /** 527 * Returns the value of this option as a @c float. 528 * 529 * @return the value of this option as a float. 530 */ public new getFloatValue()531 float getFloatValue() { 532 float ret = libsbmlPINVOKE.ConversionOption_getFloatValue(swigCPtr); 533 return ret; 534 } 535 536 537 /** 538 * Set the value of this option to a given @c float value. 539 * 540 * Invoking this method will also set the type of the option to 541 * @link libsbml#CNV_TYPE_SINGLE CNV_TYPE_SINGLE@endlink. 542 * 543 * @param value the value to set. 544 */ public new setFloatValue(float value)545 void setFloatValue(float value) { 546 libsbmlPINVOKE.ConversionOption_setFloatValue(swigCPtr, value); 547 } 548 549 550 /** 551 * Returns the value of this option as an @c integer. 552 * 553 * @return the value of this option, as an int. 554 */ public new getIntValue()555 int getIntValue() { 556 int ret = libsbmlPINVOKE.ConversionOption_getIntValue(swigCPtr); 557 return ret; 558 } 559 560 561 /** 562 * Set the value of this option to a given @c int value. 563 * 564 * Invoking this method will also set the type of the option to 565 * @link libsbml#CNV_TYPE_INT CNV_TYPE_INT@endlink. 566 * 567 * @param value the value to set. 568 */ public new setIntValue(int value)569 void setIntValue(int value) { 570 libsbmlPINVOKE.ConversionOption_setIntValue(swigCPtr, value); 571 } 572 573 } 574 575 } 576