RTI Recording Service  Version 6.0.1
 All Data Structures Namespaces Files Functions Typedefs Enumerations Enumerator Groups
RecordingService.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_RECORDING_RECORDING_SERVICE_HPP_
12 #define RTI_RECORDING_RECORDING_SERVICE_HPP_
13 
14 #include <dds/core/Reference.hpp>
15 #include <rti/config/Logger.hpp>
16 
17 #include <rti/recording/ServiceProperty.hpp>
18 #include <rti/recording/detail/RecordingServiceImpl.hpp>
19 
20 namespace rti { namespace recording {
21 
22 /*e \defgroup RTI_RecordingServiceLibModule RTI Recording Service API
23  *
24  * @brief @product can be deployed as a native library linked into your
25  * application in select architectures.
26  *
27  * This API allows you to create, configure and start @product instances from
28  * your application.
29  *
30  * The following code shows the typical use of the API:
31  *
32  * \code
33  *
34  * int main ()
35  * {
36  * rti::recording::RecordingService service(
37  * rti::recording::ServiceProperty()
38  * .cfg_file("MyRecorder.xml")
39  * .cfg_name("MyRecorder"));
40  * ...
41  *
42  * service.start();
43  *
44  * while(keep_running) {
45  * sleep();
46  * ...
47  * }
48  *
49  * return 0;
50  * }
51  *
52  * \endcode
53  *
54  * Instead of a file, you can use XML strings to configure @product.
55  * See ServiceProperty for more information.
56  * <p>
57  * To build your application you need to link with the @product native library
58  * in <b> &lt;@ndds home&gt;/bin/&lt;architecture&gt;/ </b>.
59  *
60  * ### Development Requirements
61  *
62  * | | Unix-based Systems | Windows Systems |
63  * | --------------: | :----------------: | :-------------: |
64  * | Shared Libraries| libnddscpp2.so | nddscpp2.dll |
65  * | Shared Libraries| librtiroutingservice.so | rtiroutingservice.dll |
66  * | ^ | librtirsinfrastructure.so | rtirsinfrastructure.dll |
67  * | ^ | librtidlc.so | rtidlc.dll |
68  * | ^ | libnddsmetp.so | nddsmetp.dll |
69  * | ^ | libnddsc.so | nddsc.dll |
70  * | ^ | librtixml2.so | rtixml2.dll |
71  * | ^ | libnddscore.so | nddscore.dll |
72  * | Headers | rti/routing/RoutingService.hpp ||
73  *
74  */
75 
81 class RecordingService : public dds::core::Reference<RecordingServiceImpl> {
82 public:
83  typedef dds::core::Reference<RecordingServiceImpl> Base;
84  OMG_DDS_REF_TYPE_NOTYPENAME(
86  dds::core::Reference,
87  RecordingServiceImpl);
88 
97  : Base(new RecordingServiceImpl(property))
98  {
99  this->delegate()->remember_reference(this->delegate());
100  }
101 
102  explicit RecordingService(Base::DELEGATE_REF_T reference) : Base(reference)
103  {
104  if (this->delegate()) {
105  this->delegate()->remember_reference(this->delegate());
106  }
107  }
108 
115  void start()
116  {
117  this->delegate()->start();
118  }
119 
125  void stop()
126  {
127  this->delegate()->stop();
128  }
129 
130 
147  static void finalize_globals()
148  {
149  RecordingServiceImpl::finalize_globals();
150  }
151 };
152 
161 class RECORDERDllExport Logger
162 {
163 public:
164 
165  typedef rti::config::Verbosity Verbosity;
166  typedef rti::config::LogCategory LogCategory;
167  typedef rti::config::LoggerMode LoggerMode;
168  typedef rti::config::PrintFormat PrintFormat;
169 
170  static Logger& instance();
171 
179  void verbosity(rti::config::Verbosity verbosity);
180 
186  rti::config::Verbosity verbosity();
187 
188  virtual ~Logger();
189 
190 private:
191 
192  Logger();
193 
194  // Disable copy
195  Logger(const Logger&);
196  Logger& operator=(const Logger&);
197 };
198 
199 }}
200 
201 #endif // RTI_RECORDING_RECORDING_SERVICE_HPP_

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