ADTF
Loading...
Searching...
No Matches
adtf::streaming::ant::sample_data< T > Class Template Reference

#include <sample_data.h>

Public Member Functions

 sample_data ()
 CTOR.
 
 sample_data (const sample_data &oSampleData)
 CTOR.
 
 sample_data (sample_data &&oSampleData)
 
 sample_data (const ucom::iobject_ptr< const ISample > &pSample)
 
tTimeStamp GetTime () const
 
const T * GetDataPtr () const
 
const T GetData () const
 
bool IsValid () const
 
 operator bool () const
 
 operator T () const
 
tResult Reset (const ucom::ant::iobject_ptr< const ISample > &pSample)
 
tResult Reset ()
 

Protected Attributes

ucom::object_ptr< const ISamplem_pCurrentSample
 
ucom::object_ptr_shared_locked< const ISampleBufferm_pBuffer
 

Detailed Description

template<typename T>
class adtf::streaming::ant::sample_data< T >

Sample Data getter for an easy use of samples with samplebuffer set to the type T

Template Parameters
Ttype of content of the samples sample buffer to get via GetData or sample_data::operator::T
Remarks
as long a sample data holds an reference to a sample the buffer is read locked !

Please use the newer versions (adtf::streaming::flash::sample_data) from the flash namespace.

See also
adtf::streaming::penguin::sample_data
adtf::streaming::flash::output_sample_data

Constructor & Destructor Documentation

◆ sample_data() [1/2]

template<typename T>
adtf::streaming::ant::sample_data< T >::sample_data ( sample_data< T > && oSampleData)
inline

move CTOR

Parameters
oSampleDataData to move from

◆ sample_data() [2/2]

template<typename T>
adtf::streaming::ant::sample_data< T >::sample_data ( const ucom::iobject_ptr< const ISample > & pSample)
inline

copy CTOR

Parameters
pSampleSample to get the data from

Member Function Documentation

◆ GetData()

template<typename T>
const T adtf::streaming::ant::sample_data< T >::GetData ( ) const
inline

Retrieves the pointer to the datas memory as type T*.

Internally it gets the buffer pointer of the sample.

Returns
returns the pointer to the sample data.
Return values
nullptrno buffer set

◆ GetDataPtr()

template<typename T>
const T * adtf::streaming::ant::sample_data< T >::GetDataPtr ( ) const
inline

Retrieves the pointer to the datas memory.

Internally it gets the buffer pointer of the sample.

Returns
returns the pointer to the sample data.
Return values
nullptrno buffer set

◆ GetTime()

template<typename T>
tTimeStamp adtf::streaming::ant::sample_data< T >::GetTime ( ) const
inline

retrieves the time of the data.

Internally it gets the time of the sample.

Returns
returns the sample data time
Return values
-1no time set

◆ IsValid()

template<typename T>
bool adtf::streaming::ant::sample_data< T >::IsValid ( ) const
inline

Validate if sample and sample buffer is set.

Return values
trueis valid
falseis invalid

◆ operator bool()

template<typename T>
adtf::streaming::ant::sample_data< T >::operator bool ( ) const
inline

Validate if sample and sample buffer is set.

Return values
trueis valid
falseis invalid

◆ operator T()

template<typename T>
adtf::streaming::ant::sample_data< T >::operator T ( ) const
inline

Convert the content of sample buffer as

Returns
the value of the sample buffer as T
Return values
T()if no sample buffer set
See also
IsValid

◆ Reset() [1/2]

template<typename T>
tResult adtf::streaming::ant::sample_data< T >::Reset ( )
inline

Resets the sample the sample data reference to. The reference will be empty.

Returns
standard result
Return values
ERR_NOERRORsample is reset
See also
IsValid

◆ Reset() [2/2]

template<typename T>
tResult adtf::streaming::ant::sample_data< T >::Reset ( const ucom::ant::iobject_ptr< const ISample > & pSample)
inline

Resets the sample the sample data reference to with a new reference to a sample.

Parameters
pSample[in] Reference to the sampel the sample data will reference to
Returns
standard result
Return values
ERR_NOERRORsample is reset
See also
IsValid

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