21 package org.opensplice.dds.sub;
23 import java.lang.reflect.Field;
24 import java.util.Collection;
25 import java.util.HashMap;
26 import java.util.List;
41 import DDS.SampleInfoSeqHolder;
49 @SuppressWarnings(
"unchecked")
54 Collection<Class<? extends
Status>> statuses) {
55 super(environment, parent, topicDescription);
58 "Supplied DataReaderQos is null.");
60 if (topicDescription == null) {
62 "Supplied TopicDescription is null.");
64 DDS.DataReaderQos oldQos;
68 }
catch (ClassCastException e) {
70 "Cannot create DataReader with non-OpenSplice qos");
73 if (listener != null) {
75 this.environment,
this, listener,
true);
79 DDS.DataReader old = this.parent.getOld().create_datareader(
80 topicDescription.getOld(), oldQos, this.listener,
91 this.environment,
this, this.typeSupport
92 .getTypeSupportStandard().getType());
93 this.topicDescription.retain();
95 if (this.listener != null) {
96 this.listener.setInitialised();
109 Field sampleSeqHolderValueField) {
112 synchronized (this.preallocated) {
113 if (samples != null) {
114 pa = this.preallocated.get(samples);
120 this.environment,
this, sampleSeqHolderClz,
121 sampleSeqHolderValueField, samples);
132 return this.reflectionReader;
143 DDS_TYPE ddsData = this.reflectionReader.getKeyValue(handle);
145 if (ddsData != null) {
146 return this.typeSupport.ddsKeyToProtobuf(ddsData);
153 return this.reflectionReader.lookupInstance(this.typeSupport
154 .protobufToDds(keyHolder));
162 if (sample == null) {
164 "Provided an invalid null sample.");
167 this.typeSupport.protobufToDds(sample.
getData()),
169 result = this.reflectionReader.readNextSample(ddsSample);
171 if (result ==
true) {
172 if (ddsSample.
getInfo().valid_data) {
174 this.typeSupport.ddsToProtobuf(ddsSample.
getData()),
178 this.typeSupport.ddsKeyToProtobuf(ddsSample
190 if (sample == null) {
192 "Provided an invalid null sample.");
195 this.typeSupport.protobufToDds(sample.
getData()),
197 result = this.reflectionReader.takeNextSample(ddsSample);
199 if (result ==
true) {
200 if (ddsSample.
getInfo().valid_data) {
202 this.typeSupport.ddsToProtobuf(ddsSample.
getData()),
206 this.typeSupport.ddsKeyToProtobuf(ddsSample
215 Field sampleSeqHolderValueField, SampleInfoSeqHolder info) {
217 this, sampleSeqHolder, sampleSeqHolderValueField, info);
Since a org.omg.dds.sub.DataReader is a kind of org.omg.dds.core.Entity, it has the ability to have a...
A Sample represents an atom of data information (i.e., one value for one instance) as returned by a o...
void setSampleList(List< Sample< PROTOBUF_TYPE >> preAllocated)
List< Sample< PROTOBUF_TYPE > > getSampleList()
ReflectionDataReader<?, PROTOBUF_TYPE > getReflectionReader()
PROTOBUF_TYPE getKeyValue(PROTOBUF_TYPE keyHolder, InstanceHandle handle)
static Set< Class<? extends Status > > convertMask(OsplServiceEnvironment environment, int state)
TYPE getData()
Get the data associated with this Sample, if any.
Iterator< PROTOBUF_TYPE > createIterator(Object sampleSeqHolder, Field sampleSeqHolderValueField, SampleInfoSeqHolder info)
An opaque handle that can be used to refer to a local or remote entity.
final TopicDescriptionExt< TYPE > topicDescription
TYPE getData()
Get the data associated with this Sample, if any.
boolean takeNextSample(Sample< PROTOBUF_TYPE > sample)
PROTOBUF_TYPE getKeyValue(InstanceHandle handle)
PreAllocator< PROTOBUF_TYPE > getPreAllocator(List< Sample< PROTOBUF_TYPE >> samples, Class<?> sampleSeqHolderClz, Field sampleSeqHolderValueField)
static void throwLastErrorException(OsplServiceEnvironment environment)
boolean readNextSample(Sample< PROTOBUF_TYPE > sample)
InstanceHandle lookupInstance(PROTOBUF_TYPE keyHolder)
Status is the abstract root class for all communication status objects.