DotNet Reference

DotNet Reference

IntVar.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 3.0.12
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 
18 public partial class IntVar : IntExpr {
19  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 
21  internal IntVar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.IntVar_SWIGUpcast(cPtr), cMemoryOwn) {
22  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23  }
24 
25  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(IntVar obj) {
26  return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
27  }
28 
29  ~IntVar() {
30  Dispose();
31  }
32 
33  public override void Dispose() {
34  lock(this) {
35  if (swigCPtr.Handle != global::System.IntPtr.Zero) {
36  if (swigCMemOwn) {
37  swigCMemOwn = false;
39  }
40  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
41  }
42  global::System.GC.SuppressFinalize(this);
43  base.Dispose();
44  }
45  }
46 
47  // Keep reference to delegate to avoid GC to collect them early
48  private List<VoidToVoid> closureCallbacks;
49  private VoidToVoid StoreVoidToVoid(VoidToVoid closure) {
50  if (closureCallbacks == null)
51  closureCallbacks = new List<VoidToVoid>();
52  closureCallbacks.Add(closure);
53  return closure;
54  }
55 
56  public override bool IsVar() {
58  return ret;
59  }
60 
61  public override IntVar Var() {
62  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVar_Var(swigCPtr);
63  IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
64  return ret;
65  }
66 
67  public virtual long Value() {
69  return ret;
70  }
71 
72  public virtual void RemoveValue(long v) {
75  }
76 
77  public virtual void RemoveInterval(long l, long u) {
79  }
80 
81  public virtual void RemoveValues( long[] values) {
82  operations_research_constraint_solverPINVOKE.IntVar_RemoveValues(swigCPtr, values.Length, values );
84  }
85 
86  public virtual void SetValues( long[] values) {
87  operations_research_constraint_solverPINVOKE.IntVar_SetValues(swigCPtr, values.Length, values );
88  }
89 
90  public virtual void WhenBound(Demon d) {
92  }
93 
94  public void WhenBound( VoidToVoid closure) {
96  }
97 
98  public virtual void WhenDomain(Demon d) {
100  }
101 
102  public void WhenDomain( VoidToVoid closure) {
103  operations_research_constraint_solverPINVOKE.IntVar_WhenDomain__SWIG_1(swigCPtr, StoreVoidToVoid(closure) );
104  }
105 
106  public virtual ulong Size() {
108  return ret;
109  }
110 
111  public virtual bool Contains(long v) {
113  return ret;
114  }
115 
116  public virtual long OldMin() {
118  return ret;
119  }
120 
121  public virtual long OldMax() {
123  return ret;
124  }
125 
126  public virtual int VarType() {
128  return ret;
129  }
130 
131  public override void Accept(ModelVisitor visitor) {
133  }
134 
135  public virtual new IntVar IsEqual(long constant) {
136  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVar_IsEqual(swigCPtr, constant);
137  IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
138  return ret;
139  }
140 
141  public virtual new IntVar IsDifferent(long constant) {
142  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVar_IsDifferent(swigCPtr, constant);
143  IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
144  return ret;
145  }
146 
147  public virtual new IntVar IsGreaterOrEqual(long constant) {
148  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVar_IsGreaterOrEqual(swigCPtr, constant);
149  IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
150  return ret;
151  }
152 
153  public virtual new IntVar IsLessOrEqual(long constant) {
154  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVar_IsLessOrEqual(swigCPtr, constant);
155  IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
156  return ret;
157  }
158 
159  public int Index() {
161  return ret;
162  }
163 
165  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVar_GetDomain(swigCPtr);
166  IntVarIterator ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVarIterator(cPtr, false);
167  return ret;
168  }
169 
171  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.IntVar_GetHoles(swigCPtr);
172  IntVarIterator ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVarIterator(cPtr, false);
173  return ret;
174  }
175 
176 }
177 
178 }
static global::System.IntPtr IntVar_IsLessOrEqual(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntVar_GetHoles(global::System.Runtime.InteropServices.HandleRef jarg1)
virtual void SetValues(long[] values)
Definition: IntVar.cs:86
Definition: IntVar.cs:18
virtual new IntVar IsDifferent(long constant)
Definition: IntVar.cs:141
virtual new IntVar IsEqual(long constant)
Definition: IntVar.cs:135
void WhenDomain(VoidToVoid closure)
Definition: IntVar.cs:102
static void IntVar_WhenBound__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void IntVar_RemoveInterval(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3)
virtual void RemoveValues(long[] values)
Definition: IntVar.cs:81
Definition: IntExpr.cs:18
virtual long Value()
Definition: IntVar.cs:67
virtual long OldMax()
Definition: IntVar.cs:121
void WhenBound(VoidToVoid closure)
Definition: IntVar.cs:94
static void IntVar_SetValues(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, long[] jarg2)
Definition: Demon.cs:18
static global::System.IntPtr IntVar_IsEqual(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
delegate void VoidToVoid()
virtual void WhenBound(Demon d)
Definition: IntVar.cs:90
override void Dispose()
Definition: IntVar.cs:33
static bool Pending
virtual int VarType()
Definition: IntVar.cs:126
Definition: Assignment.cs:11
static void IntVar_RemoveValues(global::System.Runtime.InteropServices.HandleRef jarg1, int length2, long[] jarg2)
override void Accept(ModelVisitor visitor)
Definition: IntVar.cs:131
static void IntVar_RemoveValue(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void delete_IntVar(global::System.Runtime.InteropServices.HandleRef jarg1)
Definition: ModelVisitor.cs:18
static void IntVar_Accept(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr IntVar_IsGreaterOrEqual(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool IntVar_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
virtual long OldMin()
Definition: IntVar.cs:116
override IntVar Var()
Definition: IntVar.cs:61
static long IntVar_Value(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr IntVar_IsDifferent(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr IntVar_SWIGUpcast(global::System.IntPtr jarg1)
virtual bool Contains(long v)
Definition: IntVar.cs:111
static global::System.IntPtr IntVar_Var(global::System.Runtime.InteropServices.HandleRef jarg1)
bool swigCMemOwn
Definition: BaseObject.cs:20
virtual void RemoveInterval(long l, long u)
Definition: IntVar.cs:77
virtual void RemoveValue(long v)
Definition: IntVar.cs:72
virtual new IntVar IsLessOrEqual(long constant)
Definition: IntVar.cs:153
IntVarIterator GetHoles()
Definition: IntVar.cs:170
static void IntVar_WhenBound__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, VoidToVoid jarg2)
static int IntVar_VarType(global::System.Runtime.InteropServices.HandleRef jarg1)
static long IntVar_OldMin(global::System.Runtime.InteropServices.HandleRef jarg1)
override bool IsVar()
Definition: IntVar.cs:56
IntVarIterator GetDomain()
Definition: IntVar.cs:164
virtual void WhenDomain(Demon d)
Definition: IntVar.cs:98
static void IntVar_WhenDomain__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static int IntVar_Index(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.Exception Retrieve()
virtual new IntVar IsGreaterOrEqual(long constant)
Definition: IntVar.cs:147
static ulong IntVar_Size(global::System.Runtime.InteropServices.HandleRef jarg1)
int Index()
Definition: IntVar.cs:159
static void IntVar_WhenDomain__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, VoidToVoid jarg2)
static long IntVar_OldMax(global::System.Runtime.InteropServices.HandleRef jarg1)
virtual ulong Size()
Definition: IntVar.cs:106
static bool IntVar_IsVar(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr IntVar_GetDomain(global::System.Runtime.InteropServices.HandleRef jarg1)