Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
DecisionBuilder.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (https://www.swig.org).
5// Version 4.2.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
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16using System.Collections.Generic;
17
18public partial class DecisionBuilder : BaseObject {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal DecisionBuilder(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.DecisionBuilder_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DecisionBuilder obj) {
26 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
27 }
28
29 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(DecisionBuilder obj) {
30 if (obj != null) {
31 if (!obj.swigCMemOwn)
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;
35 obj.Dispose();
36 return ptr;
37 } else {
38 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
39 }
40 }
41
42 protected override void Dispose(bool disposing) {
43 lock(this) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
45 if (swigCMemOwn) {
46 swigCMemOwn = false;
48 }
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
50 }
51 base.Dispose(disposing);
52 }
53 }
54
55 public DecisionBuilder() : this(operations_research_constraint_solverPINVOKE.new_DecisionBuilder(), true) {
56 SwigDirectorConnect();
57 }
58
59 public virtual Decision NextWrapper(Solver s) {
60 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.DecisionBuilder_NextWrapper(swigCPtr, Solver.getCPtr(s));
61 Decision ret = (cPtr == global::System.IntPtr.Zero) ? null : new Decision(cPtr, false);
62 return ret;
63 }
64
65 public override string ToString() {
67 return ret;
68 }
69
70 public void SetName(string name) {
77 return ret;
78 }
79
80 private void SwigDirectorConnect() {
81 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
82 swigDelegate0 = new SwigDelegateDecisionBuilder_0(SwigDirectorMethodToString);
83 if (SwigDerivedClassHasMethod("NextWrapper", swigMethodTypes1))
84 swigDelegate1 = new SwigDelegateDecisionBuilder_1(SwigDirectorMethodNextWrapper);
86 }
87
88 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
89 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
90 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
91 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
92 if (methodInfo.DeclaringType == null)
93 continue;
94
95 if (methodInfo.Name != methodName)
96 continue;
97
98 var parameters = methodInfo.GetParameters();
99 if (parameters.Length != methodTypes.Length)
100 continue;
101
102 bool parametersMatch = true;
103 for (var i = 0; i < parameters.Length; i++) {
104 if (parameters[i].ParameterType != methodTypes[i]) {
105 parametersMatch = false;
106 break;
107 }
108 }
109
110 if (!parametersMatch)
111 continue;
112
113 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(DecisionBuilder))) &&
114 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
115 return true;
116 }
117 }
118
119 return false;
120 }
121
122 private string SwigDirectorMethodToString() {
123 return ToString();
124 }
125
126 private global::System.IntPtr SwigDirectorMethodNextWrapper(global::System.IntPtr s) {
127 return Decision.getCPtr(NextWrapper((s == global::System.IntPtr.Zero) ? null : new Solver(s, false))).Handle;
128 }
129
130 public delegate string SwigDelegateDecisionBuilder_0();
131 public delegate global::System.IntPtr SwigDelegateDecisionBuilder_1(global::System.IntPtr s);
133 private SwigDelegateDecisionBuilder_0 swigDelegate0;
134 private SwigDelegateDecisionBuilder_1 swigDelegate1;
135
136 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
137 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Solver) };
138}
139
140}
delegate global::System.IntPtr SwigDelegateDecisionBuilder_1(global::System.IntPtr s)
static string DecisionBuilder_ToStringSwigExplicitDecisionBuilder(global::System.Runtime.InteropServices.HandleRef jarg1)
static void DecisionBuilder_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, DecisionBuilder.SwigDelegateDecisionBuilder_0 delegate0, DecisionBuilder.SwigDelegateDecisionBuilder_1 delegate1)
static string DecisionBuilder_GetName(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_DecisionBuilder(global::System.Runtime.InteropServices.HandleRef jarg1)
static string DecisionBuilder_ToString(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr DecisionBuilder_NextWrapper(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void DecisionBuilder_SetName(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)