23 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
26 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
SolutionCallback obj) {
27 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
30 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(
SolutionCallback obj) {
33 throw new global::System.ApplicationException(
"Cannot release ownership as memory is not owned");
34 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
35 obj.swigCMemOwn =
false;
39 return new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
49 global::System.GC.SuppressFinalize(
this);
52 protected virtual void Dispose(
bool disposing) {
54 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
59 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
65 operations_research_satPINVOKE.SolutionCallback_OnSolutionCallback(swigCPtr);
131 int size = System.Runtime.InteropServices.Marshal.ReadInt32(dataPointer);
134 var data =
new System.ReadOnlySpan<
byte>((dataPointer +
sizeof(int)).ToPointer(), size);
137 }
catch (
Google.Protobuf.InvalidProtocolBufferException )
139 throw new System.Exception(
"Unable to parse Google.OrTools.Sat.CpSolverResponse protocol message.");
147 public SolutionCallback() : this(operations_research_satPINVOKE.new_SolutionCallback(), true) {
148 SwigDirectorConnect();
151 private void SwigDirectorConnect() {
152 if (SwigDerivedClassHasMethod(
"OnSolutionCallback", swigMethodTypes0))
157 private bool SwigDerivedClassHasMethod(
string methodName, global::System.Type[] methodTypes) {
158 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
159 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
160 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
161 if (methodInfo.DeclaringType ==
null)
164 if (methodInfo.Name != methodName)
167 var parameters = methodInfo.GetParameters();
168 if (parameters.Length != methodTypes.Length)
171 bool parametersMatch =
true;
172 for (var i = 0; i < parameters.Length; i++) {
173 if (parameters[i].ParameterType != methodTypes[i]) {
174 parametersMatch =
false;
179 if (!parametersMatch)
182 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(
SolutionCallback))) &&
183 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
191 private void SwigDirectorMethodOnSolutionCallback() {
199 private static global::System.Type[] swigMethodTypes0 =
new global::System.Type[] { };