Fast RTPS  Version 2.1.0
Fast RTPS
SubscriberListener.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 
19 #ifndef SUBLISTENER_H_
20 #define SUBLISTENER_H_
21 
22 #include <fastrtps/fastrtps_dll.h>
23 #include <fastrtps/qos/DeadlineMissedStatus.h>
24 #include <fastrtps/qos/LivelinessChangedStatus.h>
25 
26 namespace eprosima {
27 namespace fastrtps {
28 
29 namespace rtps {
30 class MatchingInfo;
31 } /* namespace rtps */
32 
33 class Subscriber;
34 
40 class RTPS_DllAPI SubscriberListener
41 {
42  public:
43 
45 
46  virtual ~SubscriberListener(){}
47 
52  virtual void onNewDataMessage(Subscriber* sub)
53  {
54  (void)sub;
55  }
56 
62  virtual void onSubscriptionMatched(
63  Subscriber* sub,
64  rtps::MatchingInfo& info)
65  {
66  (void)sub;
67  (void)info;
68  }
69 
76  Subscriber* sub,
77  const RequestedDeadlineMissedStatus& status)
78  {
79  (void)sub;
80  (void)status;
81  }
82 
88  virtual void on_liveliness_changed(
89  Subscriber* sub,
90  const LivelinessChangedStatus& status)
91  {
92  (void)sub;
93  (void)status;
94  }
95 
96 };
97 
98 } /* namespace fastrtps */
99 } /* namespace eprosima */
100 
101 #endif /* LISTENER_H_ */
Class Subscriber, contains the public API that allows the user to control the reception of messages.
Definition: Subscriber.h:43
Class SubscriberListener, it should be used by the end user to implement specific callbacks to certai...
Definition: SubscriberListener.h:41
virtual void on_requested_deadline_missed(Subscriber *sub, const RequestedDeadlineMissedStatus &status)
Virtual method to be called when a topic misses the deadline period.
Definition: SubscriberListener.h:75
virtual void onSubscriptionMatched(Subscriber *sub, rtps::MatchingInfo &info)
Virtual method to be called when the subscriber is matched with a new Writer (or unmatched); i....
Definition: SubscriberListener.h:62
virtual void on_liveliness_changed(Subscriber *sub, const LivelinessChangedStatus &status)
Method called when the liveliness status associated to a subscriber changes.
Definition: SubscriberListener.h:88
SubscriberListener()
Definition: SubscriberListener.h:44
virtual void onNewDataMessage(Subscriber *sub)
Virtual function to be implemented by the user containing the actions to be performed when a new Data...
Definition: SubscriberListener.h:52
virtual ~SubscriberListener()
Definition: SubscriberListener.h:46
DeadlineMissedStatus RequestedDeadlineMissedStatus
Definition: DeadlineMissedStatus.h:32
fastdds::dds::LivelinessChangedStatus LivelinessChangedStatus
Definition: LivelinessChangedStatus.h:29
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23