EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Classes | Typedefs | Enumerations | Functions
bucketLib.h File Reference

A hash table. Do not use for new code. More...

#include "errMdef.h"
#include "epicsTypes.h"
#include "libComAPI.h"
Include dependency graph for bucketLib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ITEM
 Internal: bucket item structure. More...
 
struct  BUCKET
 Internal: Hash table structure. More...
 

Macros

Status values returned by some bucketLib functions
#define BUCKET_SUCCESS   S_bucket_success
 A synonym for S_bucket_success.
 
#define S_bucket_success   0
 Success, must be 0.
 
#define S_bucket_noMemory   (M_bucket | 1) /*Memory allocation failed*/
 Memory allocation failed.
 
#define S_bucket_idInUse   (M_bucket | 2) /*Identifier already in use*/
 Identifier already in use.
 
#define S_bucket_uknId   (M_bucket | 3) /*Unknown identifier*/
 Unknown identifier.
 

Typedefs

typedef unsigned BUCKETID
 Internal: bucket identifier.
 

Enumerations

enum  buckTypeOfId { bidtUnsigned, bidtPointer, bidtString }
 Internal: bucket key type.
 

Functions

LIBCOM_API BUCKET *epicsStdCall bucketCreate (unsigned nHashTableEntries)
 Creates a new hash table. More...
 
LIBCOM_API int epicsStdCall bucketFree (BUCKET *prb)
 Release memory used by a hash table. More...
 
LIBCOM_API int epicsStdCall bucketShow (BUCKET *prb)
 Display information about a hash table. More...
 
LIBCOM_API int epicsStdCall bucketAddItemUnsignedId (BUCKET *prb, const unsigned *pId, const void *pApp)
 Add an item identified by an unsigned int to the table. More...
 
LIBCOM_API int epicsStdCall bucketAddItemPointerId (BUCKET *prb, void *const *pId, const void *pApp)
 Add an item identified by a pointer to the table. More...
 
LIBCOM_API int epicsStdCall bucketAddItemStringId (BUCKET *prb, const char *pId, const void *pApp)
 Add an item identified by a string to the table. More...
 
LIBCOM_API int epicsStdCall bucketRemoveItemUnsignedId (BUCKET *prb, const unsigned *pId)
 Remove an item identified by a string from the table. More...
 
LIBCOM_API int epicsStdCall bucketRemoveItemPointerId (BUCKET *prb, void *const *pId)
 Remove an item identified by a pointer from the table. More...
 
LIBCOM_API int epicsStdCall bucketRemoveItemStringId (BUCKET *prb, const char *pId)
 Remove an item identified by a string from the table. More...
 
LIBCOM_API void *epicsStdCall bucketLookupItemUnsignedId (BUCKET *prb, const unsigned *pId)
 Find an item identified by an unsigned int in the table. More...
 
LIBCOM_API void *epicsStdCall bucketLookupItemPointerId (BUCKET *prb, void *const *pId)
 Find an item identified by a pointer in the table. More...
 
LIBCOM_API void *epicsStdCall bucketLookupItemStringId (BUCKET *prb, const char *pId)
 Find an item identified by a string in the table. More...
 
LIBCOM_API void *epicsStdCall bucketLookupAndRemoveItemUnsignedId (BUCKET *prb, const unsigned *pId)
 Find and delete an item identified by an unsigned int from the table. More...
 
LIBCOM_API void *epicsStdCall bucketLookupAndRemoveItemPointerId (BUCKET *prb, void *const *pId)
 Find and delete an item identified by a pointer from the table. More...
 
LIBCOM_API void *epicsStdCall bucketLookupAndRemoveItemStringId (BUCKET *prb, const char *pId)
 Find and delete an item identified by a string from the table. More...
 

Detailed Description

Author
Jeffrey O. Hill

A hash table for which keys may be unsigned integers, pointers, or strings. This API is used by the IOC's Channel Access Server, but it should not be used by other code.

Note
Storage for identifiers must persist until an item is deleted

Definition in file bucketLib.h.

Function Documentation

LIBCOM_API BUCKET* epicsStdCall bucketCreate ( unsigned  nHashTableEntries)
Parameters
nHashTableEntriesTable size
Returns
Pointer to the newly created hash table, or NULL.
LIBCOM_API int epicsStdCall bucketFree ( BUCKET prb)
Parameters
*prbPointer to the hash table
Returns
S_bucket_success
Note
All items must be deleted from the hash table before calling this.
LIBCOM_API int epicsStdCall bucketShow ( BUCKET prb)
Parameters
*prbPointer to the hash table
Returns
S_bucket_success
LIBCOM_API int epicsStdCall bucketAddItemUnsignedId ( BUCKET prb,
const unsigned *  pId,
const void *  pApp 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
*pAppPointer to the payload
Returns
Status value
LIBCOM_API int epicsStdCall bucketAddItemPointerId ( BUCKET prb,
void *const *  pId,
const void *  pApp 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
*pAppPointer to the payload
Returns
Status value
LIBCOM_API int epicsStdCall bucketAddItemStringId ( BUCKET prb,
const char *  pId,
const void *  pApp 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
*pAppPointer to the payload
Returns
Status value
LIBCOM_API int epicsStdCall bucketRemoveItemUnsignedId ( BUCKET prb,
const unsigned *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Status value
LIBCOM_API int epicsStdCall bucketRemoveItemPointerId ( BUCKET prb,
void *const *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Status value
LIBCOM_API int epicsStdCall bucketRemoveItemStringId ( BUCKET prb,
const char *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Status value
LIBCOM_API void* epicsStdCall bucketLookupItemUnsignedId ( BUCKET prb,
const unsigned *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Item's payload pointer, or NULL if not found
LIBCOM_API void* epicsStdCall bucketLookupItemPointerId ( BUCKET prb,
void *const *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Item's payload pointer, or NULL if not found
LIBCOM_API void* epicsStdCall bucketLookupItemStringId ( BUCKET prb,
const char *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Item's payload pointer, or NULL if not found
LIBCOM_API void* epicsStdCall bucketLookupAndRemoveItemUnsignedId ( BUCKET prb,
const unsigned *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Item's payload pointer, or NULL if not found
LIBCOM_API void* epicsStdCall bucketLookupAndRemoveItemPointerId ( BUCKET prb,
void *const *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Item's payload pointer, or NULL if not found
LIBCOM_API void* epicsStdCall bucketLookupAndRemoveItemStringId ( BUCKET prb,
const char *  pId 
)
Parameters
*prbPointer to the hash table
*pIdPointer to the identifier
Returns
Item's payload pointer, or NULL if not found