DotNet Reference

DotNet Reference

constraint_solver/Constraint.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 Constraint(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.Constraint_SWIGUpcast(cPtr), cMemoryOwn) {
22  swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23  }
24 
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;
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  public Constraint(Solver solver) : this(operations_research_constraint_solverPINVOKE.new_Constraint(Solver.getCPtr(solver)), true) {
43  SwigDirectorConnect();
44  }
45 
46  public virtual void Post() {
48  }
49 
50  public virtual void InitialPropagateWrapper() {
52  }
53 
54  public override string ToString() {
55  string ret = (SwigDerivedClassHasMethod("ToString", swigMethodTypes0) ? operations_research_constraint_solverPINVOKE.Constraint_ToStringSwigExplicitConstraint(swigCPtr) : operations_research_constraint_solverPINVOKE.Constraint_ToString(swigCPtr));
56  return ret;
57  }
58 
59  public virtual void Accept(ModelVisitor visitor) {
61  }
62 
63  public bool IsCastConstraint() {
65  return ret;
66  }
67 
68  public virtual IntVar Var() {
69  global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.Constraint_Var(swigCPtr);
70  IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
71  return ret;
72  }
73 
74  private void SwigDirectorConnect() {
75  if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
76  swigDelegate0 = new SwigDelegateConstraint_0(SwigDirectorMethodToString);
77  if (SwigDerivedClassHasMethod("Name", swigMethodTypes1))
78  swigDelegate1 = new SwigDelegateConstraint_1(SwigDirectorMethodName);
79  if (SwigDerivedClassHasMethod("BaseName", swigMethodTypes2))
80  swigDelegate2 = new SwigDelegateConstraint_2(SwigDirectorMethodBaseName);
81  if (SwigDerivedClassHasMethod("Post", swigMethodTypes3))
82  swigDelegate3 = new SwigDelegateConstraint_3(SwigDirectorMethodPost);
83  if (SwigDerivedClassHasMethod("InitialPropagateWrapper", swigMethodTypes4))
84  swigDelegate4 = new SwigDelegateConstraint_4(SwigDirectorMethodInitialPropagateWrapper);
85  operations_research_constraint_solverPINVOKE.Constraint_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4);
86  }
87 
88  private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
89  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);
90  bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(Constraint));
91  return hasDerivedMethod;
92  }
93 
94  private string SwigDirectorMethodToString() {
95  return ToString();
96  }
97 
98  private string SwigDirectorMethodName() {
99  return Name();
100  }
101 
102  private string SwigDirectorMethodBaseName() {
103  return BaseName();
104  }
105 
106  private void SwigDirectorMethodPost() {
107  Post();
108  }
109 
110  private void SwigDirectorMethodInitialPropagateWrapper() {
112  }
113 
114  public delegate string SwigDelegateConstraint_0();
115  public delegate string SwigDelegateConstraint_1();
116  public delegate string SwigDelegateConstraint_2();
117  public delegate void SwigDelegateConstraint_3();
118  public delegate void SwigDelegateConstraint_4();
119 
120  private SwigDelegateConstraint_0 swigDelegate0;
121  private SwigDelegateConstraint_1 swigDelegate1;
122  private SwigDelegateConstraint_2 swigDelegate2;
123  private SwigDelegateConstraint_3 swigDelegate3;
124  private SwigDelegateConstraint_4 swigDelegate4;
125 
126  private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
127  private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
128  private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { };
129  private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
130  private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
131 }
132 
133 }
Definition: ValCstPair.cs:20
Definition: IntVar.cs:18
static string Constraint_ToString(global::System.Runtime.InteropServices.HandleRef jarg1)
virtual string BaseName()
static void Constraint_Accept(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
delegate void SwigDelegateConstraint_4()
virtual void InitialPropagateWrapper()
static string Constraint_ToStringSwigExplicitConstraint(global::System.Runtime.InteropServices.HandleRef jarg1)
Definition: Assignment.cs:11
bool IsCastConstraint()
override string ToString()
Definition: ModelVisitor.cs:18
static bool Constraint_IsCastConstraint(global::System.Runtime.InteropServices.HandleRef jarg1)
virtual void Accept(ModelVisitor visitor)
delegate string SwigDelegateConstraint_1()
virtual IntVar Var()
bool swigCMemOwn
Definition: BaseObject.cs:20
delegate void SwigDelegateConstraint_3()
virtual string Name()
static void delete_Constraint(global::System.Runtime.InteropServices.HandleRef jarg1)
override void Dispose(bool disposing)
delegate string SwigDelegateConstraint_2()
static void Constraint_InitialPropagateWrapper(global::System.Runtime.InteropServices.HandleRef jarg1)
virtual void Post()
static void Constraint_Post(global::System.Runtime.InteropServices.HandleRef jarg1)
Solver solver()
static void Constraint_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, Constraint.SwigDelegateConstraint_0 delegate0, Constraint.SwigDelegateConstraint_1 delegate1, Constraint.SwigDelegateConstraint_2 delegate2, Constraint.SwigDelegateConstraint_3 delegate3, Constraint.SwigDelegateConstraint_4 delegate4)
static global::System.IntPtr Constraint_SWIGUpcast(global::System.IntPtr jarg1)
delegate string SwigDelegateConstraint_0()
static global::System.IntPtr Constraint_Var(global::System.Runtime.InteropServices.HandleRef jarg1)
Constraint(Solver solver)