Class PvChunkData
Raw data interface to a PvBuffer.
Implements
Inherited Members
Namespace: eBUSDotNet
Assembly: eBUSDotNet.dll
Syntax
public class PvChunkData : IPvChunkData, IDisposable
Remarks
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.
Properties
View SourceChunkDataPayloadLength
Chunk data payload length of PvChunkData.
Declaration
public ulong ChunkDataPayloadLength { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
Methods
View SourceAlloc(uint)
Allocates memory for this #PvChunkData.
Declaration
public virtual PvResult Alloc(uint aMaximumChunkLength)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aMaximumChunkLength | Maximum size in bytes to store chunk data (must include extra 64 bits for each chunk header). |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Attach(byte[], uint)
Attach this #PvChunkData to an external memory buffer.
Declaration
public PvResult Attach(byte[] aRawBuffer, uint aMaximumChunkLength)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | aRawBuffer | A pointer to the buffer. |
| uint | aMaximumChunkLength | Attached buffer size: chunk length sum + 64 bits for each chunk header. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Detach()
Releases an attached memory buffer.
Declaration
public virtual byte* Detach()
Returns
| Type | Description |
|---|---|
| byte* | The buffer's location in memory. |
Dispose(bool)
Dispose
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
View SourceFree()
Frees (de-allocates) the buffer's internal memory.
Declaration
public virtual void Free()