Fast DDS  Version 3.6.1.0
Fast DDS
Loading...
Searching...
No Matches
Types.hpp
1// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
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
18
19#ifndef FASTDDS_RTPS_COMMON__TYPES_HPP
20#define FASTDDS_RTPS_COMMON__TYPES_HPP
21
22#include <cstdint>
23#include <iostream>
24#include <stddef.h>
25#include <stdint.h>
26
27#include <fastdds/fastdds_dll.hpp>
28
29#include <fastdds/rtps/common/ProductVersion_t.hpp>
30#include <fastdds/rtps/common/VendorId_t.hpp>
31
32namespace eprosima {
33namespace fastdds {
34namespace rtps {
35
40{
42 BIGEND = 0x1,
45};
46
53
62
69
76
77#if FASTDDS_IS_BIG_ENDIAN_TARGET
79#else
81#endif // if FASTDDS_IS_BIG_ENDIAN_TARGET
82
83using octet = uint8_t;
85using BuiltinEndpointSet_t = uint32_t;
86using NetworkConfigSet_t = uint32_t;
87using Count_t = uint32_t;
88
89#define BIT0 0x01u
90#define BIT1 0x02u
91#define BIT2 0x04u
92#define BIT3 0x08u
93#define BIT4 0x10u
94#define BIT5 0x20u
95#define BIT6 0x40u
96#define BIT7 0x80u
97
98#define BIT(i) (1U << static_cast<unsigned>(i))
99
101struct FASTDDS_EXPORTED_API ProtocolVersion_t
102{
105
107 :
108#if HAVE_SECURITY
109 // As imposed by DDSSEC11-93
111 2,
112 3)
113#else
115 2,
116 2)
117#endif // if HAVE_SECURITY
118 {
119 }
120
122 octet maj,
123 octet min)
124 : m_major(maj)
125 , m_minor(min)
126 {
127 }
128
129 bool operator ==(
130 const ProtocolVersion_t& v) const
131 {
132 return m_major == v.m_major && m_minor == v.m_minor;
133 }
134
135 bool operator !=(
136 const ProtocolVersion_t& v) const
137 {
138 return m_major != v.m_major || m_minor != v.m_minor;
139 }
140
141};
142
149inline std::ostream& operator <<(
150 std::ostream& output,
151 const ProtocolVersion_t& pv)
152{
153 return output << static_cast<int>(pv.m_major) << "." << static_cast<int>(pv.m_minor);
154}
155
160
162
163} // namespace rtps
164} // namespace fastdds
165} // namespace eprosima
166
167#endif // FASTDDS_RTPS_COMMON__TYPES_HPP
Contains the RTPS protocol implementation.
uint32_t BuiltinEndpointSet_t
Definition Types.hpp:85
std::ostream & operator<<(std::ostream &output, BuiltinTransports transports)
Definition BuiltinTransports.hpp:118
Endianness_t
This enumeration represents endianness types.
Definition Types.hpp:40
@ LITTLEEND
Little endianness.
Definition Types.hpp:44
@ BIGEND
Big endianness.
Definition Types.hpp:42
ReliabilityKind_t
Reliability enum used for internal purposes.
Definition Types.hpp:49
@ BEST_EFFORT
Definition Types.hpp:51
@ RELIABLE
Definition Types.hpp:50
const ProtocolVersion_t c_ProtocolVersion_2_3
Definition Types.hpp:159
uint32_t Count_t
Definition Types.hpp:87
constexpr Endianness_t DEFAULT_ENDIAN
Definition Types.hpp:80
octet SubmessageFlag
Definition Types.hpp:84
EndpointKind_t
Endpoint kind.
Definition Types.hpp:65
@ WRITER
Definition Types.hpp:67
@ READER
Definition Types.hpp:66
const ProtocolVersion_t c_ProtocolVersion
Definition Types.hpp:161
uint8_t octet
Definition Types.hpp:83
const ProtocolVersion_t c_ProtocolVersion_2_0
Definition Types.hpp:156
const ProtocolVersion_t c_ProtocolVersion_2_1
Definition Types.hpp:157
uint32_t NetworkConfigSet_t
Definition Types.hpp:86
const ProtocolVersion_t c_ProtocolVersion_2_2
Definition Types.hpp:158
TopicKind_t
Topic kind.
Definition Types.hpp:72
@ WITH_KEY
Definition Types.hpp:74
@ NO_KEY
Definition Types.hpp:73
DurabilityKind_t
Durability kind.
Definition Types.hpp:56
@ TRANSIENT
Transient Durability.
Definition Types.hpp:59
@ TRANSIENT_LOCAL
Transient Local Durability.
Definition Types.hpp:58
@ PERSISTENT
NOT IMPLEMENTED.
Definition Types.hpp:60
@ VOLATILE
Volatile Durability.
Definition Types.hpp:57
eProsima namespace.
Structure ProtocolVersion_t, contains the protocol version.
Definition Types.hpp:102
octet m_major
Definition Types.hpp:103
ProtocolVersion_t()
Definition Types.hpp:106
ProtocolVersion_t(octet maj, octet min)
Definition Types.hpp:121
octet m_minor
Definition Types.hpp:104