iceoryx_posh 2.0.5
Loading...
Searching...
No Matches
iceoryx_posh_types.inl
1// Copyright (c) 2020 - 2021 by 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_ICEORYX_POSH_TYPES_INL
17#define IOX_POSH_ICEORYX_POSH_TYPES_INL
18
19namespace iox
20{
21inline constexpr const char* asStringLiteral(ConnectionState value) noexcept
22{
23 switch (value)
24 {
25 case ConnectionState::NOT_CONNECTED:
26 return "ConnectionState::NOT_CONNECTED";
27 case ConnectionState::CONNECT_REQUESTED:
28 return "ConnectionState::CONNECT_REQUESTED";
29 case ConnectionState::WAIT_FOR_OFFER:
30 return "ConnectionState::WAIT_FOR_OFFER";
31 case ConnectionState::CONNECTED:
32 return "ConnectionState::CONNECTED";
33 case ConnectionState::DISCONNECT_REQUESTED:
34 return "ConnectionState::DISCONNECT_REQUESTED";
35 }
36
37 return "[Undefined ConnectionState]";
38}
39
40std::ostream& operator<<(std::ostream& stream, ConnectionState value) noexcept
41{
42 stream << asStringLiteral(value);
43 return stream;
44}
45
46log::LogStream& operator<<(log::LogStream& stream, ConnectionState value) noexcept
47{
48 stream << asStringLiteral(value);
49 return stream;
50}
51
52namespace roudi
53{
54inline iox::log::LogStream& operator<<(iox::log::LogStream& logstream, const MonitoringMode& mode) noexcept
55{
56 switch (mode)
57 {
58 case MonitoringMode::OFF:
59 logstream << "MonitoringMode::OFF";
60 break;
61 case MonitoringMode::ON:
62 logstream << "MonitoringMode::ON";
63 break;
64 default:
65 logstream << "MonitoringMode::UNDEFINED";
66 break;
67 }
68 return logstream;
69}
70} // namespace roudi
71
72} // namespace iox
73
74#endif // IOX_POSH_ICEORYX_POSH_TYPES_INL
MonitoringMode
Controls process alive monitoring. Upon timeout, a monitored process is removed and its resources are...
Definition iceoryx_posh_types.hpp:243