Raw data interface to a PvBuffer. More...
Public Member Functions | |
uint64_t | GetPayloadLength () const |
Get the payload length specified in the leader information of this block. More... | |
PvResult | Alloc (uint64_t aPayloadLength, uint32_t aMaximumChunkLength=0) |
Allocates memory for this PvRawData. More... | |
void | Free () |
Frees (de-allocates) the buffer's internal memory. More... | |
PvResult | Attach (void *aRawBuffer, uint64_t aPayloadLength, uint32_t aMaximumChunkLength=0) |
Attach this PvRawData to an external memory buffer. More... | |
uint8_t * | Detach () |
Releases an attached memory buffer. More... | |
Protected Member Functions | |
PvRawData (PvBufferLib::RawData *aRawData) | |
Constructor. More... | |
virtual | ~PvRawData () |
Destructor. More... | |
Raw data interface to a PvBuffer.
A PvBuffer represents a generic buffer with no specific payload type. If the payload type is raw data, the user can obtain a pointer to a PvRawData buffer interface through PvBuffer::GetRawData.
This PvRawData pointer is owned by the PvBuffer and does not need to be released after use. It is valid as long as the PvBuffer exists.
|
protected |
Constructor.
Declared as protected as PvRawData cannot be instantiated by the user.
A pointer to the PvRawData interface can be obtained from a PvBuffer using PvBuffer::GetImage.
[in] | aRawData | Pointer to internal eBUS SDK class. |
|
protectedvirtual |
Destructor.
Declared as protected as the user does no need (or can) delete a PvRawData directly.
PvResult PvRawData::Alloc | ( | uint64_t | aPayloadLength, |
uint32_t | aMaximumChunkLength = 0 |
||
) |
Allocates memory for this PvRawData.
Allocs a PvRawData of specific payload length
[in] | aPayloadLength | The payload length of the raw data, in pixels. See GetPayloadLength. |
[in] | aMaximumChunkLength | Maximum size in bytes to store chunks ( must include extra 64 bits by chunks for headers ). |
PvResult PvRawData::Attach | ( | void * | aRawBuffer, |
uint64_t | aPayloadLength, | ||
uint32_t | aMaximumChunkLength = 0 |
||
) |
Attach this PvRawData to an external memory buffer.
This method is identical to Alloc(uint64_t,uint32_t), with the following exceptions:
[in] | aRawBuffer | A pointer to the buffer. |
[in] | aPayloadLength | The payload length of the raw data, in pixels. See GetPayloadLength. |
[in] | aMaximumChunkLength | See Alloc(uint64_t,uint32_t). |
uint8_t * PvRawData::Detach | ( | ) |
Releases an attached memory buffer.
Does nothing other then resetting the memory buffer pointer to NULL.
void PvRawData::Free | ( | ) |
Frees (de-allocates) the buffer's internal memory.
uint64_t PvRawData::GetPayloadLength | ( | ) | const |
Get the payload length specified in the leader information of this block.
If you wish to construct a buffer with payload type "Raw Data", simply call PvRawData::Alloc or PvRawData::Attach and the payload length field will be set automatically at the time the block is transmitted.
Copyright (c) 2002-2018 Pleora Technologies Inc.
www.pleora.com