RTI Routing Service  Version 6.0.0
 All Data Structures Files Functions Typedefs Enumerations Enumerator Groups Pages
DiscoveryStreamReader.hpp
1 /*
2  * (c) Copyright, Real-Time Innovations, 2017.
3  * All rights reserved.
4  *
5  * No duplications, whole or partial, manual or electronic, may be made
6  * without express written permission. Any such copies, or
7  * revisions thereof, must display this notice unaltered.
8  * This code contains trade secrets of Real-Time Innovations, Inc.
9  */
10 
11 #ifndef RTI_ROUTING_ADAPTER_DISCOVERY_STREAM_READER_HPP_
12 #define RTI_ROUTING_ADAPTER_DISCOVERY_STREAM_READER_HPP_
13 
14 #include <stdlib.h>
15 
16 #include <rti/routing/UpdatableEntity.hpp>
17 #include <rti/routing/StreamInfo.hpp>
18 #include <rti/routing/detail/ForwarderUtils.hpp>
19 
20 
21 namespace rti { namespace routing { namespace adapter {
22 
35 
36  using StreamReader::take;
42  void take(
43  std::vector<SamplePtr>& sample_seq,
44  std::vector<InfoPtr>&) RTI_FINAL
45  {
46  take(sample_seq_);
47  RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq, sample_seq_);
48  }
49 
54  void return_loan(
55  std::vector<SamplePtr>& sample_seq,
56  std::vector<InfoPtr>&) RTI_FINAL
57  {
58  RTI_ROUTING_SAMPLE_VECTOR_COPY_PTRS(sample_seq_, sample_seq);
59  return_loan(sample_seq_);
60  sample_seq_.clear();
61  }
62 
63  void read(
64  std::vector<SamplePtr>&,
65  std::vector<InfoPtr>&) RTI_FINAL
66  {
67  }
68 
69  void take(
70  std::vector<SamplePtr>&,
71  std::vector<InfoPtr>&,
72  const SelectorState&) RTI_FINAL
73  {
74  }
75 
76  void read(
77  std::vector<SamplePtr>&,
78  std::vector<InfoPtr>&,
79  const SelectorState&) RTI_FINAL
80  {
81  }
82 
83  virtual void* create_content_query(
84  void *,
85  const dds::topic::Filter&) RTI_FINAL
86  {
87  return NULL;
88  }
89 
90 
91  virtual void delete_content_query(void*) RTI_FINAL
92  {
93 
94  }
95 
96 
97 public:
98 
116  virtual void take(
117  std::vector<rti::routing::StreamInfo*>& sample_seq) = 0;
118 
130  virtual void return_loan(
131  std::vector<rti::routing::StreamInfo*>& sample_seq) = 0;
132 
133  /*
134  * @brief Virtual destructor
135  */
136  virtual ~DiscoveryStreamReader()
137  {
138  }
139 
140 private:
141  std::vector<StreamInfo*> sample_seq_;
142 };
143 
144 }}}
145 
146 #endif // RTI_ROUTING_ADAPTER_DISCOVERY_STREAM_READER_HPP_
147 

RTI Routing Service Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc