Fast DDS  Version 3.0.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
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,
44 LITTLEEND = 0x0
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 = unsigned char;
84// typedef unsigned int uint;
85// typedef unsigned short ushort;
86using SubmessageFlag = unsigned char;
87using BuiltinEndpointSet_t = uint32_t;
88using NetworkConfigSet_t = uint32_t;
89using Count_t = uint32_t;
90
91#define BIT0 0x01u
92#define BIT1 0x02u
93#define BIT2 0x04u
94#define BIT3 0x08u
95#define BIT4 0x10u
96#define BIT5 0x20u
97#define BIT6 0x40u
98#define BIT7 0x80u
99
100#define BIT(i) (1U << static_cast<unsigned>(i))
101
103struct FASTDDS_EXPORTED_API ProtocolVersion_t
104{
107
109 :
110#if HAVE_SECURITY
111 // As imposed by DDSSEC11-93
113#else
115#endif // if HAVE_SECURITY
116 {
117 }
118
120 octet maj,
121 octet min)
122 : m_major(maj)
123 , m_minor(min)
124 {
125 }
126
127 bool operator ==(
128 const ProtocolVersion_t& v) const
129 {
130 return m_major == v.m_major && m_minor == v.m_minor;
131 }
132
133 bool operator !=(
134 const ProtocolVersion_t& v) const
135 {
136 return m_major != v.m_major || m_minor != v.m_minor;
137 }
138
139};
140
147inline std::ostream& operator <<(
148 std::ostream& output,
149 const ProtocolVersion_t& pv)
150{
151 return output << static_cast<int>(pv.m_major) << "." << static_cast<int>(pv.m_minor);
152}
153
158
160
162// FASTDDS_TODO_BEFORE(3, 0, "Remove eprosima::fastdds::rtps::VendorId_t usings");
164
165} // namespace rtps
166} // namespace fastdds
167} // namespace eprosima
168
169#endif // FASTDDS_RTPS_COMMON__TYPES_HPP
uint32_t BuiltinEndpointSet_t
Definition Types.hpp:87
std::ostream & operator<<(std::ostream &output, BuiltinTransports transports)
Definition BuiltinTransports.hpp:117
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
unsigned char octet
Definition Types.hpp:83
eprosima::fastdds::rtps::VendorId_t VendorId_t
Structure VendorId_t, specifying the vendor Id of the implementation.
Definition Types.hpp:163
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:157
uint32_t Count_t
Definition Types.hpp:89
constexpr Endianness_t DEFAULT_ENDIAN
Definition Types.hpp:80
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:159
const ProtocolVersion_t c_ProtocolVersion_2_0
Definition Types.hpp:154
const ProtocolVersion_t c_ProtocolVersion_2_1
Definition Types.hpp:155
uint32_t NetworkConfigSet_t
Definition Types.hpp:88
unsigned char SubmessageFlag
Definition Types.hpp:86
const ProtocolVersion_t c_ProtocolVersion_2_2
Definition Types.hpp:156
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:104
octet m_major
Definition Types.hpp:105
ProtocolVersion_t()
Definition Types.hpp:108
ProtocolVersion_t(octet maj, octet min)
Definition Types.hpp:119
octet m_minor
Definition Types.hpp:106