RTI Routing Service  Version 6.0.0
 All Data Structures Files Functions Typedefs Enumerations Enumerator Groups Pages
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 #include <rti/routing/UpdatableEntity.hpp>
16 #include <rti/routing/ServiceProperty.hpp>
17 #include <rti/routing/detail/ForwarderUtils.hpp>
18 
19 namespace rti { namespace routing { namespace detail {
20 
21 
22 class UpdatableEntityForwarder {
23 public:
24 
25  static void update(
26  UpdatableEntity *updatable_entity,
27  const struct RTI_RoutingServiceProperties *native_properties,
28  RTI_RoutingServiceEnvironment *environment)
29  {
30 
31  try {
32  // Set properties
33  PropertySet properties;
34  rti::routing::PropertyAdapter::add_properties_from_native(
35  properties,
36  native_properties);
37  updatable_entity->update(properties);
38  } catch (const std::exception& ex) {
39  RTI_RoutingServiceEnvironment_set_error(
40  environment,
41  "%s",
42  ex.what());
43  } catch (...) {
44  RTI_RoutingServiceEnvironment_set_error(
45  environment,
46  "unexpected exception");
47  return;
48  }
49  }
50 
51 };
52 
53 }}}
54 
55 #endif // RTI_ROUTING_DETAIL_UPDATABLE_ENTITY_FORWARDER_HPP_

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