Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Demon.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 Demon : BaseObject {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal Demon(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.Demon_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Demon 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(Demon 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 Demon() : this(operations_research_constraint_solverPINVOKE.new_Demon(), true) {
56 SwigDirectorConnect();
57 }
58
59 public virtual void RunWrapper(Solver s) {
61 }
62
63 public virtual int Priority() {
64 int ret = (SwigDerivedClassHasMethod("Priority", swigMethodTypes2) ? operations_research_constraint_solverPINVOKE.Demon_PrioritySwigExplicitDemon(swigCPtr) : operations_research_constraint_solverPINVOKE.Demon_Priority(swigCPtr));
65 return ret;
66 }
67
68 public override string ToString() {
69 string ret = (SwigDerivedClassHasMethod("ToString", swigMethodTypes0) ? operations_research_constraint_solverPINVOKE.Demon_ToStringSwigExplicitDemon(swigCPtr) : operations_research_constraint_solverPINVOKE.Demon_ToString(swigCPtr));
70 return ret;
71 }
72
73 public void Inhibit(Solver s) {
75 }
76
77 public void Desinhibit(Solver s) {
79 }
80
81 private void SwigDirectorConnect() {
82 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
83 swigDelegate0 = new SwigDelegateDemon_0(SwigDirectorMethodToString);
84 if (SwigDerivedClassHasMethod("RunWrapper", swigMethodTypes1))
85 swigDelegate1 = new SwigDelegateDemon_1(SwigDirectorMethodRunWrapper);
86 if (SwigDerivedClassHasMethod("Priority", swigMethodTypes2))
87 swigDelegate2 = new SwigDelegateDemon_2(SwigDirectorMethodPriority);
88 operations_research_constraint_solverPINVOKE.Demon_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
89 }
90
91 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
92 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
93 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
94 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
95 if (methodInfo.DeclaringType == null)
96 continue;
97
98 if (methodInfo.Name != methodName)
99 continue;
100
101 var parameters = methodInfo.GetParameters();
102 if (parameters.Length != methodTypes.Length)
103 continue;
104
105 bool parametersMatch = true;
106 for (var i = 0; i < parameters.Length; i++) {
107 if (parameters[i].ParameterType != methodTypes[i]) {
108 parametersMatch = false;
109 break;
110 }
111 }
112
113 if (!parametersMatch)
114 continue;
115
116 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(Demon))) &&
117 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
118 return true;
119 }
120 }
121
122 return false;
123 }
124
125 private string SwigDirectorMethodToString() {
126 return ToString();
127 }
128
129 private void SwigDirectorMethodRunWrapper(global::System.IntPtr s) {
130 RunWrapper((s == global::System.IntPtr.Zero) ? null : new Solver(s, false));
131 }
132
133 private int SwigDirectorMethodPriority() {
134 return Priority();
135 }
136
137 public delegate string SwigDelegateDemon_0();
138 public delegate void SwigDelegateDemon_1(global::System.IntPtr s);
139 public delegate int SwigDelegateDemon_2();
141 private SwigDelegateDemon_0 swigDelegate0;
142 private SwigDelegateDemon_1 swigDelegate1;
143 private SwigDelegateDemon_2 swigDelegate2;
144
145 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
146 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Solver) };
147 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { };
148}
149
150}
delegate void SwigDelegateDemon_1(global::System.IntPtr s)
virtual void RunWrapper(Solver s)
Definition Demon.cs:61
static void delete_Demon(global::System.Runtime.InteropServices.HandleRef jarg1)
static int Demon_Priority(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Demon_RunWrapper(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static string Demon_ToStringSwigExplicitDemon(global::System.Runtime.InteropServices.HandleRef jarg1)
static void Demon_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, Demon.SwigDelegateDemon_0 delegate0, Demon.SwigDelegateDemon_1 delegate1, Demon.SwigDelegateDemon_2 delegate2)
static void Demon_Inhibit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void Demon_Desinhibit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static int Demon_PrioritySwigExplicitDemon(global::System.Runtime.InteropServices.HandleRef jarg1)
static string Demon_ToString(global::System.Runtime.InteropServices.HandleRef jarg1)