Default Sample implementation.
More...
#include <default_sample.h>
|
| void | setTimeStamp (std::chrono::nanoseconds time_stamp) override |
| | Set the Time Stamp.
|
| |
| void | setSubStreamId (uint32_t substream_id) override |
| | Set the Sub Stream Id, if needed.
|
| |
| void | setFlags (uint32_t flags) override |
| | Set the Flags.
|
| |
| void * | beginBufferWrite (size_t size) override |
| | allocates the memory buffer for sample data
|
| |
| void | endBufferWrite () override |
| | ends writing to the memory allocated with beginBufferWrite
|
| |
| void | addInfo (uint32_t key, DataType type, uint64_t raw_bytes) override |
| | Adds a additional sample information.
|
| |
| std::chrono::nanoseconds | getTimeStamp () const override |
| | Get the Time Stamp.
|
| |
| uint32_t | getSubStreamId () const override |
| | Get the Sub Stream Id if set.
|
| |
| uint32_t | getFlags () const override |
| | Get the Flags.
|
| |
| std::pair< const void *, size_t > | beginBufferRead () const override |
| | Retrieve a pointer to the memory buffer for user data and size in bytes.
|
| |
| void | endBufferRead () const override |
| | Ends reading from memory buffer retruned by beginBufferRead.
|
| |
| void | iterateInfo (std::function< void(uint32_t key, DataType type, uint64_t raw_bytes)> functor) const override |
| | iterates all additional data information (if any) by calling the functor
|
| |
| void | CopyFrom (const std::shared_ptr< const Sample > &sample) override |
| |
| const std::unordered_map< uint32_t, std::pair< DataType, uint64_t > > & | GetInfo () const |
| | Get the additional sample information.
|
| |
| template<typename T> |
| void | setContent (const T &value) |
| | Set the Content of the sample for trivially copyable types.
|
| |
| template<typename T> |
| T | getContent () const |
| | Get the Content of the sample for trivially copyable types.
|
| |
|
virtual | ~Sample ()=default |
| | DTOR.
|
| |
|
virtual | ~StreamItem ()=default |
| | DTOR.
|
| |
Default Sample implementation.
◆ addInfo()
| void adtf_file::DefaultSample::addInfo |
( |
uint32_t | key, |
|
|
DataType | type, |
|
|
uint64_t | raw_bytes ) |
|
overridevirtual |
Adds a additional sample information.
- Parameters
-
| key | key for the sample information |
| type | data type of the information |
| raw_bytes | the raw value of the information |
Implements adtf_file::ReadSample.
◆ beginBufferRead()
| std::pair< const void *, size_t > adtf_file::DefaultSample::beginBufferRead |
( |
| ) |
const |
|
overridevirtual |
Retrieve a pointer to the memory buffer for user data and size in bytes.
- Returns
- std::pair<const void*, size_t>
Implements adtf_file::WriteSample.
◆ beginBufferWrite()
| void * adtf_file::DefaultSample::beginBufferWrite |
( |
size_t | size | ) |
|
|
overridevirtual |
allocates the memory buffer for sample data
- Parameters
-
| size | the memory to allocate in bytes |
- Returns
- void* the pointer to the memory
Implements adtf_file::ReadSample.
◆ CopyFrom()
| void adtf_file::DefaultSample::CopyFrom |
( |
const std::shared_ptr< const Sample > & | sample | ) |
|
|
overridevirtual |
Copies all information from the given sample to the current instance.
- Parameters
-
| sample | The sample to copy from. |
Implements adtf_file::SampleCopy.
◆ endBufferRead()
| void adtf_file::DefaultSample::endBufferRead |
( |
| ) |
const |
|
overridevirtual |
◆ endBufferWrite()
| void adtf_file::DefaultSample::endBufferWrite |
( |
| ) |
|
|
overridevirtual |
◆ getContent()
template<typename T>
| T adtf_file::DefaultSample::getContent |
( |
| ) |
const |
|
inline |
Get the Content of the sample for trivially copyable types.
- Template Parameters
-
| T | the type of the value trivially copyable |
- Returns
- const T& reference to the value
◆ getFlags()
| uint32_t adtf_file::DefaultSample::getFlags |
( |
| ) |
const |
|
overridevirtual |
◆ GetInfo()
| const std::unordered_map< uint32_t, std::pair< DataType, uint64_t > > & adtf_file::DefaultSample::GetInfo |
( |
| ) |
const |
Get the additional sample information.
- Returns
- a reference to the unordered map with value key and a adtf_file::Datatype - raw value pair
◆ getSubStreamId()
| uint32_t adtf_file::DefaultSample::getSubStreamId |
( |
| ) |
const |
|
overridevirtual |
◆ getTimeStamp()
| std::chrono::nanoseconds adtf_file::DefaultSample::getTimeStamp |
( |
| ) |
const |
|
overridevirtual |
◆ iterateInfo()
| void adtf_file::DefaultSample::iterateInfo |
( |
std::function< void(uint32_t key, DataType type, uint64_t raw_bytes)> | functor | ) |
const |
|
overridevirtual |
iterates all additional data information (if any) by calling the functor
- Parameters
-
| functor | the function to call for each addition sample info value |
Implements adtf_file::WriteSample.
◆ setContent()
template<typename T>
| void adtf_file::DefaultSample::setContent |
( |
const T & | value | ) |
|
|
inline |
Set the Content of the sample for trivially copyable types.
- Template Parameters
-
| T | the type of the value trivially copyable |
- Parameters
-
◆ setFlags()
| void adtf_file::DefaultSample::setFlags |
( |
uint32_t | flags | ) |
|
|
overridevirtual |
◆ setSubStreamId()
| void adtf_file::DefaultSample::setSubStreamId |
( |
uint32_t | substream_id | ) |
|
|
overridevirtual |
◆ setTimeStamp()
| void adtf_file::DefaultSample::setTimeStamp |
( |
std::chrono::nanoseconds | time_stamp | ) |
|
|
overridevirtual |
The documentation for this class was generated from the following file: