RTI Routing Service Version 7.3.0
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
193namespace rti { namespace routing { namespace processor {
194
203public:
204
233 Route& route,
234 const rti::routing::PropertySet& properties) = 0;
235
253 virtual void delete_processor(
254 Route& route,
255 Processor *processor) = 0;
256
266 virtual rti::config::LibraryVersion get_version() const
267 {
268 return rti::config::LibraryVersion();
269 }
270
274 virtual ~ProcessorPlugin() {}
275
276};
277
278} } }
279
280
281#include <rti/routing/processor/detail/ProcessorPluginForwarder.hpp>
282
283
354#define RTI_PROCESSOR_PLUGIN_CREATE_FUNCTION_DECL(PROCESSOR_CLASS) \
355extern "C" RTI_USER_DLL_EXPORT struct RTI_RoutingServiceProcessorPlugin* \
356 PROCESSOR_CLASS ## _create_processor_plugin(\
357 const struct RTI_RoutingServiceProperties *, \
358 RTI_RoutingServiceEnvironment *); \
359
365#define RTI_PROCESSOR_PLUGIN_CREATE_FUNCTION_DEF(PROCESSOR_CLASS) \
366struct RTI_RoutingServiceProcessorPlugin * PROCESSOR_CLASS ## _create_processor_plugin( \
367 const struct RTI_RoutingServiceProperties * native_properties, \
368 RTI_RoutingServiceEnvironment *environment) \
369{ \
370 PropertySet properties; \
371 rti::routing::PropertyAdapter::add_properties_from_native(\
372 properties,\
373 native_properties); \
374 try { \
375 return rti::routing::processor::detail::ProcessorPluginForwarder::create_plugin(\
376 new PROCESSOR_CLASS(properties)); \
377 } catch (const std::exception& ex) {\
378 RTI_RoutingServiceEnvironment_set_error(\
379 environment,\
380 "%s",\
381 ex.what());\
382 } catch (...) {}\
383 \
384 return NULL; \
385}
386
387
388
389#endif // RTI_ROUTING_PROCESSOR_PROCESSOR_PLUGIN_HPP_
The top-level plug-in class.
Definition: ProcessorPlugin.hpp:202
virtual Processor * create_processor(Route &route, const rti::routing::PropertySet &properties)=0
Creates a Route Processor.
virtual ~ProcessorPlugin()
Virtual destructor.
Definition: ProcessorPlugin.hpp:274
virtual rti::config::LibraryVersion get_version() const
Definition: ProcessorPlugin.hpp:266
virtual void delete_processor(Route &route, Processor *processor)=0
Deletes a Route Processor.
Processor interface definition. Provides a way to process Route events and control the data forwardin...
Definition: Processor.hpp:54
Representation of the Route object that owns a Processor.
Definition: Route.hpp:84
std::map< std::string, std::string > PropertySet
The definition of a pluggable entity’s configuration properties.
Definition: PropertySet.hpp:60