TransportPlugin.cpp
Go to the documentation of this file.
00001 /* Generated from orogen/lib/orogen/templates/typekit/ros/TransportPlugin.cpp */
00002 
00003 // First load all RTT interfaces so that we get all "extern template"
00004 // declarations in the TypekitImpl files
00005 #include "transports/ros/Registration.hpp"
00006 #include "transports/ros/TransportPlugin.hpp"
00007 #include <rtt/types/TypekitPlugin.hpp>
00008 #include <rtt/transports/ros/RosLib.hpp>
00009 using namespace RTT;
00010 
00011 bool orogen_typekits::<%= typekit.name %>RosTransportPlugin::registerTransport(std::string type_name, RTT::types::TypeInfo* ti)
00012 {
00013     if(ti->hasProtocol(ORO_ROS_PROTOCOL_ID))
00014         return false;
00015 
00016     <% first_type = true;
00017        typesets.interface_types.each do |type|
00018            next if !ros_exported_type?(type)
00019            names = [type.name]
00020            if aliases = typesets.aliases[type]
00021                names.concat(aliases)
00022            end
00023            if_cond = names.map { |n| "\"#{n}\" == type_name" }.join(" || ")
00024         %>
00025     <%= 'else ' unless first_type %>if (<%= if_cond %>)
00026     {
00027         return ti->addProtocol(ORO_ROS_PROTOCOL_ID,
00028             <%= type.method_name %>_ROSTransport());
00029     }
00030     <% first_type = false
00031     end %>
00032     return false;
00033 }
00034 std::string orogen_typekits::<%= typekit.name %>RosTransportPlugin::getTransportName() const
00035 { return "ROS"; }
00036 std::string orogen_typekits::<%= typekit.name %>RosTransportPlugin::getTypekitName() const
00037 { return "/orogen/<%= typekit.name %>"; }
00038 std::string orogen_typekits::<%= typekit.name %>RosTransportPlugin::getName() const
00039 { return "/orogen/<%= typekit.name %>/ROS"; }
00040 
00041 ORO_TYPEKIT_PLUGIN(orogen_typekits::<%= typekit.name %>RosTransportPlugin);
00042 


orogen
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Sat Jun 8 2019 19:52:17