RTI Routing Service Version 7.3.0
TransformationPlugin.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_TRANSF_TRANSFORMATION_PLUGIN_HPP_
12#define RTI_ROUTING_TRANSF_TRANSFORMATION_PLUGIN_HPP_
13
14#include "routingservice/routingservice_log.h"
15
16#include <rti/config/Version.hpp>
17#include <rti/routing/TypeInfo.hpp>
18#include <rti/routing/PropertySet.hpp>
19#include <rti/routing/transf/Transformation.hpp>
20#include <rti/routing/detail/ForwarderUtils.hpp>
21
22/*e \file
23 @brief RTI Routing Service Transformation API
24*/
34namespace rti { namespace routing { namespace transf {
35
45public:
46
73 const rti::routing::TypeInfo& input_type_info,
74 const rti::routing::TypeInfo& output_type_info,
75 const rti::routing::PropertySet& properties) = 0;
76
89 virtual void delete_transformation(Transformation *transformation) = 0;
90
100 virtual rti::config::LibraryVersion get_version() const
101 {
102 return rti::config::LibraryVersion();
103 }
104
109};
110
111}}}
112
113#include <rti/routing/transf/detail/TransformationPluginForwarder.hpp>
114
184#define RTI_TRANSFORMATION_PLUGIN_CREATE_FUNCTION_DECL(TRANSFORMATION_PLUGIN_CLASS) \
185extern "C" RTI_USER_DLL_EXPORT struct RTI_RoutingServiceTransformationPlugin * \
186 TRANSFORMATION_PLUGIN_CLASS ## _create_transformation_plugin(\
187 const struct RTI_RoutingServiceProperties *, \
188 RTI_RoutingServiceEnvironment *); \
189
195#define RTI_TRANSFORMATION_PLUGIN_CREATE_FUNCTION_DEF(TRANSFORMATION_PLUGIN_CLASS) \
196struct RTI_RoutingServiceTransformationPlugin * \
197 TRANSFORMATION_PLUGIN_CLASS ## _create_transformation_plugin( \
198 const struct RTI_RoutingServiceProperties * native_properties, \
199 RTI_RoutingServiceEnvironment *environment) \
200{ \
201 rti::routing::PropertySet properties; \
202 rti::routing::PropertyAdapter::add_properties_from_native(\
203 properties,\
204 native_properties); \
205 try { \
206 return rti::routing::transf::detail::TransformationPluginForwarder::create_plugin(\
207 new TRANSFORMATION_PLUGIN_CLASS(properties)); \
208 } catch (const std::exception& ex) {\
209 RTI_RoutingServiceEnvironment_set_error(\
210 environment,\
211 "%s",\
212 ex.what());\
213 } catch (...) {}\
214 \
215 return NULL; \
216}
217
218
219
220
221#endif // RTI_ROUTING_TRANSF_TRANSFORMATION_PLUGIN_HPP_
Definition of the type information associated with a RTI Routing Service stream.
Definition: TypeInfo.hpp:169
The top-level plug-in class.
Definition: TransformationPlugin.hpp:44
virtual rti::config::LibraryVersion get_version() const
Definition: TransformationPlugin.hpp:100
virtual ~TransformationPlugin()
Virtual destructor.
Definition: TransformationPlugin.hpp:108
virtual void delete_transformation(Transformation *transformation)=0
Deletes a Transformation.
virtual Transformation * create_transformation(const rti::routing::TypeInfo &input_type_info, const rti::routing::TypeInfo &output_type_info, const rti::routing::PropertySet &properties)=0
Creates an Output Transformation.
Provides a way to transform input samples into output samples of a different format and/or content.
Definition: Transformation.hpp:35
std::map< std::string, std::string > PropertySet
The definition of a pluggable entity’s configuration properties.
Definition: PropertySet.hpp:60