init
This commit is contained in:
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef CYCLONEDDS_PUB_ANYDATAWRITERDELEGATE_HPP_
|
||||
#define CYCLONEDDS_PUB_ANYDATAWRITERDELEGATE_HPP_
|
||||
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/core/Time.hpp>
|
||||
#include <dds/core/InstanceHandle.hpp>
|
||||
#include <dds/core/status/Status.hpp>
|
||||
#include <dds/pub/qos/DataWriterQos.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/TopicTraits.hpp>
|
||||
#include <org/eclipse/cyclonedds/core/EntityDelegate.hpp>
|
||||
#include <dds/topic/TopicDescription.hpp>
|
||||
#include <dds/topic/BuiltinTopic.hpp>
|
||||
|
||||
#include <org/eclipse/cyclonedds/topic/CDRBlob.hpp>
|
||||
|
||||
namespace dds { namespace pub {
|
||||
template <typename DELEGATE>
|
||||
class TAnyDataWriter;
|
||||
} }
|
||||
|
||||
|
||||
namespace org
|
||||
{
|
||||
namespace eclipse
|
||||
{
|
||||
namespace cyclonedds
|
||||
{
|
||||
namespace pub
|
||||
{
|
||||
|
||||
class OMG_DDS_API AnyDataWriterDelegate : public org::eclipse::cyclonedds::core::EntityDelegate
|
||||
{
|
||||
public:
|
||||
typedef ::dds::core::smart_ptr_traits< AnyDataWriterDelegate >::ref_type ref_type;
|
||||
typedef ::dds::core::smart_ptr_traits< AnyDataWriterDelegate >::weak_ref_type weak_ref_type;
|
||||
|
||||
virtual ~AnyDataWriterDelegate();
|
||||
|
||||
void close();
|
||||
|
||||
public:
|
||||
/* DDS API mirror. */
|
||||
dds::pub::qos::DataWriterQos qos() const;
|
||||
void qos(const dds::pub::qos::DataWriterQos& qos);
|
||||
|
||||
/* Let DataWriter<T> implement the publisher handling to circumvent circular dependencies. */
|
||||
virtual const dds::pub::TPublisher<org::eclipse::cyclonedds::pub::PublisherDelegate>& publisher() const = 0;
|
||||
|
||||
const dds::topic::TopicDescription& topic_description() const;
|
||||
|
||||
void wait_for_acknowledgments(const dds::core::Duration& timeout);
|
||||
|
||||
const ::dds::core::status::LivelinessLostStatus liveliness_lost_status();
|
||||
|
||||
const ::dds::core::status::OfferedDeadlineMissedStatus offered_deadline_missed_status();
|
||||
|
||||
const ::dds::core::status::OfferedIncompatibleQosStatus offered_incompatible_qos_status();
|
||||
|
||||
const ::dds::core::status::PublicationMatchedStatus publication_matched_status();
|
||||
|
||||
::dds::core::InstanceHandleSeq
|
||||
matched_subscriptions();
|
||||
|
||||
template <typename FwdIterator>
|
||||
uint32_t
|
||||
matched_subscriptions(FwdIterator begin, uint32_t max_size)
|
||||
{
|
||||
::dds::core::InstanceHandleSeq handleSeq = matched_subscriptions();
|
||||
uint32_t seq_size = static_cast<uint32_t>(handleSeq.size());
|
||||
uint32_t size = (seq_size < max_size ? seq_size : max_size);
|
||||
for (uint32_t i = 0; i < size; i++, begin++) {
|
||||
*begin = handleSeq[i];
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
const dds::topic::SubscriptionBuiltinTopicData
|
||||
matched_subscription_data(const ::dds::core::InstanceHandle& h);
|
||||
|
||||
void assert_liveliness();
|
||||
|
||||
public:
|
||||
dds::pub::TAnyDataWriter<AnyDataWriterDelegate> wrapper_to_any();
|
||||
void write_flush();
|
||||
void set_batch(bool);
|
||||
|
||||
private:
|
||||
void
|
||||
write_cdr(dds_entity_t writer,
|
||||
const org::eclipse::cyclonedds::topic::CDRBlob *data,
|
||||
const dds::core::InstanceHandle& handle,
|
||||
const dds::core::Time& timestamp,
|
||||
uint32_t statusinfo);
|
||||
|
||||
protected:
|
||||
AnyDataWriterDelegate(const dds::pub::qos::DataWriterQos& qos,
|
||||
const dds::topic::TopicDescription& td);
|
||||
|
||||
void
|
||||
write_cdr(dds_entity_t writer,
|
||||
const org::eclipse::cyclonedds::topic::CDRBlob *data,
|
||||
const dds::core::InstanceHandle& handle,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
void
|
||||
dispose_cdr(dds_entity_t writer,
|
||||
const org::eclipse::cyclonedds::topic::CDRBlob *data,
|
||||
const dds::core::InstanceHandle& handle,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
void
|
||||
unregister_instance_cdr(dds_entity_t writer,
|
||||
const org::eclipse::cyclonedds::topic::CDRBlob *data,
|
||||
const dds::core::InstanceHandle& handle,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
bool
|
||||
is_loan_supported(const dds_entity_t writer);
|
||||
|
||||
void
|
||||
loan_sample(dds_entity_t writer,
|
||||
void **sample);
|
||||
|
||||
void
|
||||
return_loan(dds_entity_t writer,
|
||||
void *sample);
|
||||
|
||||
void
|
||||
write(dds_entity_t writer,
|
||||
const void *data,
|
||||
const dds::core::InstanceHandle& handle,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
void
|
||||
writedispose(dds_entity_t writer,
|
||||
const void *data,
|
||||
const dds::core::InstanceHandle& handle,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
dds_instance_handle_t
|
||||
register_instance(dds_entity_t writer,
|
||||
const void *data,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
void
|
||||
unregister_instance(dds_entity_t writer,
|
||||
const dds::core::InstanceHandle& handle,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
void
|
||||
unregister_instance(dds_entity_t writer,
|
||||
const void *data,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
void
|
||||
dispose_instance(dds_entity_t writer,
|
||||
const dds::core::InstanceHandle& handle,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
void
|
||||
dispose_instance(dds_entity_t writer,
|
||||
const void *data,
|
||||
const dds::core::Time& timestamp);
|
||||
|
||||
void
|
||||
get_key_value(dds_entity_t writer,
|
||||
void *data,
|
||||
const dds::core::InstanceHandle& handle);
|
||||
|
||||
dds_instance_handle_t
|
||||
lookup_instance(dds_entity_t writer,
|
||||
const void *data);
|
||||
|
||||
private:
|
||||
dds::pub::qos::DataWriterQos qos_;
|
||||
dds::topic::TopicDescription td_;
|
||||
|
||||
//@todo static bool copy_data(c_type t, void *data, void *to);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CYCLONEDDS_PUB_ANYDATAWRITERDELEGATE_HPP_ */
|
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef CYCLONEDDS_PUB_COHERENT_SET_DELEGATE_HPP_
|
||||
#define CYCLONEDDS_PUB_COHERENT_SET_DELEGATE_HPP_
|
||||
|
||||
#include <dds/pub/Publisher.hpp>
|
||||
|
||||
|
||||
namespace org
|
||||
{
|
||||
namespace eclipse
|
||||
{
|
||||
namespace cyclonedds
|
||||
{
|
||||
namespace pub
|
||||
{
|
||||
|
||||
|
||||
class OMG_DDS_API CoherentSetDelegate
|
||||
{
|
||||
public:
|
||||
CoherentSetDelegate(const dds::pub::Publisher& pub);
|
||||
~CoherentSetDelegate();
|
||||
|
||||
void end();
|
||||
|
||||
bool operator ==(const CoherentSetDelegate& other) const;
|
||||
|
||||
private:
|
||||
dds::pub::Publisher pub;
|
||||
bool ended;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CYCLONEDDS_PUB_COHERENT_SET_DELEGATE_HPP_ */
|
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef OMG_IDDS_PUB_PUBLISHER_DELEGATE_HPP_
|
||||
#define OMG_IDDS_PUB_PUBLISHER_DELEGATE_HPP_
|
||||
|
||||
#include <dds/core/types.hpp>
|
||||
#include <dds/core/Duration.hpp>
|
||||
#include <dds/core/status/State.hpp>
|
||||
#include <dds/pub/qos/PublisherQos.hpp>
|
||||
#include <dds/pub/qos/DataWriterQos.hpp>
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
|
||||
#include <org/eclipse/cyclonedds/ForwardDeclarations.hpp>
|
||||
#include <org/eclipse/cyclonedds/core/EntityDelegate.hpp>
|
||||
#include <org/eclipse/cyclonedds/core/EntitySet.hpp>
|
||||
#include <org/eclipse/cyclonedds/pub/AnyDataWriterDelegate.hpp>
|
||||
|
||||
|
||||
namespace org
|
||||
{
|
||||
namespace eclipse
|
||||
{
|
||||
namespace cyclonedds
|
||||
{
|
||||
namespace pub
|
||||
{
|
||||
|
||||
class OMG_DDS_API PublisherDelegate : public org::eclipse::cyclonedds::core::EntityDelegate
|
||||
{
|
||||
public:
|
||||
typedef ::dds::core::smart_ptr_traits< PublisherDelegate >::ref_type ref_type;
|
||||
typedef ::dds::core::smart_ptr_traits< PublisherDelegate >::weak_ref_type weak_ref_type;
|
||||
|
||||
PublisherDelegate(const dds::domain::DomainParticipant& dp,
|
||||
const dds::pub::qos::PublisherQos& qos,
|
||||
dds::pub::PublisherListener* listener,
|
||||
const dds::core::status::StatusMask& event_mask);
|
||||
|
||||
virtual ~PublisherDelegate();
|
||||
|
||||
void init(ObjectDelegate::weak_ref_type weak_ref);
|
||||
|
||||
void close();
|
||||
|
||||
const dds::pub::qos::PublisherQos& qos() const;
|
||||
void qos(const dds::pub::qos::PublisherQos& pqos);
|
||||
|
||||
void default_datawriter_qos(const dds::pub::qos::DataWriterQos& dwqos);
|
||||
dds::pub::qos::DataWriterQos default_datawriter_qos() const;
|
||||
|
||||
void suspend_publications();
|
||||
void resume_publications();
|
||||
|
||||
void begin_coherent_changes();
|
||||
void end_coherent_changes();
|
||||
|
||||
void wait_for_acknowledgments(const dds::core::Duration& max_wait);
|
||||
|
||||
void listener(dds::pub::PublisherListener* listener,
|
||||
const ::dds::core::status::StatusMask& mask);
|
||||
dds::pub::PublisherListener* listener() const;
|
||||
|
||||
const dds::domain::DomainParticipant& participant() const;
|
||||
|
||||
bool contains_entity(const ::dds::core::InstanceHandle& handle);
|
||||
|
||||
void add_datawriter(org::eclipse::cyclonedds::core::EntityDelegate& datawriter);
|
||||
void remove_datawriter(org::eclipse::cyclonedds::core::EntityDelegate& datawriter);
|
||||
org::eclipse::cyclonedds::pub::AnyDataWriterDelegate::ref_type find_datawriter(const std::string& topic_name);
|
||||
|
||||
dds::pub::TPublisher<PublisherDelegate>
|
||||
wrapper();
|
||||
|
||||
bool is_auto_enable() const;
|
||||
|
||||
void on_offered_deadline_missed(dds_entity_t writer,
|
||||
org::eclipse::cyclonedds::core::OfferedDeadlineMissedStatusDelegate &sd);
|
||||
|
||||
void on_offered_incompatible_qos(dds_entity_t writer,
|
||||
org::eclipse::cyclonedds::core::OfferedIncompatibleQosStatusDelegate &sd);
|
||||
|
||||
void on_liveliness_lost(dds_entity_t writer,
|
||||
org::eclipse::cyclonedds::core::LivelinessLostStatusDelegate &sd);
|
||||
|
||||
void on_publication_matched(dds_entity_t writer,
|
||||
org::eclipse::cyclonedds::core::PublicationMatchedStatusDelegate &sd);
|
||||
|
||||
private:
|
||||
dds::domain::DomainParticipant dp_;
|
||||
dds::pub::qos::PublisherQos qos_;
|
||||
dds::pub::qos::DataWriterQos default_dwqos_;
|
||||
|
||||
org::eclipse::cyclonedds::core::EntitySet writers;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* OMG_IDDS_PUB_PUBLISHER_DELEGATE_HPP_ */
|
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef CYCLONEDDS_PUB_SUSPENDED_PUBBLICATIONS_DELEGATE_HPP_
|
||||
#define CYCLONEDDS_PUB_SUSPENDED_PUBBLICATIONS_DELEGATE_HPP_
|
||||
|
||||
#include <dds/pub/Publisher.hpp>
|
||||
|
||||
|
||||
namespace org
|
||||
{
|
||||
namespace eclipse
|
||||
{
|
||||
namespace cyclonedds
|
||||
{
|
||||
namespace pub
|
||||
{
|
||||
|
||||
|
||||
//class OMG_DDS_API SuspendedPublicationDelegate
|
||||
class SuspendedPublicationDelegate
|
||||
{
|
||||
public:
|
||||
SuspendedPublicationDelegate(const dds::pub::Publisher& pub);
|
||||
~SuspendedPublicationDelegate();
|
||||
|
||||
void resume();
|
||||
|
||||
bool operator ==(const SuspendedPublicationDelegate& other) const;
|
||||
|
||||
private:
|
||||
dds::pub::Publisher pub;
|
||||
bool resumed;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CYCLONEDDS_PUB_SUSPENDED_PUBBLICATIONS_DELEGATE_HPP_ */
|
@@ -0,0 +1,305 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2021 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef CYCLONEDDS_PUB_QOS_DATA_WRITER_QOS_DELEGATE_HPP_
|
||||
#define CYCLONEDDS_PUB_QOS_DATA_WRITER_QOS_DELEGATE_HPP_
|
||||
|
||||
#include <dds/core/detail/conformance.hpp>
|
||||
#include <org/eclipse/cyclonedds/topic/qos/TopicQosDelegate.hpp>
|
||||
|
||||
struct _DDS_NamedDataWriterQos;
|
||||
|
||||
namespace org
|
||||
{
|
||||
namespace eclipse
|
||||
{
|
||||
namespace cyclonedds
|
||||
{
|
||||
namespace pub
|
||||
{
|
||||
namespace qos
|
||||
{
|
||||
|
||||
class OMG_DDS_API DataWriterQosDelegate
|
||||
{
|
||||
public:
|
||||
DataWriterQosDelegate();
|
||||
DataWriterQosDelegate(const org::eclipse::cyclonedds::topic::qos::TopicQosDelegate& tqos);
|
||||
|
||||
void policy(const dds::core::policy::UserData& user_data);
|
||||
void policy(const dds::core::policy::Durability& durability);
|
||||
void policy(const dds::core::policy::Deadline& deadline);
|
||||
void policy(const dds::core::policy::LatencyBudget& budget);
|
||||
void policy(const dds::core::policy::Liveliness& liveliness);
|
||||
void policy(const dds::core::policy::Reliability& reliability);
|
||||
void policy(const dds::core::policy::DestinationOrder& order);
|
||||
void policy(const dds::core::policy::History& history);
|
||||
void policy(const dds::core::policy::ResourceLimits& resources);
|
||||
void policy(const dds::core::policy::TransportPriority& priority);
|
||||
void policy(const dds::core::policy::Lifespan& lifespan);
|
||||
void policy(const dds::core::policy::Ownership& ownership);
|
||||
#ifdef OMG_DDS_OWNERSHIP_SUPPORT
|
||||
void policy(const dds::core::policy::OwnershipStrength& strength);
|
||||
#endif // OMG_DDS_OWNERSHIP_SUPPORT
|
||||
void policy(const dds::core::policy::WriterDataLifecycle& lifecycle);
|
||||
#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
|
||||
void policy(const dds::core::policy::DataRepresentation& datarepresentation);
|
||||
void policy(const dds::core::policy::TypeConsistencyEnforcement& typeconsistencyenforcement);
|
||||
#endif // OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
|
||||
|
||||
template <typename POLICY> const POLICY& policy() const;
|
||||
template <typename POLICY> POLICY& policy();
|
||||
|
||||
/* The returned ddsc QoS has to be freed. */
|
||||
dds_qos_t* ddsc_qos() const;
|
||||
void ddsc_qos(const dds_qos_t* qos);
|
||||
|
||||
void named_qos(const struct _DDS_NamedDataWriterQos &qos);
|
||||
|
||||
void check() const;
|
||||
|
||||
bool operator ==(const DataWriterQosDelegate& other) const;
|
||||
DataWriterQosDelegate& operator =(const org::eclipse::cyclonedds::topic::qos::TopicQosDelegate& tqos);
|
||||
|
||||
private:
|
||||
dds::core::policy::UserData user_data_;
|
||||
dds::core::policy::Durability durability_;
|
||||
dds::core::policy::Deadline deadline_;
|
||||
dds::core::policy::LatencyBudget budget_;
|
||||
dds::core::policy::Liveliness liveliness_;
|
||||
dds::core::policy::Reliability reliability_;
|
||||
dds::core::policy::DestinationOrder order_;
|
||||
dds::core::policy::History history_;
|
||||
dds::core::policy::ResourceLimits resources_;
|
||||
dds::core::policy::TransportPriority priority_;
|
||||
dds::core::policy::Lifespan lifespan_;
|
||||
dds::core::policy::Ownership ownership_;
|
||||
#ifdef OMG_DDS_OWNERSHIP_SUPPORT
|
||||
dds::core::policy::OwnershipStrength strength_;
|
||||
#endif // OMG_DDS_OWNERSHIP_SUPPORT
|
||||
dds::core::policy::WriterDataLifecycle lifecycle_;
|
||||
#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
|
||||
dds::core::policy::DataRepresentation datarepresentation_;
|
||||
dds::core::policy::TypeConsistencyEnforcement typeconsistencyenforcement_;
|
||||
#endif // OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::UserData&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::UserData>() const
|
||||
{
|
||||
return user_data_;
|
||||
}
|
||||
template<> inline dds::core::policy::UserData&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::UserData>()
|
||||
{
|
||||
return user_data_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::Durability&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Durability>() const
|
||||
{
|
||||
return durability_;
|
||||
}
|
||||
template<> inline dds::core::policy::Durability&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Durability>()
|
||||
{
|
||||
return durability_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::Deadline&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Deadline>() const
|
||||
{
|
||||
return deadline_;
|
||||
}
|
||||
template<> inline dds::core::policy::Deadline&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Deadline>()
|
||||
{
|
||||
return deadline_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::LatencyBudget&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::LatencyBudget>() const
|
||||
{
|
||||
return budget_;
|
||||
}
|
||||
template<> inline dds::core::policy::LatencyBudget&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::LatencyBudget>()
|
||||
{
|
||||
return budget_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::Liveliness&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Liveliness>() const
|
||||
{
|
||||
return liveliness_;
|
||||
}
|
||||
template<> inline dds::core::policy::Liveliness&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Liveliness>()
|
||||
{
|
||||
return liveliness_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::Reliability&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Reliability>() const
|
||||
{
|
||||
return reliability_;
|
||||
}
|
||||
template<> inline dds::core::policy::Reliability&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Reliability>()
|
||||
{
|
||||
return reliability_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::DestinationOrder&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::DestinationOrder>() const
|
||||
{
|
||||
return order_;
|
||||
}
|
||||
template<> inline dds::core::policy::DestinationOrder&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::DestinationOrder>()
|
||||
{
|
||||
return order_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::History&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::History>() const
|
||||
{
|
||||
return history_;
|
||||
}
|
||||
template<> inline dds::core::policy::History&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::History>()
|
||||
{
|
||||
return history_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::ResourceLimits&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::ResourceLimits>() const
|
||||
{
|
||||
return resources_;
|
||||
}
|
||||
template<> inline dds::core::policy::ResourceLimits&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::ResourceLimits>()
|
||||
{
|
||||
return resources_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::TransportPriority&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::TransportPriority>() const
|
||||
{
|
||||
return priority_;
|
||||
}
|
||||
template<> inline dds::core::policy::TransportPriority&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::TransportPriority>()
|
||||
{
|
||||
return priority_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::Lifespan&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Lifespan>() const
|
||||
{
|
||||
return lifespan_;
|
||||
}
|
||||
template<> inline dds::core::policy::Lifespan&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Lifespan>()
|
||||
{
|
||||
return lifespan_;
|
||||
}
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::Ownership&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Ownership>() const
|
||||
{
|
||||
return ownership_;
|
||||
}
|
||||
template<> inline dds::core::policy::Ownership&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::Ownership>()
|
||||
{
|
||||
return ownership_;
|
||||
}
|
||||
|
||||
|
||||
#ifdef OMG_DDS_OWNERSHIP_SUPPORT
|
||||
template<> inline const dds::core::policy::OwnershipStrength&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::OwnershipStrength>() const
|
||||
{
|
||||
return strength_;
|
||||
}
|
||||
template<> inline dds::core::policy::OwnershipStrength&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::OwnershipStrength>()
|
||||
{
|
||||
return strength_;
|
||||
}
|
||||
#endif // OMG_DDS_OWNERSHIP_SUPPORT
|
||||
|
||||
|
||||
template<> inline const dds::core::policy::WriterDataLifecycle&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::WriterDataLifecycle>() const
|
||||
{
|
||||
return lifecycle_;
|
||||
}
|
||||
template<> inline dds::core::policy::WriterDataLifecycle&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::WriterDataLifecycle>()
|
||||
{
|
||||
return lifecycle_;
|
||||
}
|
||||
|
||||
#ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
|
||||
template<> inline const dds::core::policy::DataRepresentation&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::DataRepresentation>() const
|
||||
{
|
||||
return datarepresentation_;
|
||||
}
|
||||
template<> inline dds::core::policy::DataRepresentation&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::DataRepresentation>()
|
||||
{
|
||||
return datarepresentation_;
|
||||
}
|
||||
|
||||
template<> inline const dds::core::policy::TypeConsistencyEnforcement&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::TypeConsistencyEnforcement>() const
|
||||
{
|
||||
return typeconsistencyenforcement_;
|
||||
}
|
||||
template<> inline dds::core::policy::TypeConsistencyEnforcement&
|
||||
DataWriterQosDelegate::policy<dds::core::policy::TypeConsistencyEnforcement>()
|
||||
{
|
||||
return typeconsistencyenforcement_;
|
||||
}
|
||||
#endif // OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CYCLONEDDS_PUB_QOS_DATA_WRITER_QOS_DELEGATE_HPP_ */
|
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Copyright(c) 2006 to 2020 ZettaScale Technology and others
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License v. 2.0 which is available at
|
||||
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
|
||||
* v. 1.0 which is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
*/
|
||||
|
||||
#ifndef CYCLONEDDS_PUB_QOS_PUBLISHER_QOS_DELEGATE_HPP_
|
||||
#define CYCLONEDDS_PUB_QOS_PUBLISHER_QOS_DELEGATE_HPP_
|
||||
|
||||
#include <dds/core/policy/CorePolicy.hpp>
|
||||
|
||||
struct _DDS_NamedPublisherQos;
|
||||
|
||||
namespace org
|
||||
{
|
||||
namespace eclipse
|
||||
{
|
||||
namespace cyclonedds
|
||||
{
|
||||
namespace pub
|
||||
{
|
||||
namespace qos
|
||||
{
|
||||
|
||||
class OMG_DDS_API PublisherQosDelegate
|
||||
{
|
||||
public:
|
||||
PublisherQosDelegate();
|
||||
PublisherQosDelegate(const PublisherQosDelegate& other);
|
||||
|
||||
~PublisherQosDelegate();
|
||||
|
||||
void policy(const dds::core::policy::Presentation& presentation);
|
||||
void policy(const dds::core::policy::Partition& partition);
|
||||
void policy(const dds::core::policy::GroupData& gdata);
|
||||
void policy(const dds::core::policy::EntityFactory& factory_policy);
|
||||
|
||||
template <typename POLICY> const POLICY& policy() const;
|
||||
template <typename POLICY> POLICY& policy();
|
||||
|
||||
/* The returned ddsc QoS has to be freed. */
|
||||
dds_qos_t* ddsc_qos() const;
|
||||
void ddsc_qos(const dds_qos_t* qos);
|
||||
|
||||
void named_qos(const struct _DDS_NamedPublisherQos &qos);
|
||||
|
||||
void check() const;
|
||||
|
||||
bool operator ==(const PublisherQosDelegate& other) const;
|
||||
PublisherQosDelegate& operator =(const PublisherQosDelegate& other);
|
||||
|
||||
private:
|
||||
dds::core::policy::Presentation presentation_;
|
||||
dds::core::policy::Partition partition_;
|
||||
dds::core::policy::GroupData gdata_;
|
||||
dds::core::policy::EntityFactory factory_policy_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
||||
|
||||
template<>
|
||||
inline const dds::core::policy::Presentation&
|
||||
PublisherQosDelegate::policy<dds::core::policy::Presentation>() const
|
||||
{
|
||||
return presentation_;
|
||||
}
|
||||
template<>
|
||||
inline dds::core::policy::Presentation&
|
||||
PublisherQosDelegate::policy<dds::core::policy::Presentation>()
|
||||
{
|
||||
return presentation_;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
inline const dds::core::policy::Partition&
|
||||
PublisherQosDelegate::policy<dds::core::policy::Partition>() const
|
||||
{
|
||||
return partition_;
|
||||
}
|
||||
template<>
|
||||
inline dds::core::policy::Partition&
|
||||
PublisherQosDelegate::policy<dds::core::policy::Partition>()
|
||||
{
|
||||
return partition_;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
inline const dds::core::policy::GroupData&
|
||||
PublisherQosDelegate::policy<dds::core::policy::GroupData>() const
|
||||
{
|
||||
return gdata_;
|
||||
}
|
||||
template<>
|
||||
inline dds::core::policy::GroupData&
|
||||
PublisherQosDelegate::policy<dds::core::policy::GroupData>()
|
||||
{
|
||||
return gdata_;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
inline const dds::core::policy::EntityFactory&
|
||||
PublisherQosDelegate::policy<dds::core::policy::EntityFactory>() const
|
||||
{
|
||||
return factory_policy_;
|
||||
}
|
||||
template<>
|
||||
inline dds::core::policy::EntityFactory&
|
||||
PublisherQosDelegate::policy<dds::core::policy::EntityFactory>()
|
||||
{
|
||||
return factory_policy_;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CYCLONEDDS_PUB_QOS_PUBLISHER_QOS_DELEGATE_HPP_ */
|
Reference in New Issue
Block a user