Fast RTPS  Version 2.6.0
Fast RTPS
Publisher.h
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 
20 #ifndef PUBLISHER_H_
21 #define PUBLISHER_H_
22 
23 #include <fastrtps/fastrtps_dll.h>
24 #include <fastdds/rtps/common/Guid.h>
25 #include <fastdds/rtps/common/Time_t.h>
26 #include <fastrtps/attributes/PublisherAttributes.h>
27 #include <fastrtps/qos/DeadlineMissedStatus.h>
28 #include <fastrtps/qos/LivelinessLostStatus.h>
29 
30 namespace eprosima {
31 namespace fastrtps {
32 
33 namespace rtps {
34 struct GUID_t;
35 class WriteParams;
36 class RTPSParticipant;
37 } // namespace rtps
38 
39 class Participant;
40 class PublisherImpl;
41 
46 class RTPS_DllAPI Publisher
47 {
48  friend class PublisherImpl;
49  virtual ~Publisher();
50 
51 public:
52 
57  Publisher(
58  PublisherImpl* pimpl);
59 
69  bool write(
70  void* sample);
71 
82  bool write(
83  void* sample,
84  rtps::WriteParams& wparams);
85 
94  fastrtps::rtps::InstanceHandle_t register_instance(
95  void* instance);
96 
105  bool dispose(
106  void* data,
107  const rtps::InstanceHandle_t& handle);
117  bool unregister_instance(
118  void* instance,
119  const rtps::InstanceHandle_t& handle);
120 
126  bool removeAllChange(
127  size_t* removed = nullptr);
128 
134  bool wait_for_all_acked(
135  const Duration_t& max_wait);
136 
141  const rtps::GUID_t& getGuid();
142 
147  const PublisherAttributes& getAttributes() const;
148 
154  bool updateAttributes(
155  const PublisherAttributes& att);
156 
161  void get_offered_deadline_missed_status(
163 
167  void assert_liveliness();
168 
173  void get_liveliness_lost_status(
174  LivelinessLostStatus& status);
175 
181  void get_sending_locators(
182  rtps::LocatorList_t& locators) const;
183 
184 private:
185 
186  PublisherImpl* mp_impl;
187 };
188 
189 } /* namespace fastrtps */
190 } /* namespace eprosima */
191 
192 #endif /* PUBLISHER_H_ */
DeadlineMissedStatus OfferedDeadlineMissedStatus
Definition: DeadlineMissedStatus.h:29
Class PublisherAttributes, used by the user to define the attributes of a Publisher.
Definition: PublisherAttributes.h:39
Class Publisher, used to send data to associated subscribers.
Definition: Publisher.h:46
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23