00001 00004 #ifndef RAZORBACK_BLOCK_POOL_H 00005 #define RAZORBACK_BLOCK_POOL_H 00006 #include <razorback/visibility.h> 00007 #include <razorback/types.h> 00008 #include <razorback/api.h> 00009 00010 #ifdef __cplusplus 00011 extern "C" { 00012 #endif 00013 00017 #define BLOCK_POOL_STATUS_MASK 0x000000FF ///< Mask for status bits. 00018 #define BLOCK_POOL_STATUS_COLLECTING 0x00000001 ///< Collector is adding data 00019 #define BLOCK_POOL_STATUS_FINALIZED 0x00000002 ///< Collector finished adding data 00020 #define BLOCK_POOL_STATUS_CHECK_GLOBAL_CACHE 0x00000004 ///< Waiting for GC Check 00021 #define BLOCK_POOL_STATUS_CHECKING_GLOBAL_CACHE 0x00000008 ///< Waiting for GC Check 00022 #define BLOCK_POOL_STATUS_SUBMIT_DATA 0x00000010 ///< Submit block 00023 #define BLOCK_POOL_STATUS_PAGED 0x00000011 ///< Block is currently paging out 00024 #define BLOCK_POOL_STATUS_DESTROY 0x00000012 ///< Destroy this item 00025 00026 #define BLOCK_POOL_FLAG_MASK 0xFF000000 ///< Mask for Flags bits 00027 #define BLOCK_POOL_FLAG_MAY_REUSE 0x01000000 ///< This item should not be fully removed from the pool 00028 #define BLOCK_POOL_FLAG_UPDATE 0x02000000 ///< This item is being submitted as an update. 00029 #define BLOCK_POOL_FLAG_EVENT_ONLY 0x04000000 ///< This item is being submitted with no block data. 00030 00032 00033 #define BLOCK_POOL_DATA_FLAG_FILE 0x01 ///< Data block is mapped to a file 00034 #define BLOCK_POOL_DATA_FLAG_MALLOCD 0x02 ///< Data block is malloc'd 00035 #define BLOCK_POOL_DATA_FLAG_MANAGED 0x04 ///< Data block is managed by the user 00036 00037 00038 00042 SO_PUBLIC extern struct BlockPoolItem *BlockPool_CreateItem (struct RazorbackContext *p_pContext); 00043 00049 SO_PUBLIC extern bool BlockPool_SetItemDataType(struct BlockPoolItem *p_pItem, char * p_sName); 00050 00058 SO_PUBLIC extern bool BlockPool_AddData (struct BlockPoolItem *p_pItem, uint8_t * p_pData, 00059 uint32_t p_iLength, int p_iFlags); 00060 SO_PUBLIC extern bool BlockPool_AddData_FromFile(struct BlockPoolItem *item, char *fileName, bool tempFile); 00061 00066 SO_PUBLIC extern bool BlockPool_FinalizeItem (struct BlockPoolItem *p_pItem); 00067 00072 SO_PUBLIC extern bool BlockPool_DestroyItem (struct BlockPoolItem *p_pItem); 00073 00082 SO_PUBLIC extern bool 00083 BlockPool_MetaData_Add(struct BlockPoolItem *block, 00084 uuid_t uuidName, uuid_t uuidType, 00085 uint8_t *data, uint32_t size); 00086 #ifdef __cplusplus 00087 } 00088 #endif 00089 #endif