| Fast CDR Version 2.3.5 Fast CDR

Loading...
Searching...
No Matches
MemberId.hpp
1// Copyright 2023 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//
15#ifndef _FASTCDR_XCDR_MEMBERID_HPP_
16#define _FASTCDR_XCDR_MEMBERID_HPP_
17
18#include <cstdint>
19
20#include "../fastcdr_dll.h"
21
22 namespace eprosima {
23 namespace fastcdr {
24
25 class Cdr;
26
27 class Cdr_DllAPI MemberId
28{
29 public:
30
31 MemberId() = default;
32
33 MemberId(
34 uint32_t id_value)
35 : id(id_value)
36 {
37 }
38
39 bool operator ==(
40 uint32_t id_value) const
41 {
42 return id == id_value;
43 }
44
45 bool operator ==(
46 const MemberId member_id) const
47 {
48 return id == member_id.id;
49 }
50
51 bool operator !=(
52 const MemberId member_id) const
53 {
54 return !(member_id == *this);
55 }
56
57 uint32_t id { member_id_invalid_value_ };
58
59 bool must_understand { false };
60
61 private:
62
63 static constexpr uint32_t member_id_invalid_value_ = 0xFFFFFFFF;
64
65};
66
67 static const MemberId MEMBER_ID_INVALID {};
68
69} // namespace fastcdr
70} // namespace eprosima
71
72#endif //_FASTCDR_XCDR_MEMBERID_HPP_
eprosima::fastcdr::Cdr
This class offers an interface to serialize/deserialize some basic types using CDR protocol inside an...
Definition Cdr.h:69
eprosima::fastcdr::MemberId
Definition MemberId.hpp:28
eprosima::fastcdr::MemberId::MemberId
MemberId(uint32_t id_value)
Definition MemberId.hpp:33
eprosima::fastcdr::MemberId::id
uint32_t id
Definition MemberId.hpp:57
eprosima::fastcdr::MemberId::must_understand
bool must_understand
Definition MemberId.hpp:59
eprosima::fastcdr::MemberId::MemberId
MemberId()=default
eprosima::fastcdr
Definition Cdr.h:50
eprosima::fastcdr::MEMBER_ID_INVALID
static const MemberId MEMBER_ID_INVALID
Definition MemberId.hpp:67
eprosima
Definition Cdr.h:49