Shared Persistent Heap Data Environment Manual  1.1.0
Macros | Typedefs | Functions
sasindexenum.h File Reference

Enumeration API for iteration over Shared Address Space binary B-tree index defined in sasindex.h. For use by shared memory multi-thread/multi-core applications. More...

#include "sastype.h"
#include "sasindex.h"

Go to the source code of this file.

Typedefs

typedef void * SASIndexEnum_t
 Handle to an instance of binary BTree Index Enumeration. More...
 

Functions

__C__ SASIndexEnum_t SASIndexEnumCreate (SASIndex_t btree)
 Create a SASIndexEnum_t enumeration that can be used to iterate over the key space of a SASIndex_t. More...
 
__C__ void SASIndexEnumDestroy (SASIndexEnum_t indexenum)
 Destroy an instance of SASIndexEnum_t enumeration. More...
 
__C__ int SASIndexEnumHasMore (SASIndexEnum_t indexenum)
 Return status of a SASIndexEnum_t enumeration. More...
 
__C__ void * SASIndexEnumNext (SASIndexEnum_t indexenum)
 Move the enumeration to the next binary BTree Index key entry and return the associated address value. More...
 
__C__ void * SASIndexEnumNext_nolock (SASIndexEnum_t indexenum)
 Move the enumeration to the next binary BTree Index key entry and return the associated address value. More...
 

Detailed Description

Enumeration API for iteration over Shared Address Space binary B-tree index defined in sasindex.h. For use by shared memory multi-thread/multi-core applications.

Create enumerations that manage iterations over the keys and associated values of sasindex.h. Iteration is in key order from minimum to maximum contained keys.

senum = SASIndexEnumCreate (index);
if (ndxenum)
{
while (SASIndexEnumHasMore (ndxenum))
{
void *addr_val;
char *key;
addr_val = SASStringBTreeEnumNext (ndxenum);
if (addr_val)
{
printf ("Indexed Value<%p>\n", addr_value);
}
}
}

Typedef Documentation

typedef void* SASIndexEnum_t

Handle to an instance of binary BTree Index Enumeration.

Enumerations are allocated from dynamic (malloc) storage and can not be shared with other processes. This allows multiple threads, each with their own enumeration, to safely iterate over a shared binary BTree index.

Function Documentation

__C__ SASIndexEnum_t SASIndexEnumCreate ( SASIndex_t  btree)

Create a SASIndexEnum_t enumeration that can be used to iterate over the key space of a SASIndex_t.

Create binary BTree enumeration for the specific binary BTree Index. The program can then use the SASIndexEnum API to iterate over this key space and retrieve the associated address values.

@param btree SASIndex_t to create the name enumeration for.
@return SASIndexEnum_t enumeration pointer,
NULL is returned for failure cases.
__C__ void SASIndexEnumDestroy ( SASIndexEnum_t  indexenum)

Destroy an instance of SASIndexEnum_t enumeration.

Parameters
indexenumbinary BTree index enumeration to be destroyed.
__C__ int SASIndexEnumHasMore ( SASIndexEnum_t  indexenum)

Return status of a SASIndexEnum_t enumeration.

Parameters
indexenumbinary BTree Index enumeration.
Returns
True if this enumeration has more entries.
__C__ void* SASIndexEnumNext ( SASIndexEnum_t  indexenum)

Move the enumeration to the next binary BTree Index key entry and return the associated address value.

Parameters
indexenumbinary BTree enumeration.
Returns
the address value associated for the next String BTree enumeration.
__C__ void* SASIndexEnumNext_nolock ( SASIndexEnum_t  indexenum)

Move the enumeration to the next binary BTree Index key entry and return the associated address value.

This nolock form should only be used when the referenced SASIndex_t is known to be locked by the application or contained within a larger structure with a controlling lock.

@param indexenum binary BTree enumeration.
@return the address value associated for the next String BTree enumeration.