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 Exceptions thrown by some libSBML constructors. 20 * 21 * @htmlinclude not-sbml-warning.html 22 * 23 * In some situations, constructors for SBML objects may need to indicate 24 * to callers that the creation of the object failed. The failure may be 25 * for different reasons, such as an attempt to use invalid parameters or a 26 * system condition such as a memory error. To communicate this to 27 * callers, those classes will throw an XMLConstructorException. @if cpp 28 * Callers can use the standard C++ <code>std::exception</code> method 29 * <code>what()</code> to extract the diagnostic message stored with the 30 * exception.@endif 31 * <p> 32 * In languages that don't have an exception mechanism (e.g., C), the 33 * constructors generally try to return an error code instead of throwing 34 * an exception. 35 * 36 * @see SBMLConstructorException 37 */ 38 39 public class XMLConstructorException : System.ArgumentException, global::System.IDisposable { 40 private HandleRef swigCPtr; 41 protected bool swigCMemOwn; 42 XMLConstructorException(IntPtr cPtr, bool cMemoryOwn)43 internal XMLConstructorException(IntPtr cPtr, bool cMemoryOwn) 44 { 45 swigCMemOwn = cMemoryOwn; 46 swigCPtr = new HandleRef(this, cPtr); 47 } 48 getCPtr(XMLConstructorException obj)49 internal static HandleRef getCPtr(XMLConstructorException obj) 50 { 51 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 52 } 53 getCPtrAndDisown(XMLConstructorException obj)54 internal static HandleRef getCPtrAndDisown (XMLConstructorException obj) 55 { 56 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 57 58 if (obj != null) 59 { 60 ptr = obj.swigCPtr; 61 obj.swigCMemOwn = false; 62 } 63 64 return ptr; 65 } 66 ~XMLConstructorException()67 ~XMLConstructorException() { 68 Dispose(false); 69 } 70 Dispose()71 public void Dispose() { 72 Dispose(true); 73 global::System.GC.SuppressFinalize(this); 74 } 75 Dispose(bool disposing)76 protected virtual void Dispose(bool disposing) { 77 lock(this) { 78 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 79 if (swigCMemOwn) { 80 swigCMemOwn = false; 81 libsbmlPINVOKE.delete_XMLConstructorException(swigCPtr); 82 } 83 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 84 } 85 } 86 } 87 XMLConstructorException(IntPtr cPtr, bool cMemoryOwn, string v)88 internal XMLConstructorException(IntPtr cPtr, bool cMemoryOwn, string v) : base(v) 89 { 90 swigCMemOwn = cMemoryOwn; 91 swigCPtr = new HandleRef(this, cPtr); 92 } 93 XMLConstructorException(string v)94 public XMLConstructorException(string v) : 95 this(libsbmlPINVOKE.new_XMLConstructorException(), true, v) 96 {} 97 98 99 /** */ /* libsbml-internal */ public XMLConstructorException()100 XMLConstructorException() : this(libsbmlPINVOKE.new_XMLConstructorException(), true) { 101 } 102 103 } 104 105 } 106