include/razorback/block_pool.h File Reference

Data block storage pool. More...

#include <razorback/visibility.h>
#include <razorback/types.h>
#include <razorback/api.h>
Include dependency graph for block_pool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define BLOCK_POOL_DATA_FLAG_FILE   0x01
 Data block is mapped to a file.
#define BLOCK_POOL_DATA_FLAG_MALLOCD   0x02
 Data block is malloc'd.
#define BLOCK_POOL_DATA_FLAG_MANAGED   0x04
 Data block is managed by the user.

#define BLOCK_POOL_STATUS_MASK   0x000000FF
 Block Pool Item States.
#define BLOCK_POOL_STATUS_COLLECTING   0x00000001
 Collector is adding data.
#define BLOCK_POOL_STATUS_FINALIZED   0x00000002
 Collector finished adding data.
#define BLOCK_POOL_STATUS_CHECK_GLOBAL_CACHE   0x00000004
 Waiting for GC Check.
#define BLOCK_POOL_STATUS_CHECKING_GLOBAL_CACHE   0x00000008
 Waiting for GC Check.
#define BLOCK_POOL_STATUS_SUBMIT_DATA   0x00000010
 Submit block.
#define BLOCK_POOL_STATUS_PAGED   0x00000011
 Block is currently paging out.
#define BLOCK_POOL_STATUS_DESTROY   0x00000012
 Destroy this item.
#define BLOCK_POOL_FLAG_MASK   0xFF000000
 Mask for Flags bits.
#define BLOCK_POOL_FLAG_MAY_REUSE   0x01000000
 This item should not be fully removed from the pool.
#define BLOCK_POOL_FLAG_UPDATE   0x02000000
 This item is being submitted as an update.
#define BLOCK_POOL_FLAG_EVENT_ONLY   0x04000000
 This item is being submitted with no block data.

Functions

SO_PUBLIC struct BlockPoolItemBlockPool_CreateItem (struct RazorbackContext *p_pContext)
 Create a new item in the pool.
SO_PUBLIC bool BlockPool_SetItemDataType (struct BlockPoolItem *p_pItem, char *p_sName)
 Add data to a item in the block pool.
SO_PUBLIC bool BlockPool_AddData (struct BlockPoolItem *p_pItem, uint8_t *p_pData, uint32_t p_iLength, int p_iFlags)
 Add data to a item in the block pool.
SO_PUBLIC bool BlockPool_AddData_FromFile (struct BlockPoolItem *item, char *fileName, bool tempFile)
SO_PUBLIC bool BlockPool_FinalizeItem (struct BlockPoolItem *p_pItem)
 Finalize the block pool item for submission.
SO_PUBLIC bool BlockPool_DestroyItem (struct BlockPoolItem *p_pItem)
 Remove an item from the block pool.
SO_PUBLIC bool BlockPool_MetaData_Add (struct BlockPoolItem *block, uuid_t uuidName, uuid_t uuidType, uint8_t *data, uint32_t size)
 Add MetaData to a block pool item.

Detailed Description

Data block storage pool.


Define Documentation

#define BLOCK_POOL_STATUS_MASK   0x000000FF

Block Pool Item States.

Mask for status bits.


Function Documentation

SO_PUBLIC bool BlockPool_AddData ( struct BlockPoolItem p_pItem,
uint8_t *  p_pData,
uint32_t  p_iLength,
int  p_iFlags 
)

Add data to a item in the block pool.

Parameters:
*p_pItem the item to add data to.
*p_pData the data to add.
p_iLength the length of the data to add.
p_iFlags the data block flags
Returns:
true on success false on error.
SO_PUBLIC struct BlockPoolItem* BlockPool_CreateItem ( struct RazorbackContext p_pContext  )  [read]

Create a new item in the pool.

Returns:
NULL on error or a pointer to a BlockPoolItem
SO_PUBLIC bool BlockPool_DestroyItem ( struct BlockPoolItem p_pItem  ) 

Remove an item from the block pool.

Parameters:
*p_pItem the item to remove.
Returns:
true on success false on error.
SO_PUBLIC bool BlockPool_FinalizeItem ( struct BlockPoolItem p_pItem  ) 

Finalize the block pool item for submission.

Parameters:
*p_pItem the item to finalize @ return true on success false on failure.
SO_PUBLIC bool BlockPool_MetaData_Add ( struct BlockPoolItem block,
uuid_t  uuidName,
uuid_t  uuidType,
uint8_t *  data,
uint32_t  size 
)

Add MetaData to a block pool item.

Parameters:
block The block pool item to add metadata to.
uuidName The UUID of the metadata name
uuidType The UUID of the metadata data type.
data The data
size The size of the data.
Returns:
true on success false on error.
SO_PUBLIC bool BlockPool_SetItemDataType ( struct BlockPoolItem p_pItem,
char *  p_sName 
)

Add data to a item in the block pool.

Parameters:
*p_pItem the item to add data to.
*p_sName the data type name
Returns:
true on success false on error.
 All Data Structures Files Functions Variables Enumerations Enumerator Defines
Generated on Sun Dec 9 04:00:11 2012 for RazorbackAPI by  doxygen 1.6.3