RTI Recording Service  Version 6.1.2
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 #include <rti/recording/PropertySet.hpp>
28 
29 namespace rti { namespace recording {
30 
41  enum type {
54  /*i
55  * @brief Internal use only
56  */
57  XML_CONVERTER_APPLICATION,
58  /*i
59  * @brief Indexer mode. To be used internally by our command-line tool.
60  */
61  INDEX_APPLICATION,
62  /*i
63  */
64  count_
65  };
66 };
67 
68 typedef dds::core::safe_enum<ApplicationRoleKind_def> ApplicationRoleKind;
69 
70 /*i
71  * @brief Internal use only
72  */
73 struct XmlConverterRoleKind_def {
74 
75  enum type {
76  RECORD_CONVERT,
77  REPLAY_CONVERT,
78  count_
79  };
80 };
81 
82 typedef dds::core::safe_enum<XmlConverterRoleKind_def> XmlConverterRoleKind;
83 
84 /*i
85  * @brief Indexer mode enumeration, used by the index application (offline
86  * indexing)
87  */
88 struct IndexerModeKind_def {
89 
90  enum type {
91  INSTANCE_INDEXING,
92  SQLITE_INDEXING,
93  count_
94  };
95 };
96 typedef dds::core::safe_enum<IndexerModeKind_def> IndexerModeKind;
97 
98 typedef rti::routing::PropertySet PropertySet;
99 
106 public:
111  cfg_file_(""),
112  service_name_(""),
113  application_name_(""),
114  domain_id_base_(0),
115  enable_administration_(false),
116  administration_domain_id_(0),
117  enable_monitoring_(false),
118  monitoring_domain_id_(0),
119  application_role_(ApplicationRoleKind::RECORD_APPLICATION),
120  enforce_xsd_validation_(true),
121  ignore_default_files_(false),
122  output_cfg_file_(""),
123  debug_mode_(false),
124  reverse_mode_(false),
125  xml_converter_role_(XmlConverterRoleKind::RECORD_CONVERT),
126  indexer_mode_(IndexerModeKind::INSTANCE_INDEXING)
127 
128  {
129 
130  }
131 
135  const std::string& cfg_file() const
136  {
137  return cfg_file_;
138  }
139 
145  ServiceProperty& cfg_file(const std::string & cfg_file)
146  {
147  cfg_file_ = cfg_file;
148 
149  return *this;
150  }
151 
155  const std::string & service_name() const
156  {
157  return service_name_;
158  }
159 
170  ServiceProperty& service_name(const std::string & service_name)
171  {
172  service_name_ = service_name;
173 
174  return *this;
175  }
176 
180  const std::string & application_name() const
181  {
182  return application_name_;
183  }
184 
199  ServiceProperty& application_name(const std::string & application_name)
200  {
201  application_name_ = application_name;
202 
203  return *this;
204  }
205 
206 
210  int32_t domain_id_base() const
211  {
212  return domain_id_base_;
213  }
214 
219  {
220  return enforce_xsd_validation_;
221  }
222 
230  {
231  enforce_xsd_validation_ = enforce;
232 
233  return *this;
234  }
235 
244  ServiceProperty& domain_id_base(int32_t domain_id)
245  {
246  domain_id_base_ = domain_id;
247 
248  return *this;
249  }
250 
255  {
256  return enable_administration_;
257  }
258 
265  ServiceProperty& enable_administration(bool enable_administration)
266  {
267  enable_administration_ = enable_administration;
268 
269  return *this;
270  }
271 
275  int32_t administration_domain_id() const
276  {
277  return administration_domain_id_;
278  }
279 
291  {
292  administration_domain_id_ = domain_id;
293 
294  return *this;
295  }
296 
300  bool enable_monitoring() const
301  {
302  return enable_monitoring_;
303  }
304 
311  ServiceProperty& enable_monitoring(bool enable_monitoring)
312  {
313  enable_monitoring_ = enable_monitoring;
314  return *this;
315  }
316 
320  int32_t monitoring_domain_id() const
321  {
322  return monitoring_domain_id_;
323  }
324 
336  {
337  monitoring_domain_id_ = domain_id;
338  return *this;
339  }
340 
344  const ApplicationRoleKind& application_role() const
345  {
346  return application_role_;
347  }
348 
354  ServiceProperty& application_role(ApplicationRoleKind application_role)
355  {
356  application_role_ = application_role;
357  return *this;
358  }
359 
363  bool ignore_default_files() const
364  {
365  return ignore_default_files_;
366  }
367 
378  {
379  ignore_default_files_ = ignore;
380  return *this;
381  }
382 
386  const std::string& license_file() const
387  {
388  return license_file_;
389  }
390 
397  ServiceProperty& license_file(const std::string& license_file)
398  {
399  license_file_ = license_file;
400  return *this;
401  }
402 
403  /*i
404  * @brief Internal use only
405  */
406  const std::string output_cfg_file() const
407  {
408  return output_cfg_file_;
409  }
410 
411  /*i
412  * @brief Internal use only
413  */
414  ServiceProperty& output_cfg_file(
415  const std::string & output_cfg_file)
416  {
417  output_cfg_file_ = output_cfg_file;
418  return *this;
419  }
420 
424  bool debug_mode() const
425  {
426  return debug_mode_;
427  }
428 
435  ServiceProperty& debug_mode(bool debug_mode)
436  {
437  debug_mode_ = debug_mode;
438 
439  return *this;
440  }
441 
445  bool reverse_mode() const
446  {
447  return reverse_mode_;
448  }
449 
456  ServiceProperty& reverse_mode(bool reverse_mode)
457  {
458  reverse_mode_ = reverse_mode;
459 
460  return *this;
461  }
462 
463  /*i
464  * @brief Internal use only
465  */
466  XmlConverterRoleKind xml_converter_role() const
467  {
468  return xml_converter_role_;
469  }
470 
471  /*i
472  * @brief Internal use only
473  */
474  ServiceProperty& xml_converter_role(
475  const XmlConverterRoleKind & xml_converter_role)
476  {
477  xml_converter_role_ = xml_converter_role;
478  return *this;
479  }
480 
481  /*i
482  * @brief The indexer application mode. Defined by the IndexerModeKind.
483  * Internal use only
484  */
485  IndexerModeKind indexer_mode() const
486  {
487  return indexer_mode_;
488  }
489 
490  /*i
491  * @brief Set the indexer application mode. Defined by the IndexerModeKind.
492  * Internal use only
493  */
494  ServiceProperty& indexer_mode(const IndexerModeKind& indexer_mode)
495  {
496  indexer_mode_ = indexer_mode;
497  return *this;
498  }
499 
500  /*i
501  * @brief The indexer database directory.
502  * Internal use only
503  */
504  const std::string& db_directory() const
505  {
506  return db_directory_;
507  }
508 
509  /*i
510  * @brief Set the indexer database directory.
511  * Internal use only
512  */
513  ServiceProperty& db_directory(const std::string& db_directory)
514  {
515  db_directory_ = db_directory;
516  return *this;
517  }
518 
522  const PropertySet& user_environment() const
523  {
524  return user_env_;
525  }
526 
531  PropertySet& user_environment()
532  {
533  return user_env_;
534  }
535 
544  ServiceProperty& user_environment(const PropertySet& user_environment)
545  {
546  user_env_ = user_environment;
547 
548  return *this;
549  }
550 
551 private:
552  std::string cfg_file_;
553  //std::string cfg_strings[] ?
554  std::string service_name_;
555  std::string application_name_;
556  int32_t domain_id_base_;
557  bool enable_administration_;
558  int32_t administration_domain_id_;
559  bool enable_monitoring_;
560  int32_t monitoring_domain_id_;
561  ApplicationRoleKind application_role_;
562  bool enforce_xsd_validation_;
563  bool ignore_default_files_;
564  std::string license_file_;
565  // Specific to XML conversion
566  std::string output_cfg_file_;
567  bool debug_mode_;
568  bool reverse_mode_;
569  XmlConverterRoleKind xml_converter_role_;
570  IndexerModeKind indexer_mode_;
571  std::string db_directory_;
572  PropertySet user_env_;
573 };
574 
575 
576 } } /* namespace rti::recording */
577 
578 #endif /* HPP_SERVICE_SERVICEPROPERTY_HPP_ */
const ApplicationRoleKind & application_role() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:344
int32_t administration_domain_id() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:275
PropertySet & user_environment()
Non-const getter for modification that can be used to add elements individually. (see setter with the...
Definition: ServiceProperty.hpp:531
ServiceProperty & enforce_xsd_validation(bool enforce)
Controls whether the service applies XSD validation to the loaded configuration.
Definition: ServiceProperty.hpp:229
int32_t monitoring_domain_id() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:320
ServiceProperty & enable_administration(bool enable_administration)
Set this to true to enable remote administration or false to disable it.
Definition: ServiceProperty.hpp:265
const PropertySet & user_environment() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:522
ServiceProperty & debug_mode(bool debug_mode)
Set this to true to enable debug mode or false to disable it.
Definition: ServiceProperty.hpp:435
Converter mode.
Definition: ServiceProperty.hpp:53
int32_t domain_id_base() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:210
bool reverse_mode() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:445
ServiceProperty & ignore_default_files(bool ignore)
Set it to true to avoid loading the standard files usually loaded by RTI Recording Service...
Definition: ServiceProperty.hpp:377
ServiceProperty & application_name(const std::string &application_name)
Assigns a name to the execution of the RTI Recording Service.
Definition: ServiceProperty.hpp:199
type
The underlying enum type.
Definition: ServiceProperty.hpp:41
ServiceProperty & monitoring_domain_id(int32_t domain_id)
If ServiceProperty::enable_monitoring is true, this is the domain ID to use for remote monitoring...
Definition: ServiceProperty.hpp:335
Configuration for a RTI Recording Service object.
Definition: ServiceProperty.hpp:105
const std::string & application_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:180
ServiceProperty & user_environment(const PropertySet &user_environment)
Dictionary of user variables. The dictionary provides a parallel way to expand XML configuration vari...
Definition: ServiceProperty.hpp:544
bool ignore_default_files() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:363
const std::string & service_name() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:155
ServiceProperty & administration_domain_id(int32_t domain_id)
If ServiceProperty::enable_administration is true, this is the domain ID to use for remote administra...
Definition: ServiceProperty.hpp:290
Record mode.
Definition: ServiceProperty.hpp:45
Replay mode.
Definition: ServiceProperty.hpp:49
Definition: ServiceProperty.hpp:37
ServiceProperty & license_file(const std::string &license_file)
Path to an RTI Connext license file. This field is only used by license-managed versions of the tool...
Definition: ServiceProperty.hpp:397
const std::string & license_file() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:386
bool enable_monitoring() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:300
The RTI namespace.
Definition: RecordingServiceImpl.hpp:22
ServiceProperty & enable_monitoring(bool enable_monitoring)
Set it to true to enable remote monitoring or false to disable it.
Definition: ServiceProperty.hpp:311
const std::string & cfg_file() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:135
ServiceProperty & cfg_file(const std::string &cfg_file)
Path to an RTI Recording Service configuration file.
Definition: ServiceProperty.hpp:145
ServiceProperty()
Creates a property object with default settings.
Definition: ServiceProperty.hpp:110
bool enforce_xsd_validation() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:218
bool enable_administration() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:254
ServiceProperty & service_name(const std::string &service_name)
The name of the RTI Recording Service configuration to run.
Definition: ServiceProperty.hpp:170
ServiceProperty & domain_id_base(int32_t domain_id)
Value that is added to the domain IDs of the domain routes in the XML configuration.
Definition: ServiceProperty.hpp:244
ServiceProperty & application_role(ApplicationRoleKind application_role)
Selects the operation mode of the service.
Definition: ServiceProperty.hpp:354
ServiceProperty & reverse_mode(bool reverse_mode)
Set this to true to enable reverse mode or false to disable it.
Definition: ServiceProperty.hpp:456
bool debug_mode() const
Getter (see setter with the same name)
Definition: ServiceProperty.hpp:424