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
20  * @internal
21  */
22 
23 public class MathFilter : ElementFilter {
24 	private HandleRef swigCPtr;
25 
MathFilter(IntPtr cPtr, bool cMemoryOwn)26 	internal MathFilter(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.MathFilter_SWIGUpcast(cPtr), cMemoryOwn)
27 	{
28 		//super(libsbmlPINVOKE.MathFilterUpcast(cPtr), cMemoryOwn);
29 		swigCPtr = new HandleRef(this, cPtr);
30 	}
31 
getCPtr(MathFilter obj)32 	internal static HandleRef getCPtr(MathFilter obj)
33 	{
34 		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
35 	}
36 
getCPtrAndDisown(MathFilter obj)37 	internal static HandleRef getCPtrAndDisown (MathFilter obj)
38 	{
39 		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
40 
41 		if (obj != null)
42 		{
43 			ptr             = obj.swigCPtr;
44 			obj.swigCMemOwn = false;
45 		}
46 
47 		return ptr;
48 	}
49 
Dispose(bool disposing)50   protected override void Dispose(bool disposing) {
51     lock(this) {
52       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53         if (swigCMemOwn) {
54           swigCMemOwn = false;
55           libsbmlPINVOKE.delete_MathFilter(swigCPtr);
56         }
57         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58       }
59       base.Dispose(disposing);
60     }
61   }
62 
MathFilter()63   public MathFilter() : this(libsbmlPINVOKE.new_MathFilter(), true) {
64     SwigDirectorConnect();
65   }
66 
67 
68 /**
69    * Predicate to test elements.
70    *
71    * This is the central predicate of the ElementFilter class.  In subclasses
72    * of ElementFilter, callers should implement this method such that it
73    * returns @c true for @p element arguments that are 'desirable' and
74    * @c false for those that are 'undesirable' in whatever filtering context the
75    * ElementFilter subclass is designed to be used.
76    *
77    * @param element the element to be tested.
78    *
79    * @return @c true if the @p element is desirable or should be kept,
80    * @c false otherwise.
81    */ public virtual
filter(SBase element)82  bool filter(SBase element) {
83     bool ret = (SwigDerivedClassHasMethod("filter", swigMethodTypes0) ? libsbmlPINVOKE.MathFilter_filterSwigExplicitMathFilter(swigCPtr, SBase.getCPtr(element)) : libsbmlPINVOKE.MathFilter_filter(swigCPtr, SBase.getCPtr(element)));
84     return ret;
85   }
86 
SwigDirectorConnect()87   private void SwigDirectorConnect() {
88     if (SwigDerivedClassHasMethod("filter", swigMethodTypes0))
89       swigDelegate0 = new SwigDelegateMathFilter_0(SwigDirectorMethodfilter);
90     libsbmlPINVOKE.MathFilter_director_connect(swigCPtr, swigDelegate0);
91   }
92 
SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)93   private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
94     global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
95     bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(MathFilter));
96     return hasDerivedMethod;
97   }
98 
SwigDirectorMethodfilter(global::System.IntPtr element)99   private bool SwigDirectorMethodfilter(global::System.IntPtr element) {
100     return filter((element == global::System.IntPtr.Zero) ? null : new SBase(element, false));
101   }
102 
SwigDelegateMathFilter_0(global::System.IntPtr element)103   public delegate bool SwigDelegateMathFilter_0(global::System.IntPtr element);
104 
105   private SwigDelegateMathFilter_0 swigDelegate0;
106 
107   private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(SBase) };
108 }
109 
110 }
111