OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
Topic.hpp
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2021 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #ifndef OSPL_DDS_TOPIC_DETAIL_TOPIC_HPP_
22 #define OSPL_DDS_TOPIC_DETAIL_TOPIC_HPP_
23 
28 // Implementation
29 
30 #include <dds/core/ref_traits.hpp>
36 #include <dds/topic/AnyTopic.hpp>
37 
38 #include <org/opensplice/core/config.hpp>
39 #include <org/opensplice/topic/TopicTraits.hpp>
40 #include <org/opensplice/topic/AnyTopicDelegate.hpp>
41 #include <org/opensplice/topic/TopicDescriptionDelegate.hpp>
42 
43 #include "u_topic.h"
44 
50 namespace dds
51 {
52 namespace topic
53 {
54 template <typename T>
55 class TopicListener;
56 
57 }
58 }
59 
60 namespace dds
61 {
62 namespace topic
63 {
64 namespace detail
65 {
66 template <typename T>
67 class Topic;
68 }
69 }
70 }
71 
72 
73 
74 /***************************************************************************
75  *
76  * dds/topic/detail/Topic<> DELEGATE declaration.
77  * Implementation can be found in dds/topic/detail/TTopicImpl.hpp
78  *
79  ***************************************************************************/
80 template <typename T>
81 class dds::topic::detail::Topic : public org::opensplice::topic::AnyTopicDelegate
82 {
83 public:
84 
85  typedef typename ::dds::core::smart_ptr_traits< Topic<T> >::ref_type ref_type;
86  typedef typename ::dds::core::smart_ptr_traits< Topic<T> >::weak_ref_type weak_ref_type;
87 
88  Topic(const dds::domain::DomainParticipant& dp,
89  const std::string& name,
90  const std::string& type_name,
91  const dds::topic::qos::TopicQos& qos,
93  const dds::core::status::StatusMask& mask);
94 
95  Topic(const dds::domain::DomainParticipant& dp,
96  const std::string& name,
97  const std::string& type_name,
98  const dds::topic::qos::TopicQos& qos,
99  u_topic uTopic);
100 
101  virtual ~Topic();
102 
103  virtual void close();
104 
105  void init(ObjectDelegate::weak_ref_type weak_ref);
106 
108 
109 
110 public:
111 
112  void listener(dds::topic::TopicListener<T>* listener,
113  const ::dds::core::status::StatusMask& mask);
114 
115  dds::topic::TopicListener<T>* listener();
116 
117  virtual void listener_notify(ObjectDelegate::ref_type source,
118  uint32_t triggerMask,
119  void *eventData,
120  void *listener);
121 
122  dds::topic::TTopicDescription<TopicDescriptionDelegate> clone();
123 
125  discover_topic(const dds::domain::DomainParticipant& dp,
126  const std::string& name,
127  const dds::core::Duration& timeout);
128 
129  static void
130  discover_topics(const dds::domain::DomainParticipant& dp,
132  uint32_t max_size);
133 
134 };
135 
138 // End of implementation
139 
140 #endif /* OSPL_DDS_TOPIC_DETAIL_TOPIC_HPP_ */
Topic is the most basic description of the data to be published and subscribed.
Definition: Topic.hpp:36
A DomainParticipant represents the local membership of the application in a Domain.
Definition: array.hpp:23
StatusMask is a bitmap or bitset field.
Definition: State.hpp:144
This struct provides the basic mechanism for an application to specify Quality of Service attributes ...
Definition: TopicQos.hpp:67
Topic events Listener.
Definition: Topic.hpp:39