ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sample_streamer< INTERFACE, PINTYPE >

Helper template can be used to implement ISampleStreamer. More...

#include <samplereader.h>

Inheritance diagram for sample_streamer< INTERFACE, PINTYPE >:
[legend]

Public Types

typedef PINTYPE pin_type
 

Public Member Functions

 sample_streamer ()=default
 CTOR.
 
 sample_streamer (const char *strName, const ucom::ant::iobject_ptr< const IStreamType > &pStreamType)
 CTOR initializer.
 
virtual ~sample_streamer ()
 DTOR.
 
void SetName (const char *strName)
 Sets the name of the streamer.
 
void ResetPin (ucom::ant::object_ptr< PINTYPE > &pPin)
 Resets the pin reference This is only internaly used.
 
void ResetPin ()
 Resets the pin reference to nullptr.
 
tResult GetName (base::ant::IString &&strName) const
 Gets the name of the streamer.
 
tResult SetType (const ucom::ant::iobject_ptr< const IStreamType > &pStreamType)
 Sets the StreamType of the streamer.
 
tResult GetType (ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const override
 
tResult EndStreaming () override
 

Protected Member Functions

 sample_streamer (const sample_streamer &)=delete
 deleted copy CTOR
 
 sample_streamer (sample_streamer &&)=delete
 deleted move CTOR
 
sample_streameroperator= (const sample_streamer &)=delete
 deleted copy operator
 
sample_streameroperator= (sample_streamer &&)=delete
 deleted move operator
 

Protected Attributes

adtf_util::cString m_strName
 name of the streamer (used i.e. to create the pins name)
 
ucom::object_ptr< const IStreamTypem_pStreamType
 stream type of the streamer
 
ucom::object_ptr< PINTYPE > m_poPin
 pin reference reading/writing from
 

Detailed Description

template<typename INTERFACE, typename PINTYPE>
class adtf::streaming::ant::sample_streamer< INTERFACE, PINTYPE >

Helper template can be used to implement ISampleStreamer.

This template works only for cInPin and cOutPin or implementations using similar functionality to cPin::RegisterStreamer and cPin::UnregisterStreamer.

Template Parameters
PINTYPEPin referenced to.

Definition at line 40 of file samplereader.h.

Member Typedef Documentation

◆ pin_type

template<typename INTERFACE, typename PINTYPE>
typedef PINTYPE pin_type

Definition at line 43 of file samplereader.h.

Constructor & Destructor Documentation

◆ sample_streamer()

template<typename INTERFACE, typename PINTYPE>
sample_streamer ( const char * strName,
const ucom::ant::iobject_ptr< const IStreamType > & pStreamType )
inline

CTOR initializer.

Parameters
[in]strNameName of the Streamer
[in]pStreamTypeAccepted streamtype of the streamer

Definition at line 67 of file samplereader.h.

◆ ~sample_streamer()

template<typename INTERFACE, typename PINTYPE>
virtual ~sample_streamer ( )
inlinevirtual

DTOR.

Definition at line 72 of file samplereader.h.

Member Function Documentation

◆ EndStreaming()

template<typename INTERFACE, typename PINTYPE>
tResult EndStreaming ( )
inlineoverride

Definition at line 160 of file samplereader.h.

◆ GetName()

template<typename INTERFACE, typename PINTYPE>
tResult GetName ( base::ant::IString && strName) const
inline

Gets the name of the streamer.

Parameters
[out]strNameIString Reference to return the name
Returns
Standard Result Code of base::IString::Set.

Definition at line 129 of file samplereader.h.

◆ GetType()

template<typename INTERFACE, typename PINTYPE>
tResult GetType ( ucom::ant::iobject_ptr< const IStreamType > & pStreamType) const
inlineoverride

Definition at line 154 of file samplereader.h.

◆ ResetPin() [1/2]

template<typename INTERFACE, typename PINTYPE>
void ResetPin ( )
inline

Resets the pin reference to nullptr.

This is only internaly used.

Returns
void

Definition at line 116 of file samplereader.h.

Referenced by sample_streamer< ISampleReader, cInPin >::~sample_streamer(), and sample_streamer< ISampleReader, cInPin >::ResetPin().

◆ ResetPin() [2/2]

template<typename INTERFACE, typename PINTYPE>
void ResetPin ( ucom::ant::object_ptr< PINTYPE > & pPin)
inline

Resets the pin reference This is only internaly used.

Parameters
[in]pPinpin referencing to
Returns
void

Definition at line 95 of file samplereader.h.

Referenced by adtf::streaming::ant::create_pin(), and adtf::streaming::ant::create_pin().

◆ SetName()

template<typename INTERFACE, typename PINTYPE>
void SetName ( const char * strName)
inline

Sets the name of the streamer.

Parameters
[in]strNamename to be set
Returns
void

Definition at line 84 of file samplereader.h.

Referenced by adtf::streaming::ant::create_pin(), adtf::streaming::ant::create_pin(), adtf::streaming::ant::make_sample_reader(), and adtf::streaming::ant::make_sample_writer().

◆ SetType()

template<typename INTERFACE, typename PINTYPE>
tResult SetType ( const ucom::ant::iobject_ptr< const IStreamType > & pStreamType)
inline

Sets the StreamType of the streamer.

It will create a deep copy.

Parameters
[in]pStreamTypeStreamType to set.
Returns
Standard Result Code of base::IString::Set.

Definition at line 140 of file samplereader.h.

Referenced by adtf::streaming::ant::create_pin(), adtf::streaming::ant::create_pin(), adtf::streaming::ant::make_sample_reader(), and adtf::streaming::ant::make_sample_writer().

Member Data Documentation

◆ m_poPin

template<typename INTERFACE, typename PINTYPE>
ucom::object_ptr<PINTYPE> m_poPin
protected

pin reference reading/writing from

Definition at line 50 of file samplereader.h.

◆ m_pStreamType

template<typename INTERFACE, typename PINTYPE>
ucom::object_ptr<const IStreamType> m_pStreamType
protected

stream type of the streamer

Definition at line 48 of file samplereader.h.

◆ m_strName

template<typename INTERFACE, typename PINTYPE>
adtf_util::cString m_strName
protected

name of the streamer (used i.e. to create the pins name)

Definition at line 46 of file samplereader.h.