Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
init.h
Go to the documentation of this file.
1// Copyright 2010-2025 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14#ifndef OR_TOOLS_INIT_INIT_H_
15#define OR_TOOLS_INIT_INIT_H_
16
17#include <cstdint>
18#include <string>
19#include <vector>
20
24
25namespace operations_research {
26
30struct CppFlags {
40
45 bool log_prefix = false;
46
59
67
75};
76
82class CppBridge {
83 public:
89 static void InitLogging(const std::string& usage);
90
99 static void ShutdownLogging() {}
100
104 static void SetFlags(const CppFlags& flags);
105
114 static bool LoadGurobiSharedLibrary(const std::string& full_library_path);
115
119 static void DeleteByteArray(uint8_t* buffer) { delete[] buffer; }
120};
121
123 public:
127 static int MajorNumber() {
128 return ::operations_research::OrToolsMajorVersion();
129 }
130
134 static int MinorNumber() {
135 return ::operations_research::OrToolsMinorVersion();
136 }
137
141 static int PatchNumber() {
142 return ::operations_research::OrToolsPatchVersion();
143 }
144
148 static std::string VersionString() {
149 return ::operations_research::OrToolsVersionString();
150 }
151};
152
153} // namespace operations_research
154
155#endif // OR_TOOLS_INIT_INIT_H_
static void ShutdownLogging()
Definition init.h:99
static void DeleteByteArray(uint8_t *buffer)
Definition init.h:119
static bool LoadGurobiSharedLibrary(const std::string &full_library_path)
Definition init.cc:41
static void SetFlags(const CppFlags &flags)
Definition init.cc:30
static void InitLogging(const std::string &usage)
Definition init.cc:25
static std::string VersionString()
Definition init.h:148
In SWIG mode, we don't want anything besides these top-level includes.
bool log_prefix
Controls if time and source code info are used to prefix logging messages.
Definition init.h:45
int stderrthreshold
Controls the logging level shown on stderr.
Definition init.h:39
std::string cp_model_dump_prefix
Definition init.h:50