OR-Tools
9.3
solver_init_arguments.cc
Go to the documentation of this file.
1
// Copyright 2010-2021 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
#include "
ortools/math_opt/cpp/solver_init_arguments.h
"
15
16
#include <memory>
17
#include <utility>
18
19
namespace
operations_research::math_opt
{
20
21
SolverInitArguments::SolverInitArguments
(
22
StreamableSolverInitArguments
streamable)
23
: streamable(
std
::move(streamable)) {}
24
25
SolverInitArguments::SolverInitArguments
(
26
const
NonStreamableSolverInitArguments
& non_streamable)
27
: non_streamable(non_streamable.Clone()) {}
28
29
SolverInitArguments::SolverInitArguments
(
30
StreamableSolverInitArguments
streamable,
31
const
NonStreamableSolverInitArguments
& non_streamable)
32
: streamable(
std
::move(streamable)),
33
non_streamable(non_streamable.Clone()) {}
34
35
SolverInitArguments::SolverInitArguments
(
const
SolverInitArguments
& other)
36
: streamable(other.streamable),
37
non_streamable(other.non_streamable != nullptr
38
? other.non_streamable->Clone()
39
: nullptr) {}
40
41
SolverInitArguments
&
SolverInitArguments::operator=
(
42
const
SolverInitArguments
& other) {
43
// Assignment to self is possible.
44
if
(&other ==
this
) {
45
return
*
this
;
46
}
47
48
streamable
= other.
streamable
;
49
non_streamable
=
50
other.
non_streamable
!=
nullptr
? other.
non_streamable
->Clone() :
nullptr
;
51
52
return
*
this
;
53
}
54
55
}
// namespace operations_research::math_opt
operations_research::math_opt
Definition:
arrow_operator_proxy.h:20
std
STL namespace.
solver_init_arguments.h
operations_research::math_opt::NonStreamableSolverInitArguments
Definition:
non_streamable_solver_init_arguments.h:48
operations_research::math_opt::SolverInitArguments
Definition:
solver_init_arguments.h:53
operations_research::math_opt::SolverInitArguments::SolverInitArguments
SolverInitArguments()=default
operations_research::math_opt::SolverInitArguments::operator=
SolverInitArguments & operator=(const SolverInitArguments &other)
Definition:
solver_init_arguments.cc:41
operations_research::math_opt::SolverInitArguments::non_streamable
std::unique_ptr< const NonStreamableSolverInitArguments > non_streamable
Definition:
solver_init_arguments.h:90
operations_research::math_opt::SolverInitArguments::streamable
StreamableSolverInitArguments streamable
Definition:
solver_init_arguments.h:84
operations_research::math_opt::StreamableSolverInitArguments
Definition:
streamable_solver_init_arguments.h:83
ortools
math_opt
cpp
solver_init_arguments.cc
Generated by
1.9.3