ADTF
Loading...
Searching...
No Matches
adtf::streaming::vision::request_forwarding_reader< BaseReader > Class Template Reference

#include <request_forwarding.h>

Inherits page_examples_timestamp_synchronizer, and adtf::streaming::flash::sample_reader< ant::cDynamicSampleReaderQueue >.

Public Member Functions

void AddWriter (cRequestForwardingWriter *pWriter)
 
tResult BeginStreaming (adtf::streaming::ISampleStream &oSampleStream) override
 
- Public Member Functions inherited from adtf::streaming::flash::cSampleReader
 cSampleReader (ant::ISampleReaderQueue &oQueue, ant::ISampleStreamAccess::tMode eAccessMode, bool bStoreLastSample)
 
void SetName (const char *strName) override
 
tResult GetName (base::ant::IString &&strName) override
 
tResult SetType (const ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType) override
 
tResult GetType (ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType) const override
 
tResult EndStreaming () override
 
tResult SetStreamerPin (const ucom::ant::iobject_ptr< IStreamerPin > &pStreamerPin) override
 
void SetAcceptTypeCallback (const std::function< tResult(const ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType)> &fnAcceptTypeCallback)
 Sets a callback function which is called while a Stream Type is received.
 
void SetStreamErrorCallback (const std::function< tResult(tResult oStreamError)> &fnStreamErrorCallback)
 A callback function to react on stream errors.
 
tResult SetStreamError (tResult oError) override
 
tResult GetLastType (ucom::ant::iobject_ptr< const ant::IStreamType > &pType) override
 
tResult GetNextSample (ucom::ant::iobject_ptr< const ant::ISample > &pSample) override
 
tResult GetLastSample (ucom::ant::iobject_ptr< const ant::ISample > &pSample) override
 
void Reset ()
 
tResult ReadAllAvailableItems () override
 
tResult RequestSamples (ucom::ant::iobject_ptr< hollow::IStreamingRequest > &pRequest, uint32_t nSubStreamId, const base::ant::IProperties *pRequestProperties=nullptr)
 
void SetSynchronousTypeUpdateCallback (const std::function< tResult(const ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType)> &fnRequestTypeUpdateCallback)
 

Additional Inherited Members

- Protected Attributes inherited from adtf::streaming::flash::sample_reader< ant::cDynamicSampleReaderQueue >
ant::cDynamicSampleReaderQueue m_oQueue
 
ant::cDynamicSampleReaderQueue m_oQueue
 
ant::cDynamicSampleReaderQueue m_oQueue
 
ant::cDynamicSampleReaderQueue m_oQueue
 
- Protected Attributes inherited from adtf::streaming::flash::cSampleReader
std::unique_ptr< cImplementation > m_pImplementation
 

Detailed Description

template<typename BaseReader = adtf::streaming::flash::cDynamicSampleReader>
class adtf::streaming::vision::request_forwarding_reader< BaseReader >

Base reader implementation that forwards substream requests to connected writers.

Template Parameters
BaseReaderThe base reader type to inherit from (defaults to adtf::streaming::flash::cDynamicSampleReader).

The request_forwarding_reader extends a standard ADTF reader and establishes two forwarding paths:

  • Synchronous type updates (e.g., data type or structure updates) originating from the reader are propagated to all attached cRequestForwardingWriter instances. This ensures that downstream writers and connected components receive consistent type information.
  • Requests coming from the writers (e.g., substream requests) are forwarded upstream to the source. This is achieved by passing the internal source proxy to each writer via cRequestForwardingWriter::SetSource during streaming startup.

In short:

  • Reader -> Writers = type updates (downstream)
  • Writers -> Source = request forwarding (upstream)

Example Usage

class cMyFilter: public adtf::filter::cFilter
{
public:
cMyFilter()
{
const auto pReader = CreateInputPin<adtf::streaming::request_forwarding_reader<>>("input", adtf::streaming::stream_meta_type_substreams());
pReader->AddWriter(m_pWriter);
}
{
m_pWriter->Write(pSample);
}
private:
};
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
Definition filter.h:289
WriterType * CreateOutputPin(const char *strName)
Definition graph_object.h:1332
virtual tResult ProcessInput(base::flash::tNanoSeconds tmTrigger, streaming::flash::ISampleReader *pReader)
Definition samplestreamer_intf.h:188
Definition request_forwarding.h:30
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Definition object_ptr_intf.h:437
Use cSubStreamTypes to create a Stream Type instance for this Stream Meta Type.
Definition streammetatypesubstreams.h:32
See also
cRequestForwardingWriter
Example Timestamp Synchronizer

Member Function Documentation

◆ AddWriter()

template<typename BaseReader = adtf::streaming::flash::cDynamicSampleReader>
void adtf::streaming::vision::request_forwarding_reader< BaseReader >::AddWriter ( cRequestForwardingWriter * pWriter)
inline

Adds a writer instance to receive forwarded substream requests.

Parameters
[in]pWriterPointer to the writer to attach.

◆ BeginStreaming()

template<typename BaseReader = adtf::streaming::flash::cDynamicSampleReader>
tResult adtf::streaming::vision::request_forwarding_reader< BaseReader >::BeginStreaming ( adtf::streaming::ISampleStream & pStream)
inlineoverridevirtual

Begin streaming on the given sample stream.

Parameters
[in]pStreamthe sample stream.
Returns
Standard result.

Reimplemented from adtf::streaming::flash::cSampleReader.


The documentation for this class was generated from the following file: