iceoryx_doc  1.0.1
capro_message.hpp
1 // Copyright (c) 2019 by Robert Bosch GmbH. 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_CAPRO_CAPRO_MESSAGE_HPP
17 #define IOX_POSH_CAPRO_CAPRO_MESSAGE_HPP
18 
19 #include "iceoryx_posh/capro/service_description.hpp"
20 
21 namespace iox
22 {
23 namespace capro
24 {
27 enum class CaproMessageType : uint8_t
28 {
29  NOTYPE = 0,
30  FIND,
31  OFFER,
32  STOP_OFFER,
33  SUB,
34  UNSUB,
35  ACK,
36  NACK,
37  PUB,
38  REQ,
39  RES,
40  PING,
41  PONG,
42  MESSGAGE_TYPE_END
43 };
44 
45 constexpr int32_t MAX_ENUM_STRING_SIZE = 64;
46 constexpr char CaproMessageTypeString[][MAX_ENUM_STRING_SIZE] = {
47  "NOTYPE", "FIND", "OFFER", "STOP_OFFER", "SUB", "UNSUB", "ACK", "NACK", "PUB", "REQ", "RES", "PING", "PONG"};
48 
49 
50 enum class CaproMessageSubType : uint8_t
51 {
52  NOSUBTYPE = 0,
53  SERVICE,
54  EVENT,
55  FIELD
56 };
57 
60 {
61  public:
63  CaproMessage() = default;
64 
71  CaproMessage(CaproMessageType type,
72  const ServiceDescription& serviceDescription,
73  CaproMessageSubType subType = CaproMessageSubType::NOSUBTYPE,
74  void* chunkQueueData = nullptr) noexcept;
75 
76  CaproMessageType m_type{CaproMessageType::NOTYPE};
77  CaproMessageSubType m_subType{CaproMessageSubType::NOSUBTYPE};
78  ServiceDescription m_serviceDescription;
79  void* m_chunkQueueData{nullptr};
80  uint64_t m_historyCapacity{0u};
81 };
82 
83 } // namespace capro
84 } // namespace iox
85 
86 #endif // IOX_POSH_CAPRO_CAPRO_MESSAGE_HPP
C'tors for CaPro messages.
Definition: capro_message.hpp:60
CaproMessage(CaproMessageType type, const ServiceDescription &serviceDescription, CaproMessageSubType subType=CaproMessageSubType::NOSUBTYPE, void *chunkQueueData=nullptr) noexcept
C'tor for CaPro Message with type, service description.
CaproMessage()=default
default constructor
class for the identification of a communication event including information on the service,...
Definition: service_description.hpp:86
Definition: service_description.hpp:29