rclcpp_lifecycle  master
C++ ROS Lifecycle Library API
Public Types | Public Member Functions | List of all members
rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc > Class Template Reference

brief child class of rclcpp Publisher class. More...

#include <lifecycle_publisher.hpp>

Inheritance diagram for rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >:
Inheritance graph
[legend]
Collaboration diagram for rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >:
Collaboration graph
[legend]

Public Types

using MessageAllocTraits = rclcpp::allocator::AllocRebind< MessageT, Alloc >
 
using MessageAlloc = typename MessageAllocTraits::allocator_type
 
using MessageDeleter = rclcpp::allocator::Deleter< MessageAlloc, MessageT >
 
using MessageUniquePtr = std::unique_ptr< MessageT, MessageDeleter >
 
- Public Types inherited from rclcpp::Publisher< MessageT, std::allocator< void > >
typedef allocator::AllocRebind< MessageT, AllocatorT > MessageAllocatorTraits
 
typedef typename MessageAllocatorTraits::allocator_type MessageAllocator
 
typedef allocator::Deleter< MessageAllocator, MessageT > MessageDeleter
 
typedef std::unique_ptr< MessageT, MessageDeleterMessageUniquePtr
 
typedef std::shared_ptr< const MessageT > MessageSharedPtr
 
- Public Types inherited from rclcpp::PublisherBase
typedef std::shared_ptr< rclcpp::experimental::IntraProcessManagerIntraProcessManagerSharedPtr
 

Public Member Functions

 LifecyclePublisher (rclcpp::node_interfaces::NodeBaseInterface *node_base, const std::string &topic, const rclcpp::QoS &qos, const rclcpp::PublisherOptionsWithAllocator< Alloc > &options)
 
 ~LifecyclePublisher ()
 
virtual void publish (std::unique_ptr< MessageT, MessageDeleter > msg)
 LifecyclePublisher publish function. More...
 
virtual void publish (const MessageT &msg)
 LifecyclePublisher publish function. More...
 
virtual void on_activate ()
 
virtual void on_deactivate ()
 
virtual bool is_activated ()
 
- Public Member Functions inherited from rclcpp_lifecycle::LifecyclePublisherInterface
virtual ~LifecyclePublisherInterface ()
 
- Public Member Functions inherited from rclcpp::Publisher< MessageT, std::allocator< void > >
 Publisher (rclcpp::node_interfaces::NodeBaseInterface *node_base, const std::string &topic, const rclcpp::QoS &qos, const rclcpp::PublisherOptionsWithAllocator< AllocatorT > &options)
 
virtual void post_init_setup (rclcpp::node_interfaces::NodeBaseInterface *node_base, const std::string &topic, const rclcpp::QoS &qos, const rclcpp::PublisherOptionsWithAllocator< AllocatorT > &options)
 
virtual ~Publisher ()
 
rclcpp::LoanedMessage< MessageT, AllocatorT > borrow_loaned_message ()
 
virtual void publish (std::unique_ptr< MessageT, MessageDeleter > msg)
 
void publish (const rcl_serialized_message_t &serialized_msg)
 
void publish (const SerializedMessage &serialized_msg)
 
void publish (rclcpp::LoanedMessage< MessageT, AllocatorT > &&loaned_msg)
 
std::shared_ptr< MessageAllocatorget_allocator () const
 
- Public Member Functions inherited from rclcpp::PublisherBase
 PublisherBase (rclcpp::node_interfaces::NodeBaseInterface *node_base, const std::string &topic, const rosidl_message_type_support_t &type_support, const rcl_publisher_options_t &publisher_options)
 
virtual ~PublisherBase ()
 
const char * get_topic_name () const
 
size_t get_queue_size () const
 
const rmw_gid_tget_gid () const
 
std::shared_ptr< rcl_publisher_t > get_publisher_handle ()
 
std::shared_ptr< const rcl_publisher_t > get_publisher_handle () const
 
const std::vector< std::shared_ptr< rclcpp::QOSEventHandlerBase > > & get_event_handlers () const
 
size_t get_subscription_count () const
 
size_t get_intra_process_subscription_count () const
 
RCUTILS_WARN_UNUSED bool assert_liveliness () const
 
rclcpp::QoS get_actual_qos () const
 
bool can_loan_messages () const
 
bool operator== (const rmw_gid_t &gid) const
 
bool operator== (const rmw_gid_t *gid) const
 
void setup_intra_process (uint64_t intra_process_publisher_id, IntraProcessManagerSharedPtr ipm)
 

Additional Inherited Members

- Protected Types inherited from rclcpp::PublisherBase
typedef std::weak_ptr< rclcpp::experimental::IntraProcessManagerIntraProcessManagerWeakPtr
 
- Protected Member Functions inherited from rclcpp::Publisher< MessageT, std::allocator< void > >
void do_inter_process_publish (const MessageT &msg)
 
void do_serialized_publish (const rcl_serialized_message_t *serialized_msg)
 
void do_loaned_message_publish (MessageT *msg)
 
void do_intra_process_publish (std::unique_ptr< MessageT, MessageDeleter > msg)
 
std::shared_ptr< const MessageT > do_intra_process_publish_and_return_shared (std::unique_ptr< MessageT, MessageDeleter > msg)
 
- Protected Member Functions inherited from rclcpp::PublisherBase
void add_event_handler (const EventCallbackT &callback, const rcl_publisher_event_type_t event_type)
 
void default_incompatible_qos_callback (QOSOfferedIncompatibleQoSInfo &info) const
 
- Protected Attributes inherited from rclcpp::Publisher< MessageT, std::allocator< void > >
const rclcpp::PublisherOptionsWithAllocator< AllocatorT > options_
 
std::shared_ptr< MessageAllocatormessage_allocator_
 
MessageDeleter message_deleter_
 
- Protected Attributes inherited from rclcpp::PublisherBase
std::shared_ptr< rcl_node_t > rcl_node_handle_
 
std::shared_ptr< rcl_publisher_t > publisher_handle_
 
std::vector< std::shared_ptr< rclcpp::QOSEventHandlerBase > > event_handlers_
 
bool intra_process_is_enabled_
 
IntraProcessManagerWeakPtr weak_ipm_
 
uint64_t intra_process_publisher_id_
 
rmw_gid_t rmw_gid_
 

Detailed Description

template<typename MessageT, typename Alloc = std::allocator<void>>
class rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >

brief child class of rclcpp Publisher class.

Overrides all publisher functions to check for enabled/disabled state.

Member Typedef Documentation

◆ MessageAllocTraits

template<typename MessageT , typename Alloc = std::allocator<void>>
using rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::MessageAllocTraits = rclcpp::allocator::AllocRebind<MessageT, Alloc>

◆ MessageAlloc

template<typename MessageT , typename Alloc = std::allocator<void>>
using rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::MessageAlloc = typename MessageAllocTraits::allocator_type

◆ MessageDeleter

template<typename MessageT , typename Alloc = std::allocator<void>>
using rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::MessageDeleter = rclcpp::allocator::Deleter<MessageAlloc, MessageT>

◆ MessageUniquePtr

template<typename MessageT , typename Alloc = std::allocator<void>>
using rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::MessageUniquePtr = std::unique_ptr<MessageT, MessageDeleter>

Constructor & Destructor Documentation

◆ LifecyclePublisher()

template<typename MessageT , typename Alloc = std::allocator<void>>
rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::LifecyclePublisher ( rclcpp::node_interfaces::NodeBaseInterface node_base,
const std::string topic,
const rclcpp::QoS qos,
const rclcpp::PublisherOptionsWithAllocator< Alloc > &  options 
)
inline

◆ ~LifecyclePublisher()

template<typename MessageT , typename Alloc = std::allocator<void>>
rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::~LifecyclePublisher ( )
inline

Member Function Documentation

◆ publish() [1/2]

template<typename MessageT , typename Alloc = std::allocator<void>>
virtual void rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::publish ( std::unique_ptr< MessageT, MessageDeleter msg)
inlinevirtual

LifecyclePublisher publish function.

The publish function checks whether the communication was enabled or disabled and forwards the message to the actual rclcpp Publisher base class

◆ publish() [2/2]

template<typename MessageT , typename Alloc = std::allocator<void>>
virtual void rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::publish ( const MessageT &  msg)
inlinevirtual

LifecyclePublisher publish function.

The publish function checks whether the communication was enabled or disabled and forwards the message to the actual rclcpp Publisher base class

Reimplemented from rclcpp::Publisher< MessageT, std::allocator< void > >.

◆ on_activate()

template<typename MessageT , typename Alloc = std::allocator<void>>
virtual void rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::on_activate ( )
inlinevirtual

◆ on_deactivate()

template<typename MessageT , typename Alloc = std::allocator<void>>
virtual void rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::on_deactivate ( )
inlinevirtual

◆ is_activated()

template<typename MessageT , typename Alloc = std::allocator<void>>
virtual bool rclcpp_lifecycle::LifecyclePublisher< MessageT, Alloc >::is_activated ( )
inlinevirtual

The documentation for this class was generated from the following file: