publisher_base.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * fkie_message_filters
4  * Copyright © 2018-2020 Fraunhofer FKIE
5  * Author: Timo Röhling
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ****************************************************************************/
20 
21 #ifndef INCLUDE_FKIE_MESSAGE_FILTERS_PUBLISHER_BASE_H_
22 #define INCLUDE_FKIE_MESSAGE_FILTERS_PUBLISHER_BASE_H_
23 
24 #include <boost/signals2.hpp>
25 #include <tuple>
26 
27 namespace fkie_message_filters
28 {
29 
30 class SubscriberBase;
31 
39 class PublisherBase
40 {
41  friend class SubscriberBase;
42 public:
43  virtual ~PublisherBase() {}
51  virtual bool is_active() const = 0;
56  virtual std::string topic() const = 0;
57 protected:
73  std::tuple<boost::signals2::connection, boost::signals2::connection> link_with_subscriber(SubscriberBase& sub);
74 private:
75  boost::signals2::signal<void()> enable_signal_, disable_signal_;
76 };
77 
78 } // namespace fkie_message_filters
79 
80 #endif /* INCLUDE_FKIE_MESSAGE_FILTERS_PUBLISHER_BASE_H_ */
fkie_message_filters
Definition: buffer.h:33
fkie_message_filters::PublisherBase::disable_signal_
boost::signals2::signal< void()> disable_signal_
Definition: publisher_base.h:93
fkie_message_filters::PublisherBase::enable_signal_
boost::signals2::signal< void()> enable_signal_
Definition: publisher_base.h:93
fkie_message_filters::PublisherBase::topic
virtual std::string topic() const =0
Return advertised topic name.
fkie_message_filters::PublisherBase::update_subscriber_state
void update_subscriber_state()
Cause all linked subscribers to subscribe or unsubscribe to their ROS topics.
Definition: publisher_subscriber_base.cpp:54
fkie_message_filters::PublisherBase::~PublisherBase
virtual ~PublisherBase()
Definition: publisher_base.h:61
fkie_message_filters::PublisherBase::SubscriberBase
friend class SubscriberBase
Definition: publisher_base.h:59
fkie_message_filters::PublisherBase::link_with_subscriber
std::tuple< boost::signals2::connection, boost::signals2::connection > link_with_subscriber(SubscriberBase &sub)
Add a new subscriber that will be controlled by this publisher.
Definition: publisher_subscriber_base.cpp:45
fkie_message_filters::SubscriberBase
Base class for ROS subscribers in a filter pipeline.
Definition: subscriber_base.h:56
fkie_message_filters::PublisherBase::is_active
virtual bool is_active() const =0
Check if the publisher is active.


fkie_message_filters
Author(s): Timo Röhling
autogenerated on Wed Mar 2 2022 00:18:57