#include <sample_data.h>
Inherited by adtf::streaming::penguin::sample_data< T, typename std::enable_if_t< std::is_trivially_copyable< T >::value > >.
template<typename T>
class adtf::streaming::flash::sample_data< T >
Easy data access for input samples
Example Usage
{
}
{
}
{
if (sample_data_vector.GetData().size() > 4)
{
}
}
#define LOG_INFO(...)
Logs an info message.
Definition log.h:388
Definition sample_data.h:429
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Definition object_ptr_intf.h:437
or
struct tMyData
{
uint32_t nValue1;
uint32_t nValue2;
uint32_t nValue3;
};
{
oMyData->nValue1,
oMyData->nValue2,
oMyData->nValue3);
}
- Template Parameters
-
| T | type of content of the samples sample buffer to get via GetData or sample_data::operator::T |
- See also
- output_sample_data
◆ sample_data() [1/2]
move CTOR
- Parameters
-
| oSampleData | Data to move from |
◆ sample_data() [2/2]
copy CTOR
- Parameters
-
| pSample | Sample to get the data from |
◆ GetData()
Retrieves a reference to the data.
Internally it gets the buffer pointer of the sample.
- Returns
- returns a reference to the sample data.
- Exceptions
-
| error | ERR_INVALID_STATE if the sample is not valid. |
◆ GetDataPtr()
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
-
◆ GetDataSize()
- Returns
- The size of the buffer that the data resides in.
◆ GetSampleInfo()
Retrieves a variant value for the hash key oHash out of the samples sample information . If the value does not exists the return value is the given default oDefault.
- Parameters
-
| [in] | oHash | The hash key of the value. |
| [in] | oDefault | default value if value does not exist. |
- Returns
- retrieved value as variant.
◆ GetTime()
retrieves the timestamp of the data.
Internally it gets the time of the sample.
- Returns
- returns the sample time
- Return values
-
◆ GetTimeNs()
retrieves the timestamp of the data.
Internally it gets the time of the sample.
- Returns
- returns the sample time
- Return values
-
◆ IsValid()
Validate if sample and sample buffer is set.
- Return values
-
| true | is valid |
| false | is invalid |
◆ operator const T &()
Return the content of sample buffer as a reference.
- Returns
- the value of the sample buffer as T
- Return values
-
| T() | if no sample buffer set |
- See also
- IsValid
◆ operator*()
Retrieves a reference to the data.
Internally it gets the buffer pointer of the sample.
- Returns
- returns a reference to the sample data.
- Exceptions
-
| error | ERR_INVALID_STATE if the sample is not valid. |
◆ operator->() [1/2]
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
-
◆ operator->() [2/2]
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
-
◆ Reset() [1/2]
Resets the sample the sample data reference to. The reference will be empty.
- Returns
- standard result
- Return values
-
| ERR_NOERROR | sample is reset |
- See also
- IsValid
◆ Reset() [2/2]
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_NOERROR | sample is reset |
- See also
- IsValid
The documentation for this class was generated from the following file: