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.

SASIndexEnum_t ndxenum;
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);
}
}
SASIndexEnumDestroy (ndxenum);
}
SASIndexEnumCreate
__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.
SASIndexEnumHasMore
__C__ int SASIndexEnumHasMore(SASIndexEnum_t indexenum)
Return status of a SASIndexEnum_t enumeration.
SASIndexEnum_t
void * SASIndexEnum_t
Handle to an instance of binary BTree Index Enumeration.
Definition: sasindexenum.h:59
SASIndexEnumDestroy
__C__ void SASIndexEnumDestroy(SASIndexEnum_t indexenum)
Destroy an instance of SASIndexEnum_t enumeration.
SASStringBTreeEnumNext
__C__ void * SASStringBTreeEnumNext(SASStringBTreeEnum_t sbtenum)
Move the enumeration to the next String BTree key entry and return the associated address value.

## Typedef Documentation

## SASIndexEnum_t

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

## SASIndexEnumCreate()

__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.

## SASIndexEnumDestroy()

__C__ void SASIndexEnumDestroy | ( | SASIndexEnum_t | indexenum | ) |

Destroy an instance of SASIndexEnum_t enumeration.

    @param indexenum binary BTree index enumeration to be destroyed.

## SASIndexEnumHasMore()

__C__ int SASIndexEnumHasMore | ( | SASIndexEnum_t | indexenum | ) |

Return status of a SASIndexEnum_t enumeration.

    @param indexenum binary BTree Index enumeration.
    @return True if this enumeration has more entries.

## SASIndexEnumNext()

__C__ void * SASIndexEnumNext | ( | SASIndexEnum_t | indexenum | ) |

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

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

## SASIndexEnumNext_nolock()

__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.