Pleora Technologies Inc. eBUS SDK v5.1.10.4642 API



PvChunkData Class Reference

Raw data interface to a PvBuffer. More...

Public Member Functions

uint64_t GetChunkDataPayloadLength () const
 Get the chunk data payload length specified in the trailer information of this block. More...
 
PvResult Alloc (uint32_t aMaximumChunkLength)
 Allocates memory for this PvChunkData. More...
 
void Free ()
 Frees (de-allocates) the buffer's internal memory.
 
PvResult Attach (void *aRawBuffer, uint32_t aMaximumChunkLength)
 Attach this PvChunkData to an external memory buffer. More...
 
uint8_t * Detach ()
 Releases an attached memory buffer. More...
 
PvResult AddChunk (uint32_t aID, const uint8_t *aData, uint32_t aLength)
 See PvBuffer::AddChunk. More...
 
uint32_t GetChunkCount ()
 See PvBuffer::GetChunkCount. More...
 
PvResult GetChunkIDByIndex (uint32_t aIndex, uint32_t &aID)
 See PvBuffer::GetChunkIDByIndex. More...
 
uint32_t GetChunkSizeByIndex (uint32_t aIndex)
 See PvBuffer::GetChunkSizeByIndex. More...
 
uint32_t GetChunkSizeByID (uint32_t aID)
 See PvBuffer::GetChunkSizeByID. More...
 
const uint8_t * GetChunkRawDataByIndex (uint32_t aIndex)
 See PvBuffer::GetChunkRawDataByIndex. More...
 
const uint8_t * GetChunkRawDataByID (uint32_t aID)
 See PvBuffer::GetChunkRawDataByID. More...
 
 PvChunkData (PvBufferLib::ChunkData *aChunkData)
 Constructor. More...
 
virtual ~PvChunkData ()
 Destructor. 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.

Constructor & Destructor Documentation

PvChunkData::PvChunkData ( PvBufferLib::ChunkData *  aChunkData)

Constructor.

Declared as protected as PvChunkData cannot be instantiated by the user.

A pointer to the PvChunkData interface can be obtained from a PvBuffer using PvChunkData::GetImage.

Parameters
[in]aChunkDataPointer to internal eBUS SDK class.
PvChunkData::~PvChunkData ( )
virtual

Destructor.

Declared as protected as the user does no need (or can) delete a PvChunkData directly.

Member Function Documentation

PvResult PvChunkData::AddChunk ( uint32_t  aID,
const uint8_t *  aData,
uint32_t  aLength 
)

See PvBuffer::AddChunk.

Same as PvBuffer equivalent. Provided with this interface for convenience.

Parameters
[in]aIDChunk data ID for aIndex.
[in]aDataPayload data of the chunk data.
[in]aLengthLength of the payload data of the chunk, in bytes. Must be a multiple of 4 bytes.
Returns
A PvResult is used to capture the success or failure of the operation:
PvResult PvChunkData::Alloc ( uint32_t  aMaximumChunkLength)

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:
PvResult PvChunkData::Attach ( void *  aRawBuffer,
uint32_t  aMaximumChunkLength 
)

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:
uint8_t * PvChunkData::Detach ( )

Releases an attached memory buffer.

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

Returns
The buffer's location in memory.
uint32_t PvChunkData::GetChunkCount ( )

See PvBuffer::GetChunkCount.

Same as PvBuffer equivalent. Provided with this interface for convenience.

Returns
Data chunks count. 0 if no chunks are available.
uint64_t PvChunkData::GetChunkDataPayloadLength ( ) const

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.
PvResult PvChunkData::GetChunkIDByIndex ( uint32_t  aIndex,
uint32_t &  aID 
)

See PvBuffer::GetChunkIDByIndex.

Same as PvBuffer equivalent. Provided with this interface for convenience.

Parameters
[in]aIndexData chunk index.
[out]aIDData chunk ID for aIndex.
Returns
A PvResult is used to captured the success or failure of the operation as 0 can be a valid chunk ID:
const uint8_t * PvChunkData::GetChunkRawDataByID ( uint32_t  aID)

See PvBuffer::GetChunkRawDataByID.

Same as PvBuffer equivalent. Provided with this interface for convenience.

If the aID chunk is not found or the PvBuffer does not have any chunks NULL is returned.

Parameters
[in]aIDData chunk ID.
Returns
Point to chunk data. NULL if the chunk ID is not found.
const uint8_t * PvChunkData::GetChunkRawDataByIndex ( uint32_t  aIndex)

See PvBuffer::GetChunkRawDataByIndex.

Same as PvBuffer equivalent. Provided with this interface for convenience.

Parameters
[in]aIndexData chunk index.
Returns
Point to chunk data. NULL if the index is out of range.
uint32_t PvChunkData::GetChunkSizeByID ( uint32_t  aID)

See PvBuffer::GetChunkSizeByID.

Same as PvBuffer equivalent. Provided with this interface for convenience.

Parameters
[in]aIDData chunk ID.
Returns
Data chunk size. 0 if the chunk ID is not found.
uint32_t PvChunkData::GetChunkSizeByIndex ( uint32_t  aIndex)

See PvBuffer::GetChunkSizeByIndex.

Same as PvBuffer equivalent. Provided with this interface for convenience.

Parameters
[in]aIndexData chunk index.
Returns
Data chunk size. 0 if the index is out of range.

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

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