Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvChunkData Class Referenceabstract

Raw data interface to a PvBuffer. More...

Public Member Functions

virtual uint64_t GetChunkDataPayloadLength () const =0
 Get the chunk data payload length specified in the trailer information of this block. More...
 
virtual PvResult Alloc (uint32_t aMaximumChunkLength)=0
 Allocates memory for this PvChunkData. More...
 
virtual void Free ()=0
 Frees (de-allocates) the buffer's internal memory.
 
virtual PvResult Attach (void *aRawBuffer, uint32_t aMaximumChunkLength)=0
 Attach this PvChunkData to an external memory buffer. More...
 
virtual uint8_t * Detach ()=0
 Releases an attached memory buffer. More...
 
- Public Member Functions inherited from IPvChunkData
virtual PvResult AddChunk (uint32_t aID, const uint8_t *aData, uint32_t aLength)=0
 See PvBuffer::AddChunk. More...
 
virtual void SetChunkLayoutID (uint32_t aChunkLayoutID)=0
 Set the chunk data layout ID. More...
 
virtual bool HasChunks () const =0
 Returns true if the buffer has data chunks. More...
 
virtual uint32_t GetChunkCount ()=0
 See PvBuffer::GetChunkCount. More...
 
virtual PvResult GetChunkIDByIndex (uint32_t aIndex, uint32_t &aID)=0
 See PvBuffer::GetChunkIDByIndex. More...
 
virtual uint32_t GetChunkSizeByIndex (uint32_t aIndex)=0
 See PvBuffer::GetChunkSizeByIndex. More...
 
virtual uint32_t GetChunkSizeByID (uint32_t aID)=0
 See PvBuffer::GetChunkSizeByID. More...
 
virtual const uint8_t * GetChunkRawDataByIndex (uint32_t aIndex)=0
 See PvBuffer::GetChunkRawDataByIndex. More...
 
virtual const uint8_t * GetChunkRawDataByID (uint32_t aID)=0
 See PvBuffer::GetChunkRawDataByID. More...
 
virtual uint32_t GetChunkLayoutID ()=0
 Get the chunk data layout ID. More...
 

Detailed Description

Raw data interface to a PvBuffer.

A PvBuffer represents a generic buffer with no specific payload type. If the payload type is chunk data, the user can obtain a pointer to a PvChunkData buffer interface through PvBuffer::GetChunkData.

This PvChunkData pointer is owned by the PvBuffer and does not need to be released after use. It is valid as long as the PvBuffer exists.

To use in a receiver context, retrieve PvBuffer from PvStream or PvPipeline and when PvBuffer::GetPayloadType is PvPayloadChunkData use PvBuffer::GetChunkData to retrieve a pointer to this interface. Use the various chunk methods in this class to access the chunk data by ID or index or alternatively attach the PvBuffer to the GenApi interface of the transmitter with PvGenParameterArray::AttachDataChunks to access the chunk data using GenApi.

To use in a transmitter context, create a PvBuffer, set its payload type to PvPayloadChunkData with SetPayloadType, use PvBuffer::GetChunkData to retrieve a point to this interface, use PvChunkData::Alloc to allocate enough memory for all chunks and their headers (64 bytes per chunk for the headers) and then add chunks to the buffer using PvChunkData::AddChunk. Use PvTransmitterGEV to transmit the buffer.

Member Function Documentation

◆ Alloc()

PvResult PvChunkData::Alloc ( uint32_t  aMaximumChunkLength)
pure virtual

Allocates memory for this PvChunkData.

Allocs a PvChunkData of specific payload length. No extra data can or need to be priovisioned for chunks as the whole payload is made of chunks.

Parameters
[in]aMaximumChunkLengthMaximum size in bytes to store chunk data (must include extra 64 bits for each chunk header).
Returns
Includes:

◆ Attach()

PvResult PvChunkData::Attach ( void *  aRawBuffer,
uint32_t  aMaximumChunkLength 
)
pure virtual

Attach this PvChunkData to an external memory buffer.

Parameters
[in]aRawBufferA pointer to the buffer.
[in]aMaximumChunkLengthAttached buffer size: chunk length sum + 64 bits for each chunk header.
Returns
Includes:

◆ Detach()

uint8_t * PvChunkData::Detach ( )
pure virtual

Releases an attached memory buffer.

Does nothing other then resetting the memory buffer pointer to NULL.

Returns
The buffer's location in memory.

◆ GetChunkDataPayloadLength()

uint64_t PvChunkData::GetChunkDataPayloadLength ( ) const
pure virtual

Get the chunk data payload length specified in the trailer information of this block.

Returns
The payload length specified in the trailer information of this block.

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

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com