10#ifndef RTI_CDS_CLOUD_DISCOVERY_SERVICE_IMPL_HPP_
11#define RTI_CDS_CLOUD_DISCOVERY_SERVICE_IMPL_HPP_
13#include <dds/core/refmacros.hpp>
14#include <rti/core/detail/SelfReference.hpp>
15#include <rti/core/Exception.hpp>
16#include "clouddiscoveryservice/clouddiscoveryservice_service.h"
18#include <rti/cds/ServiceProperty.hpp>
20namespace rti {
namespace cds {
22class CloudDiscoveryServiceImpl
23 :
public rti::core::detail::RetainableType<CloudDiscoveryServiceImpl>
26 explicit CloudDiscoveryServiceImpl(
const ServiceProperty& property)
28 native_ = RTI_CDS_Service_new(&property.native());
29 rti::core::check_create_entity(native_,
"CloudDiscoveryService");
32 CloudDiscoveryServiceImpl(
const RTI_CDS_Property& property) : native_(NULL)
34 native_ = RTI_CDS_Service_new(&property);
35 rti::core::check_create_entity(native_,
"CloudDiscoveryService");
38 CloudDiscoveryServiceImpl(RTI_CDS_Service *native) : native_(native)
40 rti::core::check_create_entity(native_,
"CloudDiscoveryService");
43 ~CloudDiscoveryServiceImpl()
45 RTI_CDS_Service_delete(native_);
50 if (!RTI_CDS_Service_start(native_)) {
51 throw dds::core::Error(
"Error starting CloudDiscoveryService");
57 if (!RTI_CDS_Service_stop(native_)) {
58 throw dds::core::Error(
"Error stopping CloudDiscoveryService");
64 return RTI_CDS_Service_is_started(native_);
67 bool update_rtps_psk_secret_passphrase(
68 const std::string rtps_psk_secret_passphrase)
70 return RTI_CDS_Service_update_rtps_psk_secret_passphrase(
72 rtps_psk_secret_passphrase.c_str());
75 RTI_CDS_Service* native()
const
81 RTI_CDS_Service *native_;
Definition: CloudDiscoveryServiceImpl.hpp:20