Fast DDS  Version 3.6.1.0
Fast DDS
Endpoint.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__ENDPOINT_HPP
20 #define FASTDDS_RTPS__ENDPOINT_HPP
21 
22 #include <fastdds/rtps/attributes/EndpointAttributes.hpp>
23 #include <fastdds/rtps/common/Guid.hpp>
24 #include <fastdds/rtps/common/Locator.hpp>
25 #include <fastdds/rtps/common/Types.hpp>
26 #include <fastdds/rtps/history/IChangePool.hpp>
27 #include <fastdds/rtps/history/IPayloadPool.hpp>
28 #include <fastdds/utils/TimedMutex.hpp>
29 
30 namespace eprosima {
31 namespace fastdds {
32 namespace rtps {
33 
34 class RTPSParticipantImpl;
35 class ResourceEvent;
36 
37 
45 class Endpoint
46 {
47  friend class RTPSParticipantImpl;
48 
49 protected:
50 
51  Endpoint() = default;
52 
54  RTPSParticipantImpl* pimpl,
55  const GUID_t& guid,
56  const EndpointAttributes& att)
57  : mp_RTPSParticipant(pimpl)
58  , m_guid(guid)
59  , m_att(att)
60  {
61  }
62 
63  virtual ~Endpoint()
64  {
65  }
66 
67 public:
68 
73  FASTDDS_EXPORTED_API inline const GUID_t& getGuid() const
74  {
75  return m_guid;
76  }
77 
82  FASTDDS_EXPORTED_API inline RecursiveTimedMutex& getMutex()
83  {
84  return mp_mutex;
85  }
86 
91  FASTDDS_EXPORTED_API inline EndpointAttributes& getAttributes()
92  {
93  return m_att;
94  }
95 
96 #if HAVE_SECURITY
97  bool supports_rtps_protection()
98  {
99  return supports_rtps_protection_;
100  }
101 
102 #endif // if HAVE_SECURITY
103 
104 protected:
105 
108 
110  const GUID_t m_guid;
111 
114 
116  mutable RecursiveTimedMutex mp_mutex;
117 
119  uint32_t fixed_payload_size_ = 0;
120 
121 private:
122 
123  Endpoint& operator =(
124  const Endpoint&) = delete;
125 
126 #if HAVE_SECURITY
127  bool supports_rtps_protection_ = true;
128 #endif // if HAVE_SECURITY
129 };
130 
131 
132 } // namespace rtps
133 } // namespace rtps
134 } // namespace eprosima
135 
136 #endif //FASTDDS_RTPS__ENDPOINT_HPP
Structure EndpointAttributes, describing the attributes associated with an RTPS Endpoint.
Definition: EndpointAttributes.hpp:40
Class Endpoint, all entities of the RTPS network derive from this class.
Definition: Endpoint.hpp:46
uint32_t fixed_payload_size_
Fixed size of payloads.
Definition: Endpoint.hpp:119
const GUID_t m_guid
Endpoint GUID.
Definition: Endpoint.hpp:110
RTPSParticipantImpl * mp_RTPSParticipant
Pointer to the RTPSParticipant containing this endpoint.
Definition: Endpoint.hpp:107
FASTDDS_EXPORTED_API RecursiveTimedMutex & getMutex()
Get mutex.
Definition: Endpoint.hpp:82
EndpointAttributes m_att
Endpoint Attributes.
Definition: Endpoint.hpp:113
FASTDDS_EXPORTED_API const GUID_t & getGuid() const
Get associated GUID.
Definition: Endpoint.hpp:73
RecursiveTimedMutex mp_mutex
Endpoint Mutex.
Definition: Endpoint.hpp:116
Endpoint(RTPSParticipantImpl *pimpl, const GUID_t &guid, const EndpointAttributes &att)
Definition: Endpoint.hpp:53
friend class RTPSParticipantImpl
Definition: Endpoint.hpp:47
FASTDDS_EXPORTED_API EndpointAttributes & getAttributes()
Get associated attributes.
Definition: Endpoint.hpp:91
virtual ~Endpoint()
Definition: Endpoint.hpp:63
Structure GUID_t, entity identifier, unique in DDS-RTPS Domain.
Definition: Guid.hpp:40