RTI Routing Service  Version 6.0.0
 All Data Structures Files Functions Typedefs Enumerations Enumerator Groups Pages
ProcessorPlugin.hpp
Go to the documentation of this file.
1 /*
2  * (c) Copyright, Real-Time Innovations, 2017.
3  * All rights reserved.
4  *
5  * No duplications, whole or partial, manual or electronic, may be made
6  * without express written permission. Any such copies, or
7  * revisions thereof, must display this notice unaltered.
8  * This code contains trade secrets of Real-Time Innovations, Inc.
9  */
10 
11 #ifndef RTI_ROUTING_PROCESSOR_PROCESSOR_PLUGIN_HPP_
12 #define RTI_ROUTING_PROCESSOR_PROCESSOR_PLUGIN_HPP_
13 
14 #include "routingservice/routingservice_log.h"
15 
16 #include <rti/config/Version.hpp>
17 #include <rti/routing/PropertySet.hpp>
18 #include <rti/routing/processor/Route.hpp>
19 #include <rti/routing/processor/Processor.hpp>
20 
192 namespace rti { namespace routing { namespace processor {
193 
202 public:
203 
231  virtual Processor * create_processor(
232  Route& route,
233  const rti::routing::PropertySet& properties) = 0;
234 
252  virtual void delete_processor(
253  Route& route,
254  Processor *processor) = 0;
255 
265  virtual rti::config::LibraryVersion get_version() const
266  {
267  return rti::config::LibraryVersion();
268  }
269 
273  virtual ~ProcessorPlugin() {}
274 
275 };
276 
277 } } }
278 
279 
280 #include <rti/routing/processor/detail/ProcessorPluginForwarder.hpp>
281 
282 
353 #define RTI_PROCESSOR_PLUGIN_CREATE_FUNCTION_DECL(PROCESSOR_CLASS) \
354 extern "C" RTI_USER_DLL_EXPORT struct RTI_RoutingServiceProcessorPlugin* \
355  PROCESSOR_CLASS ## _create_processor_plugin(\
356  const struct RTI_RoutingServiceProperties *, \
357  RTI_RoutingServiceEnvironment *); \
358 
359 
364 #define RTI_PROCESSOR_PLUGIN_CREATE_FUNCTION_DEF(PROCESSOR_CLASS) \
365 struct RTI_RoutingServiceProcessorPlugin * PROCESSOR_CLASS ## _create_processor_plugin( \
366  const struct RTI_RoutingServiceProperties * native_properties, \
367  RTI_RoutingServiceEnvironment *environment) \
368 { \
369  PropertySet properties; \
370  rti::routing::PropertyAdapter::add_properties_from_native(\
371  properties,\
372  native_properties); \
373  try { \
374  return rti::routing::processor::detail::ProcessorPluginForwarder::create_plugin(\
375  new PROCESSOR_CLASS(properties)); \
376  } catch (const std::exception& ex) {\
377  RTI_RoutingServiceEnvironment_set_error(\
378  environment,\
379  "%s",\
380  ex.what());\
381  } catch (...) {}\
382  \
383  return NULL; \
384 }
385 
386 
387 
388 #endif // RTI_ROUTING_PROCESSOR_PROCESSOR_PLUGIN_HPP_

RTI Routing Service Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc