DotNet Reference

.Net Reference

LogCallback.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.2
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
11namespace Google.OrTools.Sat {
12
13using System;
14using System.Runtime.InteropServices;
15using System.Collections;
16
17public class LogCallback : global::System.IDisposable {
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19 protected bool swigCMemOwn;
20
21 internal LogCallback(global::System.IntPtr cPtr, bool cMemoryOwn) {
22 swigCMemOwn = cMemoryOwn;
23 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 }
25
26 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LogCallback obj) {
27 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28 }
29
30 ~LogCallback() {
31 Dispose(false);
32 }
33
34 public void Dispose() {
35 Dispose(true);
36 global::System.GC.SuppressFinalize(this);
37 }
38
39 protected virtual void Dispose(bool disposing) {
40 lock(this) {
41 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 if (swigCMemOwn) {
43 swigCMemOwn = false;
45 }
46 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
47 }
48 }
49 }
50
51 public virtual void NewMessage(string message) {
54 }
55
56 public LogCallback() : this(operations_research_satPINVOKE.new_LogCallback(), true) {
57 SwigDirectorConnect();
58 }
59
60 private void SwigDirectorConnect() {
61 if (SwigDerivedClassHasMethod("NewMessage", swigMethodTypes0))
62 swigDelegate0 = new SwigDelegateLogCallback_0(SwigDirectorMethodNewMessage);
64 }
65
66 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
67 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);
68 bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(LogCallback));
69 return hasDerivedMethod;
70 }
71
72 private void SwigDirectorMethodNewMessage(string message) {
73 NewMessage(message);
74 }
75
76 public delegate void SwigDelegateLogCallback_0(string message);
77
78 private SwigDelegateLogCallback_0 swigDelegate0;
79
80 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(string) };
81}
82
83}
delegate void SwigDelegateLogCallback_0(string message)
virtual void NewMessage(string message)
Definition: LogCallback.cs:51
virtual void Dispose(bool disposing)
Definition: LogCallback.cs:39
static void delete_LogCallback(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LogCallback_NewMessage(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static void LogCallback_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, LogCallback.SwigDelegateLogCallback_0 delegate0)