iceoryx_posh  2.0.2
compatibility_check_level.hpp
1 // Copyright (c) 2020 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // SPDX-License-Identifier: Apache-2.0
16 #ifndef IOX_POSH_VERSION_COMPATIBILITY_CHECK_LEVEL_HPP
17 #define IOX_POSH_VERSION_COMPATIBILITY_CHECK_LEVEL_HPP
18 
19 #include "iceoryx_hoofs/log/logstream.hpp"
20 
21 namespace iox
22 {
23 namespace version
24 {
25 enum class CompatibilityCheckLevel
26 {
27  OFF,
28  MAJOR,
29  MINOR,
30  PATCH,
31  COMMIT_ID,
32  BUILD_DATE
33 };
34 
35 inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream,
36  const version::CompatibilityCheckLevel& level) noexcept
37 {
38  switch (level)
39  {
40  case CompatibilityCheckLevel::OFF:
41  logstream << "CompatibilityCheckLevel::OFF";
42  break;
43  case CompatibilityCheckLevel::MAJOR:
44  logstream << "CompatibilityCheckLevel::MAJOR";
45  break;
46  case CompatibilityCheckLevel::MINOR:
47  logstream << "CompatibilityCheckLevel::MINOR";
48  break;
49  case CompatibilityCheckLevel::PATCH:
50  logstream << "CompatibilityCheckLevel::PATCH";
51  break;
52  case CompatibilityCheckLevel::COMMIT_ID:
53  logstream << "CompatibilityCheckLevel::COMMIT_ID";
54  break;
55  case CompatibilityCheckLevel::BUILD_DATE:
56  logstream << "CompatibilityCheckLevel::BUILD_DATE";
57  break;
58  default:
59  logstream << "CompatibilityCheckLevel::UNDEFINED";
60  break;
61  }
62  return logstream;
63 }
64 
65 } // namespace version
66 } // namespace iox
67 #endif // IOX_POSH_VERSION_COMPATIBILITY_CHECK_LEVEL_HPP