microRTPS: agent: simplify Publisher code specialization

This commit is contained in:
TSC21
2020-03-11 15:13:07 +00:00
committed by Nuno Marques
parent 296714a00a
commit e9bc675bfa
2 changed files with 29 additions and 41 deletions
+9 -15
View File
@@ -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);
}