22 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
Constraint obj) {
26 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(Constraint obj) {
32 throw new global::System.ApplicationException(
"Cannot release ownership as memory is not owned");
33 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
34 obj.swigCMemOwn =
false;
38 return new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
42 protected override void Dispose(
bool disposing) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
49 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
51 base.Dispose(disposing);
55 public Constraint(Solver
solver) : this(operations_research_constraint_solverPINVOKE.new_Constraint(Solver.getCPtr(
solver)), true) {
56 SwigDirectorConnect();
59 public virtual void Post() {
83 IntVar ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
IntVar(cPtr, false);
87 private void SwigDirectorConnect() {
88 if (SwigDerivedClassHasMethod(
"ToString", swigMethodTypes0))
90 if (SwigDerivedClassHasMethod(
"Name", swigMethodTypes1))
92 if (SwigDerivedClassHasMethod(
"BaseName", swigMethodTypes2))
94 if (SwigDerivedClassHasMethod(
"Post", swigMethodTypes3))
96 if (SwigDerivedClassHasMethod(
"InitialPropagateWrapper", swigMethodTypes4))
101 private bool SwigDerivedClassHasMethod(
string methodName, global::System.Type[] methodTypes) {
102 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
103 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
104 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
105 if (methodInfo.DeclaringType ==
null)
108 if (methodInfo.Name != methodName)
111 var parameters = methodInfo.GetParameters();
112 if (parameters.Length != methodTypes.Length)
115 bool parametersMatch =
true;
116 for (var i = 0; i < parameters.Length; i++) {
117 if (parameters[i].ParameterType != methodTypes[i]) {
118 parametersMatch =
false;
123 if (!parametersMatch)
126 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(Constraint))) &&
127 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
135 private string SwigDirectorMethodToString() {
139 private string SwigDirectorMethodName() {
143 private string SwigDirectorMethodBaseName() {
147 private void SwigDirectorMethodPost() {
151 private void SwigDirectorMethodInitialPropagateWrapper() {
167 private static global::System.Type[] swigMethodTypes0 =
new global::System.Type[] { };
168 private static global::System.Type[] swigMethodTypes1 =
new global::System.Type[] { };
169 private static global::System.Type[] swigMethodTypes2 =
new global::System.Type[] { };
170 private static global::System.Type[] swigMethodTypes3 =
new global::System.Type[] { };
171 private static global::System.Type[] swigMethodTypes4 =
new global::System.Type[] { };