VRS
A file format for sensor data.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
vrs::NonContiguousChunk Class Referencefinal

Class to represent a data chunk composed of multiple smaller chunks that each have fixed offsets from each other in memory. More...

#include <DataSource.h>

Inheritance diagram for vrs::NonContiguousChunk:
vrs::DataSourceChunk

Public Member Functions

 NonContiguousChunk (const void *data, size_t blockSize, size_t numBlocks, size_t strideInBytes)
 
void fillAndAdvanceBuffer (uint8_t *&buffer) const final
 
- Public Member Functions inherited from vrs::DataSourceChunk
 DataSourceChunk (const DataSourceChunk &other)=delete
 Not copyable as there are derived classes that aren't safe to copy from the base class.
 
const DataSourceChunkoperator= (const DataSourceChunk &other)=delete
 
 DataSourceChunk ()
 Empty DataSourceChunk.
 
 DataSourceChunk (const void *_data, size_t _size)
 Constructor for a raw pointer + size.
 
template<typename T >
 DataSourceChunk (const vector< T > &vectorT)
 Constructor for a vector<T> of objects of POD type T.
 
template<typename T , std::enable_if_t< std::is_trivially_copyable< T >::value, int > = 0, typename = typename std::enable_if<!is_pointer<T>::value, T>::type>
 DataSourceChunk (const T &object)
 Constructor for a trivially copyable type T.
 
const void * data () const
 
size_t size () const
 For performance, do not make this method virtual.
 

Detailed Description

Class to represent a data chunk composed of multiple smaller chunks that each have fixed offsets from each other in memory.

Constructor & Destructor Documentation

◆ NonContiguousChunk()

vrs::NonContiguousChunk::NonContiguousChunk ( const void *  data,
size_t  blockSize,
size_t  numBlocks,
size_t  strideInBytes 
)
Parameters
datastart of the buffer.
blockSizenumber of useful bytes in each block of data.
numBlocksnumber of blocks.
strideInBytesnumber of bytes between the first byte of consecutive blocks. (strideInBytes - blockSize) is the number of bytes to skip between blocks, therefore strideInBytes should be greater than blockSize.

Member Function Documentation

◆ fillAndAdvanceBuffer()

void vrs::NonContiguousChunk::fillAndAdvanceBuffer ( uint8_t *&  buffer) const
finalvirtual

Copy the data (if any), and update the provided buffer pointer accordingly. The number of bytes copied must be the exact size specified in the constructor.

Reimplemented from vrs::DataSourceChunk.


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