Classes | Typedefs | Functions
sbgSplitBuffer.h File Reference

Helper methods used to handle a splittable buffer. More...

#include <sbgCommon.h>
Include dependency graph for sbgSplitBuffer.h:
This graph shows which files directly or indirectly include this file:

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)
 

Detailed Description

Helper methods used to handle a splittable buffer.

Author
SBG Systems (Maxime Renaudet)
Date
19 November 2013

Copyright Notice

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 Documentation

Defines the ECom transfer states

Function Documentation

SBG_INLINE void* sbgSplitBufferGetSubBuffer ( const SbgSplitBuffer pSplitBuffer,
size_t  subBufferIdx 
)

Get one sub buffer given its index.

Parameters
[in]pSplitBufferValid pointer to a Split Buffer instance.
[in]subBufferIdxIndex of the sub buffer required.
Returns
Pointer to the sub buffer or NULL if the subBuffer index is invalid.

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.

Parameters
[in]pSplitBufferValid pointer to a Split Buffer instance.
Returns
The number of sub buffer the buffer has or 0 if there is an error.

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.

Parameters
[in]pSplitBufferValid pointer to a Split Buffer instance.
[in]subBufferIdxIndex of the sub buffer required.
Returns
Offset to the sub buffer or 0 if the subBuffer index is invalid.

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.

Parameters
[in]pSplitBufferValid pointer to a Split Buffer instance.
[in]subBufferIdxIndex of the sub buffer required.
Returns
The size of the sub buffer of index subBufferIdx, or 0 if the subBuffer index is invalid.

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.

Parameters
[in]pSplitBufferPointer to an allocated split buffer instance.
[in]pBufferThe buffer that needs to be split (doesn't take the ownership).
[in]bufferSizeThe total size of the buffer in bytes.
[in]subBufferSizeThe 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.

Parameters
[in]pSplitBufferPointer to an allocated split buffer instance.
[in]pBufferThe buffer that needs to be split (doesn't take the ownership).
[in]bufferSizeThe total size of the buffer in bytes.
[in]subBufferSizeThe size of each sub buffer in bytes.

Definition at line 86 of file sbgSplitBuffer.h.



sbg_driver
Author(s):
autogenerated on Sun Jan 27 2019 03:42:20