Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
DisjunctiveConstraint.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 DisjunctiveConstraint : Constraint {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal DisjunctiveConstraint(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.DisjunctiveConstraint_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(DisjunctiveConstraint 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(DisjunctiveConstraint 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 // Store list of delegates to avoid the GC to reclaim them.
56 private List<LongLongToLong> LongLongToLongCallbacks;
57 // Ensure that the GC does not collect any IndexEvaluator1Callback set from C#
58 // as the underlying C++ class will only store a pointer to it (i.e. no ownership).
59 private LongLongToLong StoreLongLongToLong(LongLongToLong c) {
60 if (LongLongToLongCallbacks == null)
61 LongLongToLongCallbacks = new List<LongLongToLong>();
62 LongLongToLongCallbacks.Add(c);
63 return c;
64 }
65
66 public virtual SequenceVar SequenceVar() {
67 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.DisjunctiveConstraint_SequenceVar(swigCPtr);
68 SequenceVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new SequenceVar(cPtr, false);
69 return ret;
70 }
71
72 public void SetTransitionTime( LongLongToLong transition_time) {
74 }
75
76 public long TransitionTime(int before_index, int after_index) {
77 long ret = operations_research_constraint_solverPINVOKE.DisjunctiveConstraint_TransitionTime(swigCPtr, before_index, after_index);
78 return ret;
79 }
80
81}
82
83}
long TransitionTime(int before_index, int after_index)
static void DisjunctiveConstraint_SetTransitionTime(global::System.Runtime.InteropServices.HandleRef jarg1, LongLongToLong jarg2)
static void delete_DisjunctiveConstraint(global::System.Runtime.InteropServices.HandleRef jarg1)
static long DisjunctiveConstraint_TransitionTime(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
delegate long LongLongToLong(long t, long u)
Used to wrap IndexEvaluator2 (std::function<int64_t(int64_t, int64_t)>)