#include <sample_data.h>
template<typename T, typename Enable = void>
class adtf::streaming::penguin::sample_data< T, Enable >
Easy data access for input samples of non trivial type @T. This sample_data is for non-trivial types, where a specialization of adtf::base::adtf_memory for type T exists. In contrast to sample_data for trivially copyable types, T is only derrived from the sample data, not the sample buffer itself.
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]
template<typename T, typename Enable = void>
move CTOR
- Parameters
-
| oSampleData | Data to move from |
◆ sample_data() [2/2]
template<typename T, typename Enable = void>
copy CTOR
- Parameters
-
| pSample | Sample to get the data from |
◆ GetData() [1/2]
template<typename T, typename Enable = void>
Retrieves a reference to the data.
- Returns
- returns a reference to the copy of the sample data.
- Exceptions
-
| error | ERR_INVALID_STATE if the sample is not valid. |
◆ GetData() [2/2]
template<typename T, typename Enable = void>
Retrieves a reference to the data.
- Returns
- returns a reference to the copy of the sample data.
- Exceptions
-
| error | ERR_INVALID_STATE if the sample is not valid. |
◆ GetDataPtr()
template<typename T, typename Enable = void>
Retrieves the pointer to the datas memory.
- Returns
- Returns the pointer to the copy of the sample data.
- Return values
-
◆ GetDataSize()
template<typename T, typename Enable = void>
- Returns
- The size of the buffer that the data resides in.
◆ GetSampleInfo()
template<typename T, typename Enable = void>
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()
template<typename T, typename Enable = void>
retrieves the timestamp of the data.
Internally it gets the time of the sample.
- Returns
- Returns the sample time.
- Return values
-
◆ GetTimeNs()
template<typename T, typename Enable = void>
Retrieves the timestamp of the data.
Internally it gets the time of the sample.
- Returns
- Returns the sample time
- Return values
-
◆ IsValid()
template<typename T, typename Enable = void>
Validate if sample and sample buffer is set.
- Return values
-
| true | is valid |
| false | is invalid |
◆ operator const T &()
template<typename T, typename Enable = void>
Return the content of sample buffer as a reference to the extracted non trivial value. i.e. if using std::string the std::string content was extracted from sample buffer
- Returns
- the value of the sample buffer's copy as T
- Exceptions
-
| error | ERR_INVALID_STATE if the sample buffer is not valid. |
- See also
- IsValid
◆ operator T&&()
template<typename T, typename Enable = void>
Return the content of sample buffer as a reference to the extracted non trivial value. i.e. if using std::string the std::string content was extracted from sample buffer
- Returns
- the value of the sample buffer as T
- Exceptions
-
| error | ERR_INVALID_STATE if the sample buffer is not valid. |
- See also
- IsValid
◆ operator*()
template<typename T, typename Enable = void>
Retrieves a reference to the data.
- Returns
- returns a reference to the copy of the sample data.
- Exceptions
-
| error | ERR_INVALID_STATE if the sample is not valid. |
◆ operator->() [1/2]
template<typename T, typename Enable = void>
Retrieves the pointer to the datas memory.
- Returns
- Returns the pointer to the copy of the sample data.
- Return values
-
◆ operator->() [2/2]
template<typename T, typename Enable = void>
Retrieves the pointer to the datas memory.
- Returns
- Returns the pointer to the copy of the sample data.
- Return values
-
◆ Reset() [1/2]
template<typename T, typename Enable = void>
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]
template<typename T, typename Enable = void>
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: