iceoryx_doc  1.0.1
ipc_channel.hpp
1 // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
2 // Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // SPDX-License-Identifier: Apache-2.0
17 #ifndef IOX_UTILS_POSIX_WRAPPER_IPC_CHANNEL_HPP
18 #define IOX_UTILS_POSIX_WRAPPER_IPC_CHANNEL_HPP
19 
20 #include "iceoryx_utils/cxx/string.hpp"
21 
22 
23 namespace iox
24 {
25 #if defined(__APPLE__)
29 constexpr uint32_t MAX_IPC_CHANNEL_NAME_LENGTH = 98U;
30 #else
31 constexpr uint32_t MAX_IPC_CHANNEL_NAME_LENGTH = 100U;
32 #endif
33 
34 using IpcChannelName_t = cxx::string<MAX_IPC_CHANNEL_NAME_LENGTH>;
35 namespace posix
36 {
37 enum class IpcChannelError : uint8_t
38 {
39  INVALID_STATE,
40  NOT_INITIALIZED,
41  ACCESS_DENIED,
42  NO_SUCH_CHANNEL,
43  INTERNAL_LOGIC_ERROR,
44  CHANNEL_ALREADY_EXISTS,
45  INVALID_ARGUMENTS,
46  MAX_MESSAGE_SIZE_EXCEEDED,
47  MESSAGE_TOO_LONG,
48  CHANNEL_FULL,
49  INVALID_CHANNEL_NAME,
50  TIMEOUT,
51  PROCESS_LIMIT,
52  SYSTEM_LIMIT,
53  OUT_OF_MEMORY,
54  INVALID_FILE_DESCRIPTOR,
55  I_O_ERROR,
56  CONNECTION_RESET_BY_PEER,
57  UNDEFINED
58 };
59 
60 enum class IpcChannelMode : uint8_t
61 {
62  NON_BLOCKING,
63  BLOCKING
64 };
65 
66 enum class IpcChannelSide : uint8_t
67 {
68  CLIENT,
69  SERVER
70 };
71 
72 
73 } // namespace posix
74 } // namespace iox
75 
76 #endif // IOX_UTILS_POSIX_WRAPPER_IPC_CHANNEL_HPP
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28