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 Base class for extending SBML components
20  *
21  * @htmlinclude not-sbml-warning.html
22  *
23  * @ifnot clike @internal @endif
24  *
25  *
26  *
27  * This class is used as part of the mechanism that connects plugin objects
28  * (implemented using SBasePlugin or SBMLDocumentPlugin) to a given package
29  * extension.  For instance, an implementation of an extended version of
30  * Model (e.g., LayoutModelPlugin in the %Layout package) would involve the
31  * creation of an extension point using SBaseExtensionPoint and a mediator
32  * object created using SBasePluginCreator, to 'plug' the extended Model
33  * object (LayoutModelPlugin) into the overall LayoutExtension object.
34  *
35  * The use of SBaseExtensionPoint is relatively straightforward.  The
36  * class needs to be used for each extended SBML object implemented using
37  * SBMLDocumentPlugin or SBasePlugin.  Doing so requires knowing just two
38  * things:
39  *
40  * @li The short-form name of the @em parent package being extended.  The
41  * parent package is often simply core SBML, identified in libSBML by the
42  * nickname <code>'core'</code>, but a SBML Level&nbsp;3 package could
43  * conceivably extend another Level&nbsp;3 package.
44  *
45  * @li The libSBML type code assigned to the object being extended.  For
46  * example, if an extension of Model is implemented, the relevant type code
47  * is #SBML_MODEL, found in #SBMLTypeCode_t.
48  *
49  * The typical use of SBaseExtensionPoint is illustrated by the following
50  * code fragment:
51  *
52  * @code{.cpp}
53  * SBaseExtensionPoint docExtPoint('core', SBML_DOCUMENT);
54  * SBaseExtensionPoint modelExtPoint('core', SBML_MODEL);
55  *
56  * SBasePluginCreator<GroupsSBMLDocumentPlugin, GroupsExtension> docPluginCreator(docExtPoint, pkgURIs);
57  * SBasePluginCreator<GroupsModelPlugin, GroupsExtension> modelPluginCreator(modelExtPoint, pkgURIs);
58  * @endcode
59  *
60  * The code above shows two core SBML components being extended: the
61  * document object, and the Model object.  These extended objects are
62  * created elsewhere (not shown) as the
63  * <code>GroupsSBMLDocumentPlugin</code> and <code>GroupsModelPlugin</code>
64  * objects.  The corresponding SBaseExtensionPoint objects are handed as
65  * arguments to the constructor for SBasePluginCreator to create the
66  * connection between the extended core components and the overall package
67  * extension (here, for the Groups package, with the
68  * <code>GroupsExtension</code> object).
69  *
70  * The code above is typically placed in the implementation of the
71  * <code>init()</code> method of the package class derived from
72  * SBMLExtension.  (For the example above, it would be in the
73  * <code>GroupsExtension.cpp</code> file.)
74  *
75  *
76  */
77 
78 public class SBaseExtensionPoint : global::System.IDisposable {
79 	private HandleRef swigCPtr;
80 	protected bool swigCMemOwn;
81 
SBaseExtensionPoint(IntPtr cPtr, bool cMemoryOwn)82 	internal SBaseExtensionPoint(IntPtr cPtr, bool cMemoryOwn)
83 	{
84 		swigCMemOwn = cMemoryOwn;
85 		swigCPtr    = new HandleRef(this, cPtr);
86 	}
87 
getCPtr(SBaseExtensionPoint obj)88 	internal static HandleRef getCPtr(SBaseExtensionPoint obj)
89 	{
90 		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
91 	}
92 
getCPtrAndDisown(SBaseExtensionPoint obj)93 	internal static HandleRef getCPtrAndDisown (SBaseExtensionPoint obj)
94 	{
95 		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
96 
97 		if (obj != null)
98 		{
99 			ptr             = obj.swigCPtr;
100 			obj.swigCMemOwn = false;
101 		}
102 
103 		return ptr;
104 	}
105 
~SBaseExtensionPoint()106   ~SBaseExtensionPoint() {
107     Dispose(false);
108   }
109 
Dispose()110   public void Dispose() {
111     Dispose(true);
112     global::System.GC.SuppressFinalize(this);
113   }
114 
Dispose(bool disposing)115   protected virtual void Dispose(bool disposing) {
116     lock(this) {
117       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
118         if (swigCMemOwn) {
119           swigCMemOwn = false;
120           libsbmlPINVOKE.delete_SBaseExtensionPoint(swigCPtr);
121         }
122         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
123       }
124     }
125   }
126 
127 
128 /**
129    * Constructor for SBaseExtensionPoint.
130    *
131    * The use of SBaseExtensionPoint is relatively straightforward.  The
132    * class needs to be used for each extended SBML object implemented
133    * using SBMLDocumentPlugin or SBasePlugin.  Doing so requires knowing
134    * just two things:
135    *
136    * @li The short-form name of the @em parent package being extended.
137    * The parent package is often simply core SBML, identified in libSBML
138    * by the nickname <code>'core'</code>, but a SBML Level&nbsp;3
139    * package could conceivably extend another Level&nbsp;3 package and
140    * the mechanism supports this.
141    *
142    * @li The libSBML type code assigned to the object being extended.
143    * For example, if an extension of Model is implemented, the relevant
144    * type code is SBML_MODEL, found in #SBMLTypeCode_t.
145    *
146    * @param pkgName the short-form name of the parent package where
147    * that this package extension is extending.
148    *
149    * @param typeCode the type code of the object being extended.
150    */ public
SBaseExtensionPoint(string pkgName, int typeCode)151  SBaseExtensionPoint(string pkgName, int typeCode) : this(libsbmlPINVOKE.new_SBaseExtensionPoint__SWIG_0(pkgName, typeCode), true) {
152   }
153 
154 
155 /**
156   * Constructor for SBaseExtensionPoint.
157   *
158   * The use of SBaseExtensionPoint is relatively straightforward.  The
159   * class needs to be used for each extended SBML object implemented
160   * using SBMLDocumentPlugin or SBasePlugin.  Doing so requires knowing
161   * just two things:
162   *
163   * @li The short-form name of the @em parent package being extended.
164   * The parent package is often simply core SBML, identified in libSBML
165   * by the nickname <code>'core'</code>, but a SBML Level&nbsp;3
166   * package could conceivably extend another Level&nbsp;3 package and
167   * the mechanism supports this.
168   *
169   * @li The libSBML type code assigned to the object being extended.
170   * For example, if an extension of Model is implemented, the relevant
171   * type code is SBML_MODEL, found in #SBMLTypeCode_t.
172   *
173   * @param pkgName the short-form name of the parent package where
174   * that this package extension is extending.
175   *
176   * @param typeCode the type code of the object being extended.
177   *
178   * @param elementName element name for the target element, in case
179   * multiple elements match the same type code (as will be the case
180   * for ListOf classes).
181   *
182   * @param elementOnly flag to be used during the registration
183   * of the package, when set then the plugin is only applied to
184   * elements whose elementName match.
185   */ public
SBaseExtensionPoint(string pkgName, int typeCode, string elementName, bool elementOnly)186  SBaseExtensionPoint(string pkgName, int typeCode, string elementName, bool elementOnly) : this(libsbmlPINVOKE.new_SBaseExtensionPoint__SWIG_1(pkgName, typeCode, elementName, elementOnly), true) {
187   }
188 
189 
190 /**
191   * Constructor for SBaseExtensionPoint.
192   *
193   * The use of SBaseExtensionPoint is relatively straightforward.  The
194   * class needs to be used for each extended SBML object implemented
195   * using SBMLDocumentPlugin or SBasePlugin.  Doing so requires knowing
196   * just two things:
197   *
198   * @li The short-form name of the @em parent package being extended.
199   * The parent package is often simply core SBML, identified in libSBML
200   * by the nickname <code>'core'</code>, but a SBML Level&nbsp;3
201   * package could conceivably extend another Level&nbsp;3 package and
202   * the mechanism supports this.
203   *
204   * @li The libSBML type code assigned to the object being extended.
205   * For example, if an extension of Model is implemented, the relevant
206   * type code is SBML_MODEL, found in #SBMLTypeCode_t.
207   *
208   * @param pkgName the short-form name of the parent package where
209   * that this package extension is extending.
210   *
211   * @param typeCode the type code of the object being extended.
212   *
213   * @param elementName element name for the target element, in case
214   * multiple elements match the same type code (as will be the case
215   * for ListOf classes).
216   *
217   * @param elementOnly flag to be used during the registration
218   * of the package, when set then the plugin is only applied to
219   * elements whose elementName match.
220   */ public
SBaseExtensionPoint(string pkgName, int typeCode, string elementName)221  SBaseExtensionPoint(string pkgName, int typeCode, string elementName) : this(libsbmlPINVOKE.new_SBaseExtensionPoint__SWIG_2(pkgName, typeCode, elementName), true) {
222   }
223 
224 
225 /**
226    * Copy constructor.
227    *
228    * This creates a copy of an SBaseExtensionPoint instance.
229    *
230    * @param rhs the object to copy.
231    */ public
SBaseExtensionPoint(SBaseExtensionPoint rhs)232  SBaseExtensionPoint(SBaseExtensionPoint rhs) : this(libsbmlPINVOKE.new_SBaseExtensionPoint__SWIG_3(SBaseExtensionPoint.getCPtr(rhs)), true) {
233     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
234   }
235 
236 
237 /**
238    * Creates and returns a deep copy of this SBaseExtensionPoint object.
239    *
240    * @return the (deep) copy of this SBaseExtensionPoint object.
241    */ public
clone()242  SBaseExtensionPoint clone() {
243     global::System.IntPtr cPtr = libsbmlPINVOKE.SBaseExtensionPoint_clone(swigCPtr);
244     SBaseExtensionPoint ret = (cPtr == global::System.IntPtr.Zero) ? null : new SBaseExtensionPoint(cPtr, true);
245     return ret;
246   }
247 
248 
249 /**
250    * Returns the package name of this extension point.
251    */ public
getPackageName()252  string getPackageName() {
253     string ret = libsbmlPINVOKE.SBaseExtensionPoint_getPackageName(swigCPtr);
254     return ret;
255   }
256 
257 
258 /**
259    * Returns the libSBML type code of this extension point.
260    */ public new
getTypeCode()261  int getTypeCode() {
262     int ret = libsbmlPINVOKE.SBaseExtensionPoint_getTypeCode(swigCPtr);
263     return ret;
264   }
265 
266 
267 /**
268    * the target element name
269    */ public
getElementName()270  string getElementName() {
271     string ret = libsbmlPINVOKE.SBaseExtensionPoint_getElementName(swigCPtr);
272     return ret;
273   }
274 
275 
276 /**
277    *
278    */ public
isElementOnly()279  bool isElementOnly() {
280     bool ret = libsbmlPINVOKE.SBaseExtensionPoint_isElementOnly(swigCPtr);
281     return ret;
282   }
283 
284 }
285 
286 }
287