RTI Connext C# API Version 7.2.0
Rti.Dds.Subscription.SampleProcessor Class Reference

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.

Public Member Functions

 SampleProcessor ()
 Creates a new SampleProcessor with default configuration. More...
 
 SampleProcessor (AsyncWaitSetProperty property)
 Creates a new SampleProcessor with the specified configuration. More...
 
void AttachDataReader< T > (DataReader< T > reader, Action< LoanedSample< T > > handler)
 Adds a handler to be called for each data sample received by a DataReader<T> . More...
 
void DetachDataReader (AnyDataReader reader)
 Detaches a reader. The SampleProcessor stops taking data from this reader. More...
 
void Dispose ()
 Releases the native resources used by this object. A finalizer is also provided, so it is not necessary to call Dispose. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SampleProcessor() [1/2]

Rti.Dds.Subscription.SampleProcessor.SampleProcessor ( )
inline

Creates a new SampleProcessor with default configuration.

◆ SampleProcessor() [2/2]

Rti.Dds.Subscription.SampleProcessor.SampleProcessor ( AsyncWaitSetProperty  property)

Creates a new SampleProcessor with the specified configuration.

Member Function Documentation

◆ 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
readerThe reader to read from. Important: the reader must not be Disposed while attached.
handlerA 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
TThe reader's topic-type

◆ DetachDataReader()

void Rti.Dds.Subscription.SampleProcessor.DetachDataReader ( AnyDataReader  reader)

Detaches a reader. The SampleProcessor stops taking data from this reader.

Parameters
readerThe 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.