T
- Type of the DataReader. Type may be obtained from an external tool
like IDL compiler, or it may be more dynamically constructed
Object that is used with uDDS.public class DataReader<T> extends Entity<T,PublicationData>
Modifier and Type | Field and Description |
---|---|
protected RTPSReader<T> |
rtps_reader
RTPSReader associated with this DataReader
|
communicationListeners
Modifier | Constructor and Description |
---|---|
protected |
DataReader(Participant p,
Class<T> type,
RTPSReader<T> reader)
Constructor with null typeName
|
protected |
DataReader(Participant p,
Class<T> type,
String typeName,
RTPSReader<T> reader)
Constructor for DataReader.
|
Modifier and Type | Method and Description |
---|---|
void |
addSampleListener(SampleListener<T> listener)
Adds a SampleListener to this DataReader
|
void |
addWriterListener(WriterLivelinessListener wl)
Adds a WriterListener to this DataReader.
|
void |
clear(List<Sample<T>> samples)
Clears Samples from the history cache.
|
Instance<T> |
getInstance(Sample<T> sample)
Gets an Instance of given Sample.
|
Set<Instance<T>> |
getInstances()
Gets a Set of instances this DataReader knows.
|
List<Sample<T>> |
getSamples()
Gets all the samples this DataReader knows about.
|
List<Sample<T>> |
getSamplesSince(Sample<T> s)
Gets all the Samples that have been received after given Sample.
|
void |
removeSampleListener(SampleListener<T> listener)
Removes a given SampleListener from this DataReader.
|
void |
removeWriterListener(WriterLivelinessListener wl)
Removes a WriterListener from this DataReader.
|
void |
setContentFilter(ContentFilter<T> cf)
Sets a ContentFilter.
|
addCommunicationListener, getGuid, getParticipant, getTopicName, getType, getTypeName, removeCommunicationListener
protected final RTPSReader<T> rtps_reader
protected DataReader(Participant p, Class<T> type, RTPSReader<T> reader)
p
- Participanttype
- Class of the type this DataReader handlesreader
- RTPSReader usedprotected DataReader(Participant p, Class<T> type, String typeName, RTPSReader<T> reader)
p
- Participant that created this DataReadertype
- Type of this DataReadertypeName
- Name of the type. If null, fully qualified class name is usedreader
- associated RTPSReaderpublic void addSampleListener(SampleListener<T> listener)
listener
- Listener to addpublic void addWriterListener(WriterLivelinessListener wl)
wl
- WriterListener to addpublic Set<Instance<T>> getInstances()
public Instance<T> getInstance(Sample<T> sample)
App DataReader RTPSReader |------- getSamples() ----->| | |<------ samples -----------| | | |<-------- dispose ---------| |------- getInstance() ---->| | |<------ null --------------| | | | |
sample
- a Sample, whose instance is retrievedpublic List<Sample<T>> getSamples()
public List<Sample<T>> getSamplesSince(Sample<T> s)
s
- a Sample to compare.public void clear(List<Sample<T>> samples)
samples
- a List of Samples to clear.public void removeSampleListener(SampleListener<T> listener)
listener
- A listener to removepublic void removeWriterListener(WriterLivelinessListener wl)
wl
- WriterListener to removepublic void setContentFilter(ContentFilter<T> cf)
cf
- ContentFilter to setCopyright © 2016. All rights reserved.