RTI Web Integration Service Version 7.5.0
Service.hpp
1/*
2 * (c) Copyright, Real-Time Innovations, 2021.
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 WEBINTEGRATIONSERVICE_H
12#define WEBINTEGRATIONSERVICE_H
13
14#include <dds/core/Reference.hpp>
15#include <rti/config/Logger.hpp>
16
17#include <rti/webdds/ServiceProperty.hpp>
18#include <rti/webdds/Dll.hpp>
19#include <rti/webdds/detail/WebIntegrationServiceImpl.hpp>
20
21namespace rti { namespace webdds {
22
23/*e \defgroup RTI_WebIntegrationServiceLibModule RTI Web Integration Library API
24 *
25 * @brief @product can be deployed as a native library linked into your
26 * application in select architectures.
27 *
28 * This API allows you to create, configure and start @product instances from
29 * your application.
30 *
31 * The following code shows the typical use of the API:
32 *
33 * \code
34 *
35 * int main ()
36 * {
37 * rti::webdds::Service service(
38 * rti::webdds::ServiceProperty()
39 * .cfg_file("MyWebint.xml")
40 * .cfg_name("MyWebint"));
41 * ...
42 *
43 * service.start();
44 *
45 * while(keep_running) {
46 * sleep();
47 * ...
48 * }
49 *
50 * return 0;
51 * }
52 *
53 * \endcode
54 *
55 * Instead of a file, you can use XML strings to configure @product.
56 * See ServiceProperty for more information.
57 * <p>
58 * To build your application you need to link with the @product native library
59 * in <b> &lt;@ndds home&gt;/bin/&lt;architecture&gt;/ </b>.
60 *
61 * ### Development Requirements
62 *
63 * | | Unix-based Systems | Windows Systems |
64 * | --------------: | :----------------: | :-------------: |
65 * | Shared Libraries| librtiwebintegrationservice.so | rtiwebintegrationservice.dll|
66 * | ^ | libnddscpp.so | nddscpp.dll |
67 * | ^ | libnddsc.so | nddsc.dll |
68 * | ^ | libnddscore.so | nddscore.dll |
69 * | ^ | librtiapputilsc.so | rtiapputilsc.dll |
70 * | ^ | librtisqlite.so | rtisqlite.dll |
71 * | ^ | libcivetweb-cpp.so.1.15.0 | civetweb-cpp.dll |
72 * | ^ | libcivetweb.so.1.15.0 | civetweb.dll |
73 * | Headers | rti/webdds/Service.hpp | rti/webdds/Service.hpp |
74 *
75 */
76
77
83class Service : public dds::core::Reference<WebIntegrationServiceImpl> {
84public:
85 typedef dds::core::Reference<WebIntegrationServiceImpl> Base;
86 OMG_DDS_REF_TYPE_NOTYPENAME(
87 Service,
88 dds::core::Reference,
89 WebIntegrationServiceImpl);
90
99 : Base(new WebIntegrationServiceImpl(std::move(property)))
100 {
101 this->delegate()->remember_reference(this->delegate());
102 }
103
104 explicit Service(Base::DELEGATE_REF_T reference) : Base(reference)
105 {
106 if (this->delegate()) {
107 this->delegate()->remember_reference(this->delegate());
108 }
109 }
110
117 void start()
118 {
119 this->delegate()->start();
120 }
121
127 void stop()
128 {
129 this->delegate()->stop();
130 }
131
132};
133
134}}
135
136#endif // WEBINTEGRATIONSERVICE_H
Configuration properties for a RTI Web Integration Service object.
Definition: ServiceProperty.hpp:33
The RTI Web Integration Service.
Definition: Service.hpp:83
void start()
Starts RTI Web Integration Service.
Definition: Service.hpp:117
void stop()
Stops RTI Web Integration Service.
Definition: Service.hpp:127
Service(ServiceProperty &&property)
Creates a RTI Web Integration Service instance.
Definition: Service.hpp:98