OR-Tools
8.0
commandlineflags.h
Go to the documentation of this file.
1
// Copyright 2010-2018 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_BASE_COMMANDLINEFLAGS_H_
15
#define OR_TOOLS_BASE_COMMANDLINEFLAGS_H_
16
17
#include "gflags/gflags.h"
18
19
namespace
absl
{
20
21
template
<
class
T>
22
inline
void
SetFlag
(T* flag,
const
T&
value
) {
23
*flag =
value
;
24
}
25
26
template
<
class
T,
class
V>
27
inline
void
SetFlag
(T* flag,
const
V&
value
) {
28
*flag =
value
;
29
}
30
31
template
<
class
T>
32
inline
const
T&
GetFlag
(T* flag) {
33
return
*flag;
34
}
35
36
template
<
class
T>
37
inline
const
T&
GetFlag
(
const
T& flag) {
38
return
flag;
39
}
40
41
}
// namespace absl
42
43
#define ABSL_DECLARE_FLAG(t, n) DECLARE_##t(n)
44
#define ABSL_FLAG(t, n, d, h) DEFINE_##t(n, d, h)
45
46
#endif // OR_TOOLS_BASE_COMMANDLINEFLAGS_H_
value
int64 value
Definition:
demon_profiler.cc:43
absl::GetFlag
const T & GetFlag(T *flag)
Definition:
commandlineflags.h:32
absl::SetFlag
void SetFlag(T *flag, const T &value)
Definition:
commandlineflags.h:22
absl
Definition:
cleanup.h:22
ortools
base
commandlineflags.h
Generated by
1.8.18