DotNet Reference

DotNet Reference

IntVarLocalSearchFilter.cs
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 4.0.1
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 
12 
13 using System;
14 using System.Runtime.InteropServices;
15 using System.Collections;
16 using System.Collections.Generic;
17 
19  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 
21  internal IntVarLocalSearchFilter(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.IntVarLocalSearchFilter_SWIGUpcast(cPtr), cMemoryOwn) {
22  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23  }
24 
25  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(IntVarLocalSearchFilter obj) {
26  return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
27  }
28 
29  protected override void Dispose(bool disposing) {
30  lock(this) {
31  if (swigCPtr.Handle != global::System.IntPtr.Zero) {
32  if (swigCMemOwn) {
33  swigCMemOwn = false;
35  }
36  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
37  }
38  base.Dispose(disposing);
39  }
40  }
41 
42  // Store list of delegates to avoid the GC to reclaim them.
43  private LongToVoid objectiveWatcherCallbacks;
44  // Ensure that the GC does not collect any IndexEvaluator1Callback set from C#
45  // as the underlying C++ class will only store a pointer to it (i.e. no ownership).
46  private LongToVoid StoreLongToVoid(LongToVoid c) {
47  objectiveWatcherCallbacks = c;
48  return c;
49  }
50 
51  public IntVarLocalSearchFilter(IntVarVector vars) : this(operations_research_constraint_solverPINVOKE.new_IntVarLocalSearchFilter(IntVarVector.getCPtr(vars)), true) {
53  SwigDirectorConnect();
54  }
55 
56  public override void Synchronize(Assignment assignment, Assignment delta) {
58  }
59 
60  public void AddVars(IntVarVector vars) {
63  }
64 
65  public int Size() {
67  return ret;
68  }
69 
70  public IntVar Var(int index) {
71  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVarLocalSearchFilter_Var(swigCPtr, index);
72  IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
73  return ret;
74  }
75 
76  public long Value(int index) {
78  return ret;
79  }
80 
81  protected virtual void OnSynchronize(Assignment delta) {
83  }
84 
85  public int Index(IntVar var) {
87  return ret;
88  }
89 
90  private void SwigDirectorConnect() {
91  if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
92  swigDelegate0 = new SwigDelegateIntVarLocalSearchFilter_0(SwigDirectorMethodToString);
93  if (SwigDerivedClassHasMethod("Relax", swigMethodTypes1))
94  swigDelegate1 = new SwigDelegateIntVarLocalSearchFilter_1(SwigDirectorMethodRelax);
95  if (SwigDerivedClassHasMethod("Accept", swigMethodTypes2))
96  swigDelegate2 = new SwigDelegateIntVarLocalSearchFilter_2(SwigDirectorMethodAccept);
97  if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes3))
98  swigDelegate3 = new SwigDelegateIntVarLocalSearchFilter_3(SwigDirectorMethodIsIncremental);
99  if (SwigDerivedClassHasMethod("Revert", swigMethodTypes4))
100  swigDelegate4 = new SwigDelegateIntVarLocalSearchFilter_4(SwigDirectorMethodRevert);
101  if (SwigDerivedClassHasMethod("GetSynchronizedObjectiveValue", swigMethodTypes5))
102  swigDelegate5 = new SwigDelegateIntVarLocalSearchFilter_5(SwigDirectorMethodGetSynchronizedObjectiveValue);
103  if (SwigDerivedClassHasMethod("GetAcceptedObjectiveValue", swigMethodTypes6))
104  swigDelegate6 = new SwigDelegateIntVarLocalSearchFilter_6(SwigDirectorMethodGetAcceptedObjectiveValue);
105  if (SwigDerivedClassHasMethod("OnSynchronize", swigMethodTypes7))
106  swigDelegate7 = new SwigDelegateIntVarLocalSearchFilter_7(SwigDirectorMethodOnSynchronize);
107  operations_research_constraint_solverPINVOKE.IntVarLocalSearchFilter_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7);
108  }
109 
110  private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
111  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);
112  bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(IntVarLocalSearchFilter));
113  return hasDerivedMethod;
114  }
115 
116  private string SwigDirectorMethodToString() {
117  return ToString();
118  }
119 
120  private void SwigDirectorMethodRelax(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
121  Relax((delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false), (deltadelta == global::System.IntPtr.Zero) ? null : new Assignment(deltadelta, false));
122  }
123 
124  private bool SwigDirectorMethodAccept(global::System.IntPtr delta, global::System.IntPtr deltadelta, long objective_min, long objective_max) {
125  return Accept((delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false), (deltadelta == global::System.IntPtr.Zero) ? null : new Assignment(deltadelta, false), objective_min, objective_max);
126  }
127 
128  private bool SwigDirectorMethodIsIncremental() {
129  return IsIncremental();
130  }
131 
132  private void SwigDirectorMethodRevert() {
133  Revert();
134  }
135 
136  private long SwigDirectorMethodGetSynchronizedObjectiveValue() {
138  }
139 
140  private long SwigDirectorMethodGetAcceptedObjectiveValue() {
141  return GetAcceptedObjectiveValue();
142  }
143 
144  private void SwigDirectorMethodOnSynchronize(global::System.IntPtr delta) {
145  OnSynchronize((delta == global::System.IntPtr.Zero) ? null : new Assignment(delta, false));
146  }
147 
148  public delegate string SwigDelegateIntVarLocalSearchFilter_0();
149  public delegate void SwigDelegateIntVarLocalSearchFilter_1(global::System.IntPtr delta, global::System.IntPtr deltadelta);
150  public delegate bool SwigDelegateIntVarLocalSearchFilter_2(global::System.IntPtr delta, global::System.IntPtr deltadelta, long objective_min, long objective_max);
155  public delegate void SwigDelegateIntVarLocalSearchFilter_7(global::System.IntPtr delta);
156 
157  private SwigDelegateIntVarLocalSearchFilter_0 swigDelegate0;
158  private SwigDelegateIntVarLocalSearchFilter_1 swigDelegate1;
159  private SwigDelegateIntVarLocalSearchFilter_2 swigDelegate2;
160  private SwigDelegateIntVarLocalSearchFilter_3 swigDelegate3;
161  private SwigDelegateIntVarLocalSearchFilter_4 swigDelegate4;
162  private SwigDelegateIntVarLocalSearchFilter_5 swigDelegate5;
163  private SwigDelegateIntVarLocalSearchFilter_6 swigDelegate6;
164  private SwigDelegateIntVarLocalSearchFilter_7 swigDelegate7;
165 
166  private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
167  private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
168  private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(Assignment), typeof(Assignment), typeof(long), typeof(long) };
169  private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
170  private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
171  private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
172  private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { };
173  private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { typeof(Assignment) };
174 }
175 
176 }
delegate void SwigDelegateIntVarLocalSearchFilter_1(global::System.IntPtr delta, global::System.IntPtr deltadelta)
static void IntVarLocalSearchFilter_OnSynchronize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
delegate void SwigDelegateIntVarLocalSearchFilter_4()
Definition: IntVar.cs:18
virtual void Revert()
static bool Pending
virtual long GetSynchronizedObjectiveValue()
delegate void SwigDelegateIntVarLocalSearchFilter_7(global::System.IntPtr delta)
virtual void OnSynchronize(Assignment delta)
Definition: Assignment.cs:11
Definition: IntVarVector.cs:19
static void IntVarLocalSearchFilter_OnSynchronizeSwigExplicitIntVarLocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
delegate string SwigDelegateIntVarLocalSearchFilter_0()
virtual void Relax(Assignment delta, Assignment deltadelta)
static void IntVarLocalSearchFilter_Synchronize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void IntVarLocalSearchFilter_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, IntVarLocalSearchFilter.SwigDelegateIntVarLocalSearchFilter_0 delegate0, IntVarLocalSearchFilter.SwigDelegateIntVarLocalSearchFilter_1 delegate1, IntVarLocalSearchFilter.SwigDelegateIntVarLocalSearchFilter_2 delegate2, IntVarLocalSearchFilter.SwigDelegateIntVarLocalSearchFilter_3 delegate3, IntVarLocalSearchFilter.SwigDelegateIntVarLocalSearchFilter_4 delegate4, IntVarLocalSearchFilter.SwigDelegateIntVarLocalSearchFilter_5 delegate5, IntVarLocalSearchFilter.SwigDelegateIntVarLocalSearchFilter_6 delegate6, IntVarLocalSearchFilter.SwigDelegateIntVarLocalSearchFilter_7 delegate7)
static void IntVarLocalSearchFilter_AddVars(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
int Size()
static long IntVarLocalSearchFilter_Value(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
IntVar Var(int index)
virtual long GetAcceptedObjectiveValue()
bool swigCMemOwn
Definition: BaseObject.cs:20
delegate long SwigDelegateIntVarLocalSearchFilter_5()
static global::System.IntPtr IntVarLocalSearchFilter_Var(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
delegate bool SwigDelegateIntVarLocalSearchFilter_2(global::System.IntPtr delta, global::System.IntPtr deltadelta, long objective_min, long objective_max)
virtual bool Accept(Assignment delta, Assignment deltadelta, long objective_min, long objective_max)
static int IntVarLocalSearchFilter_Size(global::System.Runtime.InteropServices.HandleRef jarg1)
long Value(int index)
static void delete_IntVarLocalSearchFilter(global::System.Runtime.InteropServices.HandleRef jarg1)
override void Synchronize(Assignment assignment, Assignment delta)
delegate void LongToVoid(long t)
Definition: Assignment.cs:18
void AddVars(IntVarVector vars)
virtual string ToString()
Definition: BaseObject.cs:55
virtual bool IsIncremental()
static global::System.Exception Retrieve()
static int IntVarLocalSearchFilter_Index(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
int Index(IntVar var)
IntVarLocalSearchFilter(IntVarVector vars)
delegate bool SwigDelegateIntVarLocalSearchFilter_3()
override void Dispose(bool disposing)
static global::System.IntPtr IntVarLocalSearchFilter_SWIGUpcast(global::System.IntPtr jarg1)
delegate long SwigDelegateIntVarLocalSearchFilter_6()