mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 03:33:35 +08:00
microRTPS: agent: simplify Publisher code specialization
This commit is contained in:
@@ -76,9 +76,15 @@ except AttributeError:
|
||||
#include "@(topic)_Publisher.h"
|
||||
|
||||
|
||||
@(topic)_Publisher::@(topic)_Publisher() : mp_participant(nullptr), mp_publisher(nullptr) {}
|
||||
@(topic)_Publisher::@(topic)_Publisher()
|
||||
: mp_participant(nullptr),
|
||||
mp_publisher(nullptr)
|
||||
{ }
|
||||
|
||||
@(topic)_Publisher::~@(topic)_Publisher() { Domain::removeParticipant(mp_participant);}
|
||||
@(topic)_Publisher::~@(topic)_Publisher()
|
||||
{
|
||||
Domain::removeParticipant(mp_participant);
|
||||
}
|
||||
|
||||
bool @(topic)_Publisher::init()
|
||||
{
|
||||
@@ -149,19 +155,7 @@ void @(topic)_Publisher::PubListener::onPublicationMatched(Publisher* pub, Match
|
||||
}
|
||||
}
|
||||
|
||||
@[if fastrtps_version <= 1.7]@
|
||||
@[ if ros2_distro]@
|
||||
void @(topic)_Publisher::publish(@(package)::msg::dds_::@(topic)_* st)
|
||||
@[ else]@
|
||||
void @(topic)_Publisher::publish(@(topic)_* st)
|
||||
@[ end if]@
|
||||
@[else]@
|
||||
@[ if ros2_distro]@
|
||||
void @(topic)_Publisher::publish(@(package)::msg::@(topic)* st)
|
||||
@[ else]@
|
||||
void @(topic)_Publisher::publish(@(topic)* st)
|
||||
@[ end if]@
|
||||
@[end if]@
|
||||
void @(topic)_Publisher::publish(@(topic)_msg_t* st)
|
||||
{
|
||||
mp_publisher->write(st);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user