A SampleProcessor automatically takes the data from the attached readers and provides each data sample to a user-defined handler function. The SampleProcessor uses a configurable thread pool to wait for the data and call the handlers.
More...
Inherits IDisposable.
A SampleProcessor automatically takes the data from the attached readers and provides each data sample to a user-defined handler function. The SampleProcessor uses a configurable thread pool to wait for the data and call the handlers.
Readers cannot be disposed while they're attached to a SampleProcessor.
◆ SampleProcessor() [1/2]
Rti.Dds.Subscription.SampleProcessor.SampleProcessor |
( |
| ) |
|
|
inline |
◆ SampleProcessor() [2/2]
◆ AttachDataReader< T >()
void Rti.Dds.Subscription.SampleProcessor.AttachDataReader< T > |
( |
DataReader< T > |
reader, |
|
|
Action< LoanedSample< T > > |
handler |
|
) |
| |
Adds a handler to be called for each data sample received by a DataReader<T> .
- Parameters
-
reader | The reader to read from. Important: the reader must not be Disposed while attached. |
handler | A function that receives a LoanedSample<T>. Important: the sample is only valid inside the handler. It cannot be used after the handler returns. |
- Template Parameters
-
◆ DetachDataReader()
void Rti.Dds.Subscription.SampleProcessor.DetachDataReader |
( |
AnyDataReader |
reader | ) |
|
Detaches a reader. The SampleProcessor stops taking data from this reader.
- Parameters
-
reader | The reader to detach. |
◆ Dispose()
void Rti.Dds.Subscription.SampleProcessor.Dispose |
( |
| ) |
|
Releases the native resources used by this object. A finalizer is also provided, so it is not necessary to call Dispose.