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  * In some situations, constructors for SBML objects may need to indicate to
22  * callers that the creation of the object failed.  The failure may be for
23  * different reasons, such as an attempt to use invalid parameters or a
24  * system condition such as a memory error.  To communicate this to callers,
25  * those classes will throw an SBMLConstructorException.
26  *
27  * In languages that don't have an exception mechanism (e.g., C), the
28  * constructors generally try to return an error code instead of throwing
29  * an exception.
30  */
31 
32 public class SBMLConstructorException : System.ArgumentException, global::System.IDisposable {
33 	private HandleRef swigCPtr;
34 	protected bool swigCMemOwn;
35 
SBMLConstructorException(IntPtr cPtr, bool cMemoryOwn)36 	internal SBMLConstructorException(IntPtr cPtr, bool cMemoryOwn)
37 	{
38 		swigCMemOwn = cMemoryOwn;
39 		swigCPtr    = new HandleRef(this, cPtr);
40 	}
41 
getCPtr(SBMLConstructorException obj)42 	internal static HandleRef getCPtr(SBMLConstructorException obj)
43 	{
44 		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
45 	}
46 
getCPtrAndDisown(SBMLConstructorException obj)47 	internal static HandleRef getCPtrAndDisown (SBMLConstructorException obj)
48 	{
49 		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
50 
51 		if (obj != null)
52 		{
53 			ptr             = obj.swigCPtr;
54 			obj.swigCMemOwn = false;
55 		}
56 
57 		return ptr;
58 	}
59 
~SBMLConstructorException()60   ~SBMLConstructorException() {
61     Dispose(false);
62   }
63 
Dispose()64   public void Dispose() {
65     Dispose(true);
66     global::System.GC.SuppressFinalize(this);
67   }
68 
Dispose(bool disposing)69   protected virtual void Dispose(bool disposing) {
70     lock(this) {
71       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
72         if (swigCMemOwn) {
73           swigCMemOwn = false;
74           libsbmlPINVOKE.delete_SBMLConstructorException(swigCPtr);
75         }
76         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
77       }
78     }
79   }
80 
SBMLConstructorException(IntPtr cPtr, bool cMemoryOwn, string v)81   internal SBMLConstructorException(IntPtr cPtr, bool cMemoryOwn, string v) : base(v)
82   {
83     swigCMemOwn = cMemoryOwn;
84     swigCPtr    = new HandleRef(this, cPtr);
85   }
86 
SBMLConstructorException(string v)87   public SBMLConstructorException(string v) :
88    this(libsbmlPINVOKE.new_SBMLConstructorException__SWIG_0(), true, v)
89   {}
90 
91 
92 /** */ /* libsbml-internal */ public
SBMLConstructorException()93  SBMLConstructorException() : this(libsbmlPINVOKE.new_SBMLConstructorException__SWIG_0(), true) {
94   }
95 
96 
97 /** */ /* libsbml-internal */ public
SBMLConstructorException(string errmsg, string sbmlErrMsg)98  SBMLConstructorException(string errmsg, string sbmlErrMsg) : this(libsbmlPINVOKE.new_SBMLConstructorException__SWIG_1(errmsg, sbmlErrMsg), true) {
99   }
100 
101 
102 /** */ /* libsbml-internal */ public
SBMLConstructorException(string elementName, SBMLNamespaces xmlns)103  SBMLConstructorException(string elementName, SBMLNamespaces xmlns) : this(libsbmlPINVOKE.new_SBMLConstructorException__SWIG_2(elementName, SBMLNamespaces.getCPtr(xmlns)), true) {
104   }
105 
106 
107 /**
108    * Returns the message associated with this SBML exception.
109    *
110    * @return the message string.
111    */ public
getSBMLErrMsg()112  string getSBMLErrMsg() {
113     string ret = libsbmlPINVOKE.SBMLConstructorException_getSBMLErrMsg(swigCPtr);
114     return ret;
115   }
116 
117 }
118 
119 }
120