Fast CDR  Version 2.2.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
22namespace eprosima {
23namespace fastcdr {
24
25class Cdr;
26
27class Cdr_DllAPI MemberId
28{
29public:
30
31 MemberId() = default;
32
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
61private:
62
63 static constexpr uint32_t member_id_invalid_value_ = 0xFFFFFFFF;
64
65};
66
68
69} // namespace fastcdr
70} // namespace eprosima
71
72#endif //_FASTCDR_XCDR_MEMBERID_HPP_
Definition MemberId.hpp:28
MemberId(uint32_t id_value)
Definition MemberId.hpp:33
uint32_t id
Definition MemberId.hpp:57
static const MemberId MEMBER_ID_INVALID
Definition MemberId.hpp:67
Definition Cdr.h:48