Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
CppBridge.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.1
4 *
5 * Do not make changes to this file unless you know what you are doing - modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
8
9package com.google.ortools.init;
10
16public class CppBridge {
17 private transient long swigCPtr;
18 protected transient boolean swigCMemOwn;
19
20 protected CppBridge(long cPtr, boolean cMemoryOwn) {
21 swigCMemOwn = cMemoryOwn;
22 swigCPtr = cPtr;
23 }
24
25 protected static long getCPtr(CppBridge obj) {
26 return (obj == null) ? 0 : obj.swigCPtr;
27 }
28
29 protected static long swigRelease(CppBridge obj) {
30 long ptr = 0;
31 if (obj != null) {
32 if (!obj.swigCMemOwn)
33 throw new RuntimeException("Cannot release ownership as memory is not owned");
34 ptr = obj.swigCPtr;
35 obj.swigCMemOwn = false;
36 obj.delete();
37 }
38 return ptr;
39 }
40
41 @SuppressWarnings({"deprecation", "removal"})
42 protected void finalize() {
43 delete();
44 }
45
46 public synchronized void delete() {
47 if (swigCPtr != 0) {
48 if (swigCMemOwn) {
49 swigCMemOwn = false;
50 mainJNI.delete_CppBridge(swigCPtr);
51 }
52 swigCPtr = 0;
53 }
54 }
55
61 public static void initLogging(String usage) {
62 mainJNI.CppBridge_initLogging(usage);
63 }
64
73 public static void shutdownLogging() {
74 mainJNI.CppBridge_shutdownLogging();
75 }
76
80 public static void setFlags(CppFlags flags) {
81 mainJNI.CppBridge_setFlags(CppFlags.getCPtr(flags), flags);
82 }
83
92 public static boolean loadGurobiSharedLibrary(String full_library_path) {
93 return mainJNI.CppBridge_loadGurobiSharedLibrary(full_library_path);
94 }
95
96 public CppBridge() {
97 this(mainJNI.new_CppBridge(), true);
98 }
99
100}
CppBridge(long cPtr, boolean cMemoryOwn)
static long swigRelease(CppBridge obj)
static void setFlags(CppFlags flags)
static void initLogging(String usage)
static long getCPtr(CppBridge obj)
static boolean loadGurobiSharedLibrary(String full_library_path)
static long getCPtr(CppFlags obj)
Definition CppFlags.java:23