- HandlerMinelayerData: BUILD_RTI Guards für RTI-Abhängigkeiten - svcTabCommon: Export-Header-Fix via Fallback-Target - TrainingAreaBase: Stub-Header für BUILD_RTI=OFF - ddsfts: Include-Pfad und Dependency-Fixes - BUILD_RTI=OFF Compilation vollständig unterstützt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Entire-Checkpoint: 01M0JNZA586SACX1PRZ2DJAE5S
136 lines
4.0 KiB
C++
136 lines
4.0 KiB
C++
/*
|
|
* (c) Copyright, Real-Time Innovations, 2021.
|
|
* All rights reserved.
|
|
*
|
|
* No duplications, whole or partial, manual or electronic, may be made
|
|
* without express written permission. Any such copies, or
|
|
* revisions thereof, must display this notice unaltered.
|
|
* This code contains trade secrets of Real-Time Innovations, Inc.
|
|
*/
|
|
|
|
#ifndef WEBINTEGRATIONSERVICE_H
|
|
#define WEBINTEGRATIONSERVICE_H
|
|
|
|
#include <dds/core/Reference.hpp>
|
|
#include <rti/config/Logger.hpp>
|
|
|
|
#include <rti/webdds/ServiceProperty.hpp>
|
|
#include <rti/webdds/Dll.hpp>
|
|
#include <rti/webdds/detail/WebIntegrationServiceImpl.hpp>
|
|
|
|
namespace rti { namespace webdds {
|
|
|
|
/*e \defgroup RTI_WebIntegrationServiceLibModule RTI Web Integration Library API
|
|
*
|
|
* @brief @product can be deployed as a native library linked into your
|
|
* application in select architectures.
|
|
*
|
|
* This API allows you to create, configure and start @product instances from
|
|
* your application.
|
|
*
|
|
* The following code shows the typical use of the API:
|
|
*
|
|
* \code
|
|
*
|
|
* int main ()
|
|
* {
|
|
* rti::webdds::Service service(
|
|
* rti::webdds::ServiceProperty()
|
|
* .cfg_file("MyWebint.xml")
|
|
* .cfg_name("MyWebint"));
|
|
* ...
|
|
*
|
|
* service.start();
|
|
*
|
|
* while(keep_running) {
|
|
* sleep();
|
|
* ...
|
|
* }
|
|
*
|
|
* return 0;
|
|
* }
|
|
*
|
|
* \endcode
|
|
*
|
|
* Instead of a file, you can use XML strings to configure @product.
|
|
* See ServiceProperty for more information.
|
|
* <p>
|
|
* To build your application you need to link with the @product native library
|
|
* in <b> <@ndds home>/bin/<architecture>/ </b>.
|
|
*
|
|
* ### Development Requirements
|
|
*
|
|
* | | Unix-based Systems | Windows Systems |
|
|
* | --------------: | :----------------: | :-------------: |
|
|
* | Shared Libraries| librtiwebintegrationservice.so | rtiwebintegrationservice.dll|
|
|
* | ^ | libnddscpp.so | nddscpp.dll |
|
|
* | ^ | libnddsc.so | nddsc.dll |
|
|
* | ^ | libnddscore.so | nddscore.dll |
|
|
* | ^ | librtiapputilsc.so | rtiapputilsc.dll |
|
|
* | ^ | librtisqlite.so | rtisqlite.dll |
|
|
* | ^ | libcivetweb-cpp.so.1.15.0 | civetweb-cpp.dll |
|
|
* | ^ | libcivetweb.so.1.15.0 | civetweb.dll |
|
|
* | Headers | rti/webdds/Service.hpp | rti/webdds/Service.hpp |
|
|
*
|
|
*/
|
|
|
|
|
|
/** \ingroup RTI_WebIntegrationServiceLibModule
|
|
*
|
|
* @brief The @product.
|
|
*
|
|
*/
|
|
class Service : public dds::core::Reference<WebIntegrationServiceImpl> {
|
|
public:
|
|
typedef dds::core::Reference<WebIntegrationServiceImpl> Base;
|
|
OMG_DDS_REF_TYPE_NOTYPENAME(
|
|
Service,
|
|
dds::core::Reference,
|
|
WebIntegrationServiceImpl);
|
|
|
|
/**
|
|
* @brief Creates a @product instance
|
|
*
|
|
* @param[in] property
|
|
* The property to configure @product instance.
|
|
*
|
|
*/
|
|
Service(ServiceProperty&& property)
|
|
: Base(new WebIntegrationServiceImpl(std::move(property)))
|
|
{
|
|
this->delegate()->remember_reference(this->delegate());
|
|
}
|
|
|
|
explicit Service(Base::DELEGATE_REF_T reference) : Base(reference)
|
|
{
|
|
if (this->delegate()) {
|
|
this->delegate()->remember_reference(this->delegate());
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @brief Starts @product.
|
|
*
|
|
* This is a non-blocking operation. @product will create its own set of
|
|
* threads to perform its tasks.
|
|
*/
|
|
void start()
|
|
{
|
|
this->delegate()->start();
|
|
}
|
|
|
|
/**
|
|
* @brief Stops @product.
|
|
*
|
|
* This operation will bloc the instance is fully stopped.
|
|
*/
|
|
void stop()
|
|
{
|
|
this->delegate()->stop();
|
|
}
|
|
|
|
};
|
|
|
|
}}
|
|
|
|
#endif // WEBINTEGRATIONSERVICE_H
|