11 #ifndef RTI_ROUTING_ROUTING_SERVICE_PROPERTY_HPP_ 12 #define RTI_ROUTING_ROUTING_SERVICE_PROPERTY_HPP_ 16 #include <dds/core/macros.hpp> 17 #include <rti/core/NativeValueType.hpp> 19 #include "routingservice/routingservice_service.h" 20 #include <rti/routing/detail/ForwarderUtils.hpp> 22 namespace rti {
namespace routing {
24 class PropertyAdapter {
26 typedef RTI_RoutingServiceProperty native_type;
28 static void initialize(native_type& native_value)
30 static const native_type DEFAULT
31 = RTI_RoutingServiceProperty_INITIALIZER;
32 native_value = DEFAULT;
33 native_value.service_verbosity = -1;
34 native_value.dds_verbosity = -1;
37 static void finalize(native_type& native_value)
39 if (native_value.cfg_strings != NULL) {
40 RTIOsapiHeap_freeArray(native_value.cfg_strings);
41 native_value.cfg_strings = NULL;
44 RTI_RoutingServiceProperty_finalize(&native_value);
47 static void copy(native_type& destination,
const native_type& source)
49 RTIOsapiUtility_unusedParameter(destination);
50 RTIOsapiUtility_unusedParameter(source);
52 throw dds::core::UnsupportedError(
"Unsupported operation: copy");
55 static bool equals(
const native_type& first,
const native_type& second)
57 RTIOsapiUtility_unusedParameter(first);
58 RTIOsapiUtility_unusedParameter(second);
60 throw dds::core::UnsupportedError(
"Unsupported operation: equals");
63 static void add_properties_from_native(
64 std::map<std::string, std::string>& properties,
65 const RTI_RoutingServiceProperties *native_properties)
67 for (
int i = 0; i < native_properties->count; i++) {
68 properties[native_properties->properties[i].name] =
69 (
const char *) native_properties->properties[i].value;
73 static void add_properties_to_native(
74 RTI_RoutingServiceProperties *native_properties,
75 const std::map<std::string, std::string>& properties)
77 RTI_RoutingServiceProperties_finalize(native_properties);
78 RTI_RoutingServiceProperties_initialize(native_properties);
80 std::map<std::string, std::string>::const_iterator it = properties.begin();
81 for (; it != properties.end(); ++it) {
82 if (!RTI_RoutingServiceProperties_add(
85 it->second.c_str())) {
86 throw dds::core::Error(
"failed to add native property");
93 class ServiceProperty;
100 struct native_type_traits<
rti::routing::ServiceProperty> {
101 typedef rti::routing::PropertyAdapter adapter_type;
102 typedef RTI_RoutingServiceProperty native_type;
118 typedef rti::core::NativeValueType<ServiceProperty> Base;
127 ServiceProperty(
const struct RTI_RoutingServiceProperty &native_property)
128 : Base(native_property)
138 return native().cfg_file == NULL ?
"" : native().cfg_file;
177 const std::vector<std::string>& the_cfg_strings)
179 cfg_strings_ = the_cfg_strings;
180 if (cfg_strings_.size() > 0) {
181 if (!RTIOsapiHeap_reallocateArray(
182 (
char ***) &native().cfg_strings,
185 throw dds::core::OutOfResourcesError(
"cfg_strings native array");
187 for (uint32_t i = 0; i < cfg_strings_.size(); i++) {
188 native().cfg_strings[i] = cfg_strings_[i].c_str();
191 native().cfg_strings_count =
static_cast<int>(cfg_strings_.size());
201 return native().service_name == NULL ?
"" : native().service_name;
217 &native().service_name,
227 return native().application_name;
247 &native().application_name,
257 return (native().enforce_xsd_validation == DDS_BOOLEAN_TRUE)
279 return native().domain_id_base;
301 return native().plugin_search_path == NULL
303 : native().plugin_search_path;
318 &native().plugin_search_path,
328 return (native().dont_start_service == DDS_BOOLEAN_TRUE)
354 return (native().enable_administration == DDS_BOOLEAN_TRUE)
378 return native().administration_domain_id;
402 return native().enable_monitoring == DDS_BOOLEAN_TRUE
426 return native().monitoring_domain_id;
450 return (native().skip_default_files == DDS_BOOLEAN_TRUE)
478 return (native().identify_execution == DDS_BOOLEAN_TRUE)
504 return native().license_file_name == NULL?
"" 505 : native().license_file_name;
520 &native().license_file_name,
530 std::map<std::string, std::string> properties;
532 PropertyAdapter::add_properties_from_native(
534 &native().user_environment);
548 const std::map<std::string, std::string>& user_environment)
550 rti::routing::PropertyAdapter::add_properties_to_native(
551 &native().user_environment,
558 std::vector<std::string> cfg_strings_;
563 #endif // RTI_ROUTING_ROUTING_SERVICE_PROPERTY_HPP_ ServiceProperty & license_file_name(const std::string &filename)
Path to an RTI Routing Service license file.
Definition: ServiceProperty.hpp:517
ServiceProperty & service_name(const std::string &name)
The name of the RTI Routing Service configuration to run.
Definition: ServiceProperty.hpp:214
std::string application_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:225
std::string service_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:199
ServiceProperty & administration_domain_id(const int domain_id)
If ServiceProperty::enable_administration is true, this is the domain ID to use for remote administra...
Definition: ServiceProperty.hpp:391
bool enable_monitoring() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:400
const std::vector< std::string > & cfg_strings() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:157
bool enforce_xsd_validation() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:255
ServiceProperty & identify_execution(const bool &identify)
Set this to true to append the host name and process ID to the RTI Routing Service execution name...
Definition: ServiceProperty.hpp:491
ServiceProperty & enable_administration(const bool enable)
Set this to true to enable remote administration or false to disable it.
Definition: ServiceProperty.hpp:365
ServiceProperty & application_name(const std::string &name)
Assigns a name to the execution of the RTI Routing Service.
Definition: ServiceProperty.hpp:244
ServiceProperty & enable_monitoring(const bool &enable)
Set it to true to enable remote monitoring or false to disable it.
Definition: ServiceProperty.hpp:413
ServiceProperty & monitoring_domain_id(const int &domain_id)
If ServiceProperty::enable_monitoring is true, this is the domain ID to use for remote monitoring...
Definition: ServiceProperty.hpp:439
ServiceProperty & user_environment(const std::map< std::string, std::string > &user_environment)
Dictionary of user variables. The dictionary provides a parallel way to expand XML configuration vari...
Definition: ServiceProperty.hpp:547
std::string cfg_file() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:136
ServiceProperty & skip_default_files(const bool &skip)
Set it to true to avoid loading the standard files usually loaded by RTI Routing Service.
Definition: ServiceProperty.hpp:464
std::map< std::string, std::string > user_environment() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:528
std::string plugin_search_path() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:299
Configuration for a RTI Routing Service object.
Definition: ServiceProperty.hpp:114
int monitoring_domain_id() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:424
int administration_domain_id() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:376
ServiceProperty & cfg_strings(const std::vector< std::string > &the_cfg_strings)
XML configuration represented as strings.
Definition: ServiceProperty.hpp:176
ServiceProperty & domain_id_base(const int domain_id)
Value that is added to the domain IDs of the domain routes in the XML configuration.
Definition: ServiceProperty.hpp:290
Definition: AdapterPlugin.hpp:25
bool identify_execution() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:476
bool enable_administration() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:352
ServiceProperty & cfg_file(const std::string &filename)
Path to an RTI Routing Service configuration file.
Definition: ServiceProperty.hpp:146
std::string license_file_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:502
ServiceProperty & enforce_xsd_validation(const bool enforce_xsd_validation)
Controls whether the service applies XSD validation to the loaded configuration.
Definition: ServiceProperty.hpp:268
bool skip_default_files() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:448
bool dont_start_service() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:326
int domain_id_base() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:277
ServiceProperty()
Creates a property object with default settings.
Definition: ServiceProperty.hpp:123
ServiceProperty & dont_start_service(const bool not_start)
Set this to true to if you do not want RTI Routing Service enabled when RoutingServcie::start is call...
Definition: ServiceProperty.hpp:341
ServiceProperty & plugin_search_path(const std::string &path)
This path is used to look for plugin libraries.
Definition: ServiceProperty.hpp:315