11#ifndef RTI_ROUTING_PROCESSOR_PLUGIN_DETAIL_PROCESSOR_PLUGIN_FORWARDER_HPP_
12#define RTI_ROUTING_PROCESSOR_PLUGIN_DETAIL_PROCESSOR_PLUGIN_FORWARDER_HPP_
14#include <rti/core/Exception.hpp>
16#include <rti/routing/processor/detail/ProcessorForwarder.hpp>
17#include <rti/routing/detail/ForwarderUtils.hpp>
19namespace rti {
namespace routing {
namespace processor {
namespace detail {
22class ProcessorPluginForwarder {
25 static RTI_RoutingServiceProcessorPlugin * create_plugin(
26 ProcessorPlugin *plugin)
28 RTI_RoutingServiceProcessorPlugin *native_plugin = NULL;
29 RTIOsapiHeap_allocateStructure(
31 struct RTI_RoutingServiceProcessorPlugin);
32 rti::core::check_create_entity(
34 "RTI_RoutingServiceProcessorPlugin");
35 RTI_RoutingServiceProcessorPlugin_initialize(native_plugin);
38 rti::config::LibraryVersion version = plugin->get_version();
39 native_plugin->plugin_version.major = version.major_version();
40 native_plugin->plugin_version.minor = version.minor_version();
41 native_plugin->plugin_version.release = version.release_version();
44 native_plugin->processor_plugin_data =
45 static_cast<void *
>(plugin);
46 native_plugin->plugin_delete =
47 ProcessorPluginForwarder::delete_plugin;
48 native_plugin->create_processor =
49 ProcessorPluginForwarder::forward_create_processor;
50 native_plugin->delete_processor =
51 ProcessorPluginForwarder::forward_delete_processor;
56 static void delete_plugin(
57 RTI_RoutingServiceProcessorPlugin *native_plugin,
58 RTI_RoutingServiceEnvironment *)
60 ProcessorPlugin *plugin =
static_cast<ProcessorPlugin*
>(
61 native_plugin->processor_plugin_data);
64 RTIOsapiHeap_freeStructure(native_plugin);
68 static RTI_RoutingServiceProcessor * forward_create_processor(
69 void *native_plugin_data,
70 RTI_RoutingServiceRoute *native_route,
71 const struct RTI_RoutingServiceProperties *native_properties,
72 RTI_RoutingServiceEnvironment *environment)
74 return ProcessorForwarder::create_native(
75 static_cast<ProcessorPlugin *
>(native_plugin_data),
82 static void forward_delete_processor(
83 void *native_plugin_data,
84 struct RTI_RoutingServiceProcessor *native_processor,
85 RTI_RoutingServiceRoute *,
86 RTI_RoutingServiceEnvironment *environment)
89 ProcessorForwarder::delete_native(
90 static_cast<ProcessorPlugin *
>(native_plugin_data),