RTI Recording Service  Version 6.0.1
 All Data Structures Namespaces Files Functions Typedefs Enumerations Enumerator Groups
ServiceProperty.hpp
1 /*
2  * $Id$
3  *
4  * (c) Copyright, Real-Time Innovations, 2016-.
5  * All rights reserved.
6  * No duplications, whole or partial, manual or electronic, may be made
7  * without express written permission. Any such copies, or
8  * revisions thereof, must display this notice unaltered.
9  * This code contains trade secrets of Real-Time Innovations, Inc.
10  */
11 
12 #ifndef HPP_SERVICE_SERVICEPROPERTY_HPP_
13 #define HPP_SERVICE_SERVICEPROPERTY_HPP_
14 
15 #include "stdio.h"
16 #include "stdlib.h"
17 #include <string>
18 #include <stdint.h>
19 #include <map>
20 
21 #include "osapi/osapi_type.h"
22 
23 #include "routingservice/routingservice_infrastructure.h"
24 #include "routingservice/routingservice_service.h"
25 
26 #include <dds/core/SafeEnumeration.hpp>
27 
28 namespace rti { namespace recording {
29 
40  enum type {
53  /*i
54  * @brief Internal use only
55  */
56  XML_CONVERTER_APPLICATION,
57  /*i
58  */
59  count_
60  };
61 };
62 
63 typedef dds::core::safe_enum<ApplicationRoleKind_def> ApplicationRoleKind;
64 
65 /*i
66  * @brief Internal use only
67  */
68 struct XmlConverterRoleKind_def {
69 
70  enum type {
71  RECORD_CONVERT,
72  REPLAY_CONVERT,
73  count_
74  };
75 };
76 
77 typedef dds::core::safe_enum<XmlConverterRoleKind_def> XmlConverterRoleKind;
78 
85 public:
90  cfg_file_(""),
91  service_name_(""),
92  application_name_(""),
93  domain_id_base_(0),
94  enable_administration_(false),
95  administration_domain_id_(0),
96  enable_monitoring_(false),
97  monitoring_domain_id_(0),
98  application_role_(ApplicationRoleKind::RECORD_APPLICATION),
99  enforce_xsd_validation_(true),
100  ignore_default_files_(false),
101  output_cfg_file_(""),
102  converter_role_(XmlConverterRoleKind::RECORD_CONVERT)
103 
104  {
105 
106  }
107 
111  const std::string& cfg_file() const
112  {
113  return cfg_file_;
114  }
115 
121  ServiceProperty& cfg_file(const std::string & cfg_file)
122  {
123  cfg_file_ = cfg_file;
124 
125  return *this;
126  }
127 
131  const std::string & service_name() const
132  {
133  return service_name_;
134  }
135 
147  {
148  service_name_ = service_name;
149 
150  return *this;
151  }
152 
156  const std::string & application_name() const
157  {
158  return application_name_;
159  }
160 
176  {
177  application_name_ = application_name;
178 
179  return *this;
180  }
181 
182 
186  int32_t domain_id_base() const
187  {
188  return domain_id_base_;
189  }
190 
195  {
196  return enforce_xsd_validation_;
197  }
198 
206  {
207  enforce_xsd_validation_ = enforce;
208 
209  return *this;
210  }
211 
220  ServiceProperty& domain_id_base(int32_t domain_id)
221  {
222  domain_id_base_ = domain_id;
223 
224  return *this;
225  }
226 
231  {
232  return enable_administration_;
233  }
234 
242  {
243  enable_administration_ = enable_administration;
244 
245  return *this;
246  }
247 
251  int32_t administration_domain_id() const
252  {
253  return administration_domain_id_;
254  }
255 
267  {
268  administration_domain_id_ = domain_id;
269 
270  return *this;
271  }
272 
276  bool enable_monitoring() const
277  {
278  return enable_monitoring_;
279  }
280 
288  {
289  enable_monitoring_ = enable_monitoring;
290  return *this;
291  }
292 
296  int32_t monitoring_domain_id() const
297  {
298  return monitoring_domain_id_;
299  }
300 
312  {
313  monitoring_domain_id_ = domain_id;
314  return *this;
315  }
316 
320  const ApplicationRoleKind& application_role() const
321  {
322  return application_role_;
323  }
324 
331  {
332  application_role_ = application_role;
333  return *this;
334  }
335 
339  bool ignore_default_files() const
340  {
341  return ignore_default_files_;
342  }
343 
354  {
355  ignore_default_files_ = ignore;
356  return *this;
357  }
358 
362  const std::string& license_file() const
363  {
364  return license_file_;
365  }
366 
374  {
375  license_file_ = license_file;
376  return *this;
377  }
378 
379  /*i
380  * @brief Internal use only
381  */
382  const std::string output_cfg_file() const
383  {
384  return output_cfg_file_;
385  }
386 
387  /*i
388  * @brief Internal use only
389  */
390  ServiceProperty& output_cfg_file(
391  const std::string & output_cfg_file)
392  {
393  output_cfg_file_ = output_cfg_file;
394  return *this;
395  }
396 
397  /*i
398  * @brief Internal use only
399  */
400  XmlConverterRoleKind converter_role() const
401  {
402  return converter_role_;
403  }
404 
405  /*i
406  * @brief Internal use only
407  */
408  ServiceProperty& converter_role(
409  const XmlConverterRoleKind & converter_role)
410  {
411  converter_role_ = converter_role;
412  return *this;
413  }
414 
418  const std::map<std::string, std::string>& user_environment() const
419  {
420  return user_env_;
421  }
422 
427  std::map<std::string, std::string>& user_environment()
428  {
429  return user_env_;
430  }
431 
441  const std::map<std::string, std::string>& user_environment)
442  {
443  user_env_ = user_environment;
444 
445  return *this;
446  }
447 
448 private:
449  std::string cfg_file_;
450  //std::string cfg_strings[] ?
451  std::string service_name_;
452  std::string application_name_;
453  int32_t domain_id_base_;
454  bool enable_administration_;
455  int32_t administration_domain_id_;
456  bool enable_monitoring_;
457  int32_t monitoring_domain_id_;
458  ApplicationRoleKind application_role_;
459  bool enforce_xsd_validation_;
460  bool ignore_default_files_;
461  std::string license_file_;
462  // Specific to XML conversion
463  std::string output_cfg_file_;
464  XmlConverterRoleKind converter_role_;
465  std::map<std::string, std::string> user_env_;
466 };
467 
468 
469 }
470 } /* namespace rti::recording */
471 
472 #endif /* HPP_SERVICE_SERVICEPROPERTY_HPP_ */

RTI Recording Service Version 6.0.1 Copyright © Sun Nov 17 2019 Real-Time Innovations, Inc