Helper methods used to handle a splittable buffer. More...
#include <sbgCommon.h>
Go to the source code of this file.
Classes | |
struct | _SbgSplitBuffer |
Typedefs | |
typedef struct _SbgSplitBuffer | SbgSplitBuffer |
Functions | |
SBG_INLINE void * | sbgSplitBufferGetSubBuffer (const SbgSplitBuffer *pSplitBuffer, size_t subBufferIdx) |
SBG_INLINE size_t | sbgSplitBufferGetSubBufferNbr (const SbgSplitBuffer *pSplitBuffer) |
SBG_INLINE size_t | sbgSplitBufferGetSubBufferOffset (const SbgSplitBuffer *pSplitBuffer, size_t subBufferIdx) |
SBG_INLINE size_t | sbgSplitBufferGetSubBufferSize (const SbgSplitBuffer *pSplitBuffer, size_t subBufferIdx) |
SBG_INLINE void | sbgSplitBufferInitForRead (SbgSplitBuffer *pSplitBuffer, const void *pBuffer, size_t bufferSize, size_t subBufferSize) |
SBG_INLINE void | sbgSplitBufferInitForWrite (SbgSplitBuffer *pSplitBuffer, void *pBuffer, size_t bufferSize, size_t subBufferSize) |
Helper methods used to handle a splittable buffer.
Copyright (C) 2007-2013, SBG Systems SAS. All rights reserved.
This source code is intended for use only by SBG Systems SAS and those that have explicit written permission to use it from SBG Systems SAS.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
Definition in file sbgSplitBuffer.h.
typedef struct _SbgSplitBuffer SbgSplitBuffer |
Defines the ECom transfer states
SBG_INLINE void* sbgSplitBufferGetSubBuffer | ( | const SbgSplitBuffer * | pSplitBuffer, |
size_t | subBufferIdx | ||
) |
Get one sub buffer given its index.
[in] | pSplitBuffer | Valid pointer to a Split Buffer instance. |
[in] | subBufferIdx | Index of the sub buffer required. |
Definition at line 130 of file sbgSplitBuffer.h.
SBG_INLINE size_t sbgSplitBufferGetSubBufferNbr | ( | const SbgSplitBuffer * | pSplitBuffer | ) |
Returns the number of sub buffers that compose the whole buffer.
[in] | pSplitBuffer | Valid pointer to a Split Buffer instance. |
Definition at line 111 of file sbgSplitBuffer.h.
SBG_INLINE size_t sbgSplitBufferGetSubBufferOffset | ( | const SbgSplitBuffer * | pSplitBuffer, |
size_t | subBufferIdx | ||
) |
Return the offset in bytes of a sub buffer from the start of the buffer.
[in] | pSplitBuffer | Valid pointer to a Split Buffer instance. |
[in] | subBufferIdx | Index of the sub buffer required. |
Definition at line 162 of file sbgSplitBuffer.h.
SBG_INLINE size_t sbgSplitBufferGetSubBufferSize | ( | const SbgSplitBuffer * | pSplitBuffer, |
size_t | subBufferIdx | ||
) |
Get the size of a sub buffer given its index.
[in] | pSplitBuffer | Valid pointer to a Split Buffer instance. |
[in] | subBufferIdx | Index of the sub buffer required. |
Definition at line 194 of file sbgSplitBuffer.h.
SBG_INLINE void sbgSplitBufferInitForRead | ( | SbgSplitBuffer * | pSplitBuffer, |
const void * | pBuffer, | ||
size_t | bufferSize, | ||
size_t | subBufferSize | ||
) |
Initialize a split buffer for read operations.
[in] | pSplitBuffer | Pointer to an allocated split buffer instance. |
[in] | pBuffer | The buffer that needs to be split (doesn't take the ownership). |
[in] | bufferSize | The total size of the buffer in bytes. |
[in] | subBufferSize | The size of each sub buffer in bytes. |
Definition at line 59 of file sbgSplitBuffer.h.
SBG_INLINE void sbgSplitBufferInitForWrite | ( | SbgSplitBuffer * | pSplitBuffer, |
void * | pBuffer, | ||
size_t | bufferSize, | ||
size_t | subBufferSize | ||
) |
Initialize a split buffer for write operations.
[in] | pSplitBuffer | Pointer to an allocated split buffer instance. |
[in] | pBuffer | The buffer that needs to be split (doesn't take the ownership). |
[in] | bufferSize | The total size of the buffer in bytes. |
[in] | subBufferSize | The size of each sub buffer in bytes. |
Definition at line 86 of file sbgSplitBuffer.h.