/* * 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 */ #ifndef CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_ #define CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_ /** * @file */ // Implementation #include #include #include #include #include #include #include #include #include #include #include #include namespace dds { namespace topic { template class TopicListener; } } namespace dds { namespace topic { namespace detail { template class Topic; } } } /*************************************************************************** * * dds/topic/detail/Topic<> DELEGATE declaration. * Implementation can be found in dds/topic/detail/TTopicImpl.hpp * ***************************************************************************/ template class dds::topic::detail::Topic : public org::eclipse::cyclonedds::topic::AnyTopicDelegate { public: typedef typename ::dds::core::smart_ptr_traits< Topic >::ref_type ref_type; typedef typename ::dds::core::smart_ptr_traits< Topic >::weak_ref_type weak_ref_type; Topic(const dds::domain::DomainParticipant& dp, const std::string& name, const std::string& type_name, const dds::topic::qos::TopicQos& qos, dds::topic::TopicListener* listener, const dds::core::status::StatusMask& mask); Topic(const dds::domain::DomainParticipant& dp, const std::string& name, const std::string& type_name, const dds::topic::qos::TopicQos& qos, dds_entity_t ddsc_topic); virtual ~Topic(); virtual void close(); void init(ObjectDelegate::weak_ref_type weak_ref); dds::topic::Topic wrapper(); public: void listener(dds::topic::TopicListener* listener, const ::dds::core::status::StatusMask& mask); dds::topic::TopicListener* listener(); virtual void listener_notify(ObjectDelegate::ref_type source, uint32_t triggerMask, void *eventData, void *listener); dds::topic::TTopicDescription clone(); static dds::topic::Topic discover_topic(const dds::domain::DomainParticipant& dp, const std::string& name, const dds::core::Duration& timeout); static void discover_topics(const dds::domain::DomainParticipant& dp, std::vector >& topics, uint32_t max_size); //using ::org::eclipse::cyclonedds::topic::AnyTopicDelegate::on_inconsistent_topic; void on_inconsistent_topic( dds_entity_t topic, org::eclipse::cyclonedds::core::InconsistentTopicStatusDelegate &s ) ; // !!! private: T sample_; }; // End of implementation #endif /* CYCLONEDDS_DDS_TOPIC_DETAIL_TOPIC_HPP_ */