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
15
16#include <memory>
17#include <utility>
18
20
23 : streamable(std::move(streamable)) {}
24
26 const NonStreamableSolverInitArguments& non_streamable)
27 : non_streamable(non_streamable.Clone()) {}
28
31 const NonStreamableSolverInitArguments& non_streamable)
32 : streamable(std::move(streamable)),
33 non_streamable(non_streamable.Clone()) {}
34
36 : streamable(other.streamable),
37 non_streamable(other.non_streamable != nullptr
38 ? other.non_streamable->Clone()
39 : nullptr) {}
40
42 const SolverInitArguments& other) {
43 // Assignment to self is possible.
44 if (&other == this) {
45 return *this;
46 }
47
48 streamable = other.streamable;
50 other.non_streamable != nullptr ? other.non_streamable->Clone() : nullptr;
51
52 return *this;
53}
54
55} // namespace operations_research::math_opt
STL namespace.
SolverInitArguments & operator=(const SolverInitArguments &other)
std::unique_ptr< const NonStreamableSolverInitArguments > non_streamable