OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
discovery.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 
22 
27 #ifndef OSPL_DDS_TOPIC_DETAIL_DISCOVER_HPP_
28 #define OSPL_DDS_TOPIC_DETAIL_DISCOVER_HPP_
29 
30 #include <dds/topic/AnyTopic.hpp>
31 #include <dds/topic/Topic.hpp>
32 #include <org/opensplice/topic/discovery.hpp>
33 
34 #include <string>
35 
41 namespace dds
42 {
43 namespace topic
44 {
45 
46 template <typename TOPIC>
47 TOPIC
48 discover(
50  const std::string& topic_name,
51  const dds::core::Duration& timeout)
52 {
53  ISOCPP_REPORT_STACK_DDS_BEGIN(dp);
55 
56  return t;
57 }
58 
59 
60 template <typename ANYTOPIC, typename FwdIterator>
61 uint32_t
62 discover(
64  FwdIterator begin,
65  uint32_t max_size)
66 {
67  ISOCPP_REPORT_STACK_DDS_BEGIN(dp);
68  std::vector<ANYTOPIC> list;
69 
71 
72  FwdIterator fit = begin;
73  for (typename std::vector<ANYTOPIC>::const_iterator it = list.begin(); it != list.end(); ++it) {
74  *fit++ = *it;
75  }
76 
77  return list.size();
78 }
79 
80 template <typename ANYTOPIC, typename BinIterator>
81 uint32_t
84  BinIterator begin)
85 {
86  ISOCPP_REPORT_STACK_DDS_BEGIN(dp);
87  std::vector<ANYTOPIC> list;
88 
90 
91  BinIterator bit = begin;
92  for (typename std::vector<ANYTOPIC>::const_iterator it = list.begin(); it != list.end(); ++it) {
93  *bit++ = *it;
94  }
95 
96  return list.size();
97 }
98 
99 
100 template <typename FwdIterator>
101 void
102 ignore(
104  FwdIterator begin, FwdIterator end)
105 {
106  ISOCPP_THROW_EXCEPTION(ISOCPP_UNSUPPORTED_ERROR, "Function not currently supported");
107 }
108 
109 }
110 }
111 
114 #endif /* OSPL_DDS_TOPIC_DETAIL_DISCOVER_HPP_ */
void ignore(const dds::domain::DomainParticipant &dp, const dds::core::InstanceHandle &handle)
uint32_t discover_all(const dds::domain::DomainParticipant &dp, BinIterator begin)
A DomainParticipant represents the local membership of the application in a Domain.
uint32_t discover(const dds::domain::DomainParticipant &dp, FwdIterator begin, uint32_t max_size)
TOPIC discover(const dds::domain::DomainParticipant &dp, const std::string &name, const dds::core::Duration &timeout=dds::core::Duration::infinite())
Definition: array.hpp:23
const int32_t LENGTH_UNLIMITED