![]() |
OpenSplice Java 5 DCPS
v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
|
Public Member Functions | |
SampleImpl (OsplServiceEnvironment environment, TYPE data, DDS.SampleInfo info) | |
SampleImpl< TYPE > | clone () |
int | getAbsoluteGenerationRank () |
The sampleRank and generationRank available in the Sample are computed based solely on the actual samples in the ordered collection returned by org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take(). More... | |
TYPE | getData () |
Get the data associated with this Sample, if any. More... | |
int | getDisposedGenerationCount () |
For each instance the middleware internally maintains two counts: the disposedGenerationCount and noWritersGenerationCount, relative to each org.omg.dds.sub.DataReader: More... | |
ServiceEnvironment | getEnvironment () |
int | getGenerationRank () |
The sampleRank and generationRank available in the Sample are computed based solely on the actual samples in the ordered collection returned by org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take(). More... | |
DDS.SampleInfo | getInfo () |
InstanceHandle | getInstanceHandle () |
Gets the InstanceHandle of the associated data Sample. More... | |
InstanceState | getInstanceState () |
For each instance the middleware internally maintains an instanceState. More... | |
TYPE | getKeyValue () |
int | getNoWritersGenerationCount () |
For each instance the middleware internally maintains two counts: the disposedGenerationCount and noWritersGenerationCount, relative to each org.omg.dds.sub.DataReader: More... | |
InstanceHandle | getPublicationHandle () |
Gets the InstanceHandle of the associated publication. More... | |
int | getSampleRank () |
The sampleRank and generationRank available in the Sample are computed based solely on the actual samples in the ordered collection returned by org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take(). More... | |
SampleState | getSampleState () |
For each sample received, the middleware internally maintains a sampleState relative to each org.omg.dds.sub.DataReader. More... | |
Time | getSourceTimestamp () |
Gets the timestamp of the sample. More... | |
ViewState | getViewState () |
For each instance (identified by the key), the middleware internally maintains a viewState relative to each org.omg.dds.sub.DataReader More... | |
void | setContent (TYPE data, DDS.SampleInfo info) |
void | setData (TYPE data) |
void | setInfo (DDS.SampleInfo info) |
Definition at line 34 of file SampleImpl.java.
org.opensplice.dds.sub.SampleImpl< TYPE >.SampleImpl | ( | OsplServiceEnvironment | environment, |
TYPE | data, | ||
DDS.SampleInfo | info | ||
) |
Definition at line 40 of file SampleImpl.java.
SampleImpl<TYPE> org.opensplice.dds.sub.SampleImpl< TYPE >.clone | ( | ) |
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 143 of file SampleImpl.java.
int org.opensplice.dds.sub.SampleImpl< TYPE >.getAbsoluteGenerationRank | ( | ) |
The sampleRank and generationRank available in the Sample are computed based solely on the actual samples in the ordered collection returned by org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take().
The absoluteGenerationRank available in the Sample indicates the difference in 'generations' between the sample (S) and the Most Recent Sample of the same instance that the middleware has received (MRS). That is, it counts the number of times the instance transitioned from not-alive to alive in the time from the reception of S to the time when org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take() was called.
absoluteGenerationRank = (MRS.disposedGenerationCount
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 138 of file SampleImpl.java.
TYPE org.opensplice.dds.sub.SampleImpl< TYPE >.getData | ( | ) |
Get the data associated with this Sample, if any.
Normally each Sample contains both meta-data ("Sample Info") and some data. However there are situations where a Sample contains only the Sample Info and does not have any associated data. This occurs when the Service notifies the application of a change of state for an instance that was caused by some internal mechanism (such as a timeout) for which there is no associated data. An example of this situation is when the Service detects that an instance has no writers and changes the corresponding instanceState to org.omg.dds.sub.InstanceState#NOT_ALIVE_NO_WRITERS.
The actual set of scenarios under which the middleware returns Samples containing no data is implementation dependent. The application can distinguish whether a particular Sample has data by examining the value returned by this method. If the result is not null, then the Sample contains valid data. If it is null, the Sample contains no data.
To ensure correctness and portability, the application must check for a null result from this method prior to using it. If the data is null, the application should access only the Sample Info.
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 53 of file SampleImpl.java.
int org.opensplice.dds.sub.SampleImpl< TYPE >.getDisposedGenerationCount | ( | ) |
For each instance the middleware internally maintains two counts: the disposedGenerationCount and noWritersGenerationCount, relative to each org.omg.dds.sub.DataReader:
The disposedGenerationCount and noWritersGenerationCount available in the Sample capture a snapshot of the corresponding counters at the time the sample was received.
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 118 of file SampleImpl.java.
ServiceEnvironment org.opensplice.dds.sub.SampleImpl< TYPE >.getEnvironment | ( | ) |
Implements org.omg.dds.core.DDSObject.
Definition at line 48 of file SampleImpl.java.
int org.opensplice.dds.sub.SampleImpl< TYPE >.getGenerationRank | ( | ) |
The sampleRank and generationRank available in the Sample are computed based solely on the actual samples in the ordered collection returned by org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take().
The generationRank is computed using the formula:
generationRank = (MRSIC.disposedGenerationCount
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 133 of file SampleImpl.java.
DDS.SampleInfo org.opensplice.dds.sub.SampleImpl< TYPE >.getInfo | ( | ) |
Definition at line 73 of file SampleImpl.java.
InstanceHandle org.opensplice.dds.sub.SampleImpl< TYPE >.getInstanceHandle | ( | ) |
Gets the InstanceHandle of the associated data Sample.
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 106 of file SampleImpl.java.
InstanceState org.opensplice.dds.sub.SampleImpl< TYPE >.getInstanceState | ( | ) |
For each instance the middleware internally maintains an instanceState.
The instanceState can be org.omg.dds.sub.InstanceState#ALIVE, org.omg.dds.sub.InstanceState#NOT_ALIVE_DISPOSED, or org.omg.dds.sub.InstanceState#NOT_ALIVE_NO_WRITERS.
The precise behavior events that cause the instanceState to change depends on the setting of the org.omg.dds.core.policy.Ownership:
The instanceState available in the Sample is a snapshot of the instanceState of the instance at the time the collection was obtained (i.e., at the time org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take() was called). The instanceState is therefore the same for all samples in the returned collection that refer to the same instance.
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 95 of file SampleImpl.java.
TYPE org.opensplice.dds.sub.SampleImpl< TYPE >.getKeyValue | ( | ) |
Definition at line 61 of file SampleImpl.java.
int org.opensplice.dds.sub.SampleImpl< TYPE >.getNoWritersGenerationCount | ( | ) |
For each instance the middleware internally maintains two counts: the disposedGenerationCount and noWritersGenerationCount, relative to each org.omg.dds.sub.DataReader:
The disposedGenerationCount and noWritersGenerationCount available in the Sample capture a snapshot of the corresponding counters at the time the sample was received.
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 123 of file SampleImpl.java.
InstanceHandle org.opensplice.dds.sub.SampleImpl< TYPE >.getPublicationHandle | ( | ) |
Gets the InstanceHandle of the associated publication.
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 112 of file SampleImpl.java.
int org.opensplice.dds.sub.SampleImpl< TYPE >.getSampleRank | ( | ) |
The sampleRank and generationRank available in the Sample are computed based solely on the actual samples in the ordered collection returned by org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take().
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 128 of file SampleImpl.java.
SampleState org.opensplice.dds.sub.SampleImpl< TYPE >.getSampleState | ( | ) |
For each sample received, the middleware internally maintains a sampleState relative to each org.omg.dds.sub.DataReader.
The sampleState can either be org.omg.dds.sub.SampleState#READ or org.omg.dds.sub.SampleState#NOT_READ.
The sampleState will, in general, be different for each sample in the collection returned by org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take().
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 83 of file SampleImpl.java.
Time org.opensplice.dds.sub.SampleImpl< TYPE >.getSourceTimestamp | ( | ) |
Gets the timestamp of the sample.
This is the timestamp provided by the DataWriter at the time the sample was produced.
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 101 of file SampleImpl.java.
ViewState org.opensplice.dds.sub.SampleImpl< TYPE >.getViewState | ( | ) |
For each instance (identified by the key), the middleware internally maintains a viewState relative to each org.omg.dds.sub.DataReader
The viewState can either be org.omg.dds.sub.ViewState#NEW or org.omg.dds.sub.ViewState#NOT_NEW.
The viewState available in the Sample is a snapshot of the viewState of the instance relative to the DataReader used to access the samples at the time the collection was obtained (i.e., at the time org.omg.dds.sub.DataReader#read() or org.omg.dds.sub.DataReader#take() was called). The viewState is therefore the same for all samples in the returned collection that refer to the same instance.
Implements org.omg.dds.sub.Sample< TYPE >.
Definition at line 89 of file SampleImpl.java.
void org.opensplice.dds.sub.SampleImpl< TYPE >.setContent | ( | TYPE | data, |
DDS.SampleInfo | info | ||
) |
Definition at line 77 of file SampleImpl.java.
void org.opensplice.dds.sub.SampleImpl< TYPE >.setData | ( | TYPE | data | ) |
Definition at line 65 of file SampleImpl.java.
void org.opensplice.dds.sub.SampleImpl< TYPE >.setInfo | ( | DDS.SampleInfo | info | ) |
Definition at line 69 of file SampleImpl.java.