RTI Routing Service Version 7.1.0
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
21namespace rti { namespace routing { namespace adapter {
22
35
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
97public:
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
140private:
141 std::vector<StreamInfo*> sample_seq_;
142};
143
144}}}
145
146#endif // RTI_ROUTING_ADAPTER_DISCOVERY_STREAM_READER_HPP_
147
Definition of a special StreamReader to read information about data streams.
Definition: DiscoveryStreamReader.hpp:34
virtual void return_loan(std::vector< rti::routing::StreamInfo * > &sample_seq)=0
Returns a loan on the read or taken StreamInfo samples.
virtual void take(std::vector< rti::routing::StreamInfo * > &sample_seq)=0
Takes a collection of all available StreamInfo samples.
Defines a set of attributes that can be used to read a subset of data from StreamReader.
Definition: StreamReader.hpp:547
Provides a way to read samples of a specific type from a data domain. In the XML configuration file,...
Definition: StreamReader.hpp:45
virtual void take(std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
Takes a collection of all data samples and info samples available from an input stream.
virtual void return_loan(std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
Returns a loan on the read or taken data samples and info samples.