RTI Routing Service Version 7.7.0
UpdatableEntityForwarder.hpp
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_DETAIL_UPDATABLE_ENTITY_FORWARDER_HPP_
12#define RTI_ROUTING_DETAIL_UPDATABLE_ENTITY_FORWARDER_HPP_
13
14#include <rti/core/Exception.hpp>
15
16#include <rti/apputils/ServiceException.hpp>
17
18#include <rti/routing/UpdatableEntity.hpp>
19#include <rti/routing/ServiceProperty.hpp>
20#include <rti/routing/detail/ForwarderUtils.hpp>
21
22namespace rti { namespace routing { namespace detail {
23
24
25class UpdatableEntityForwarder {
26public:
27
28 static void update(
29 UpdatableEntity *updatable_entity,
30 const struct RTI_RoutingServiceProperties *native_properties,
31 RTI_RoutingServiceEnvironment *environment)
32 {
33
34 try {
35 // Set properties
36 PropertySet properties;
37 rti::routing::PropertyAdapter::add_properties_from_native(
38 properties,
39 native_properties);
40 updatable_entity->update(properties);
41 } catch (const rti::apputils::FatalServiceException& ex) {
42 RTI_RoutingServiceEnvironment_fatal_error(
43 environment,
44 ex.what());
45 } catch (const std::exception& ex) {
46 RTI_RoutingServiceEnvironment_set_error(
47 environment,
48 ex.what());
49 } catch (...) {
50 RTI_RoutingServiceEnvironment_set_error(
51 environment,
52 "unexpected exception");
53 return;
54 }
55 }
56
57};
58
59}}}
60
61#endif // RTI_ROUTING_DETAIL_UPDATABLE_ENTITY_FORWARDER_HPP_
std::map< std::string, std::string > PropertySet
The definition of a pluggable entity’s configuration properties.
Definition: PropertySet.hpp:60