Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Sparse Vector

Functions

static void ** spv_new_row (ocs_os_handle_t os, uint32_t rowcount)
 Allocate a new sparse vector row. More...
 
static void _spv_del (ocs_os_handle_t os, void **a, uint32_t n, uint32_t depth)
 Delete row recursively. More...
 
void spv_del (sparse_vector_t spv)
 Delete a sparse vector. More...
 
sparse_vector_t spv_new (ocs_os_handle_t os)
 Instantiate a new sparse vector object. More...
 
static void * spv_new_cell (sparse_vector_t sv, uint32_t idx, uint8_t alloc_new_rows)
 Return the address of a cell. More...
 
void spv_set (sparse_vector_t sv, uint32_t idx, void *value)
 Set the sparse vector cell value. More...
 
void * spv_get (sparse_vector_t sv, uint32_t idx)
 Return the sparse vector cell value. More...
 

Function Details

static void _spv_del ( ocs_os_handle_t  os,
void **  a,
uint32_t  n,
uint32_t  depth 
)
static

Delete row recursively.

Description
This function recursively deletes the rows in this sparse vector
Parameters
osOS handle
aPointer to the row.
nNumber of elements in the row.
depthDepth of deleting.
Returns
None.

Definition at line 128 of file spv.c.

void spv_del ( sparse_vector_t  spv)

Delete a sparse vector.

Description
The sparse vector is freed.
Parameters
spvPointer to the sparse vector object.

Definition at line 153 of file spv.c.

void* spv_get ( sparse_vector_t  sv,
uint32_t  idx 
)

Return the sparse vector cell value.

Description
Returns the value at idx.
Parameters
svPointer to the sparse vector.
idxIndex of which to return the value.
Returns
Returns the cell value, or NULL.

Definition at line 279 of file spv.c.

sparse_vector_t spv_new ( ocs_os_handle_t  os)

Instantiate a new sparse vector object.

Description
A new sparse vector is allocated.
Parameters
osOS handle
Returns
Returns the pointer to the sparse vector, or NULL.

Definition at line 173 of file spv.c.

static void* spv_new_cell ( sparse_vector_t  sv,
uint32_t  idx,
uint8_t  alloc_new_rows 
)
static

Return the address of a cell.

Description
Returns the address of a cell, allocates sparse rows as needed if the alloc_new_rows parameter is set.
Parameters
svPointer to the sparse vector.
idxIndex of which to return the address.
alloc_new_rowsIf TRUE, then new rows may be allocated to set values, Set to FALSE for retrieving values.
Returns
Returns the pointer to the cell, or NULL.

Definition at line 208 of file spv.c.

static void** spv_new_row ( ocs_os_handle_t  os,
uint32_t  rowcount 
)
static

Allocate a new sparse vector row.

Parameters
osOS handle
rowcountCount of rows.
Description
A new sparse vector row is allocated.
Parameters
rowcountNumber of elements in a row.
Returns
Returns the pointer to a row.

Definition at line 67 of file spv.c.

void spv_set ( sparse_vector_t  sv,
uint32_t  idx,
void *  value 
)

Set the sparse vector cell value.

Description
Sets the sparse vector at idx to value.
Parameters
svPointer to the sparse vector.
idxIndex of which to store.
valueValue to store.
Returns
None.

Definition at line 258 of file spv.c.