OpenClovis Logo

Files | Typedefs | Enumerations | Functions
API Reference Pages
Container Service

Defines, Structures, Typedefs, Functions. More...

Files

file  clCntApi.h
 Header file of Clovis Container Related APIs.

Typedefs

typedef ClPtrT ClCntArgHandleT
 Handle of the argument which will be passed to callback functions.
typedef ClPtrT ClCntDataHandleT
 Handle of the data.
typedef void(* ClCntDeleteCallbackT )(CL_IN ClCntKeyHandleT userKey, CL_IN ClCntDataHandleT userData)
 Gets called While destroying the node of the container.
typedef ClPtrT ClCntHandleT
 Handle of the container.
typedef ClUint32T(* ClCntHashCallbackT )(CL_IN ClCntKeyHandleT userKey)
 Gets called While doing hash table related operations.
typedef ClInt32T(* ClCntKeyCompareCallbackT )(CL_IN ClCntKeyHandleT key1, CL_IN ClCntKeyHandleT key2)
 Compares the two keys.
typedef ClPtrT ClCntKeyHandleT
 Handle of the key handle.
typedef ClPtrT ClCntNodeHandleT
 Handle of the container Node.
typedef ClRcT(* ClCntWalkCallbackT )(CL_IN ClCntKeyHandleT userKey, CL_IN ClCntDataHandleT userData, CL_IN ClCntArgHandleT userArg, CL_IN ClUint32T dataLength)
 Gets called While performing container walk operation.

Enumerations

enum  ClCntKeyTypeT {
  CL_CNT_UNIQUE_KEY = 1,
  CL_CNT_NON_UNIQUE_KEY = 2,
  CL_CNT_INVALID_KEY_TYPE
}
 This enum describes type of the container. More...

Functions

ClRcT clCntAllNodesDelete (CL_IN ClCntHandleT containerHandle)
 Deletes all the nodes from the Container.
ClRcT clCntAllNodesForKeyDelete (CL_IN ClCntHandleT containerHandle, CL_IN ClCntKeyHandleT userKey)
ClRcT clCntDataForKeyGet (CL_IN ClCntHandleT containerHandle, CL_IN ClCntKeyHandleT userKey, CL_OUT ClCntDataHandleT *pUserData)
 Returns the user-data associated with a specified key.
ClRcT clCntDelete (CL_IN ClCntHandleT containerHandle)
 Destroys the Container.
ClRcT clCntFirstNodeGet (CL_IN ClCntHandleT containerHandle, CL_OUT ClCntNodeHandleT *pNodeHandle)
 Returns the first node from the Container.
ClRcT clCntHashtblCreate (CL_IN ClUint32T numberOfBuckets, CL_IN ClCntKeyCompareCallbackT fpKeyCompare, CL_IN ClCntHashCallbackT fpHashFunction, CL_IN ClCntDeleteCallbackT fpUserDeleteCallback, CL_IN ClCntDeleteCallbackT fpUserDestroyCallback, CL_IN ClCntKeyTypeT containerKeyType, CL_IN ClCntHandleT *pContainerHandle)
 Creates the hash table.
ClRcT clCntKeySizeGet (CL_IN ClCntHandleT containerHandle, CL_IN ClCntKeyHandleT userKey, CL_OUT ClUint32T *pSize)
 Returns the number of nodes associated with a user-key.
ClRcT clCntLastNodeGet (CL_IN ClCntHandleT containerHandle, CL_OUT ClCntNodeHandleT *pNodeHandle)
 Returns the last node from the Container.
ClRcT clCntLlistCreate (CL_IN ClCntKeyCompareCallbackT fpKeyCompare, CL_IN ClCntDeleteCallbackT fpUserDeleteCallback, CL_IN ClCntDeleteCallbackT fpUserDestroyCallback, CL_IN ClCntKeyTypeT containerKeyType, CL_OUT ClCntHandleT *pContainerHandle)
 Creates the container doubly linked list.
ClRcT clCntNextNodeGet (CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT currentNodeHandle, CL_OUT ClCntNodeHandleT *pNextNodeHandle)
 Returns the next node from the Container.
ClRcT clCntNodeAdd (CL_IN ClCntHandleT containerHandle, CL_IN ClCntKeyHandleT userKey, CL_IN ClCntDataHandleT userData, CL_IN ClRuleExprT *rbeExpression)
 Adds a new node to Container.
ClRcT clCntNodeAddAndNodeGet (CL_IN ClCntHandleT containerHandle, CL_IN ClCntKeyHandleT userKey, CL_IN ClCntDataHandleT userData, CL_IN ClRuleExprT *pExp, CL_IN ClCntNodeHandleT *pNodeHandle)
 Adds a new node to Container and returns the node handle.
ClRcT clCntNodeDelete (CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT nodeHandle)
 Deletes a specific node from the Container.
ClRcT clCntNodeFind (CL_IN ClCntHandleT containerHandle, CL_IN ClCntKeyHandleT userKey, CL_IN ClCntNodeHandleT *pNodeHandle)
 Finds a specific node in the Container.
ClRcT clCntNodeUserDataGet (CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT nodeHandle, CL_OUT ClCntDataHandleT *pUserDataHandle)
 Returns the user-data from the node.
ClRcT clCntNodeUserKeyGet (CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT nodeHandle, CL_OUT ClCntKeyHandleT *pUserKey)
 Returns the user-key from the node.
ClRcT clCntPreviousNodeGet (CL_IN ClCntHandleT containerHandle, CL_IN ClCntNodeHandleT currentNodeHandle, CL_OUT ClCntNodeHandleT *pPreviousNodeHandle)
 Returns the previous node from the Container.
ClRcT clCntRbtreeCreate (CL_IN ClCntKeyCompareCallbackT fpKeyCompare, CL_IN ClCntDeleteCallbackT fpUserDeleteCallback, CL_IN ClCntDeleteCallbackT fpUserDestroyCallback, CL_IN ClCntKeyTypeT containerKeyType, CL_OUT ClCntHandleT *pContainerHandle)
 Creates the container red black tree.
ClRcT clCntSizeGet (CL_IN ClCntHandleT containerHandle, CL_OUT ClUint32T *pSize)
 Returns the size of the Container.
ClRcT clCntThreadSafeHashtblCreate (CL_IN ClUint32T numberOfBuckets, CL_IN ClCntKeyCompareCallbackT fpKeyCompare, CL_IN ClCntHashCallbackT fpHashFunction, CL_IN ClCntDeleteCallbackT fpUserDeleteCallback, CL_IN ClCntDeleteCallbackT fpUserDestroyCallback, CL_IN ClCntKeyTypeT containerKeyType, CL_OUT ClCntHandleT *pContainerHandle)
 Creates a thread safe hash table.
ClRcT clCntThreadSafeLlistCreate (CL_IN ClCntKeyCompareCallbackT fpKeyCompare, CL_IN ClCntDeleteCallbackT fpUserDeleteCallback, CL_IN ClCntDeleteCallbackT fpUserDestroyCallback, CL_IN ClCntKeyTypeT containerKeyType, CL_OUT ClCntHandleT *pContainerHandle)
 Creates the container doubly linked list with lock variable.
ClRcT clCntThreadSafeRbtreeCreate (CL_IN ClCntKeyCompareCallbackT fpKeyCompare, CL_IN ClCntDeleteCallbackT fpUserDeleteCallback, CL_IN ClCntDeleteCallbackT fpUserDestroyCallback, CL_IN ClCntKeyTypeT containerKeyType, CL_OUT ClCntHandleT *pContainerHandle)
 Creates the thread safe container red black tree.
ClRcT clCntWalk (CL_IN ClCntHandleT containerHandle, CL_IN ClCntWalkCallbackT fpUserWalkCallback, CL_IN ClCntArgHandleT userArg, CL_IN ClInt32T length)
 Walks through the Container.

Detailed Description

Defines, Structures, Typedefs, Functions.

Typedef Documentation

typedef void(* ClCntDeleteCallbackT)(CL_IN ClCntKeyHandleT userKey, CL_IN ClCntDataHandleT userData)

Gets called While destroying the node of the container.

Header File:
clCntApi.h
Parameters
userKey(in) Key of the node is being destroyed.
userData(in) Data of the node is being destroyed.
Return values
none
Description:
This delete callback function will get invoked whenever a node is getting deleted. The user can do their cleanup here.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind(), clCntDataForKeyGet()
typedef ClPtrT ClCntHandleT

Handle of the container.

Container could be Linked list, Rbtree, Hashtable.

typedef ClUint32T(* ClCntHashCallbackT)(CL_IN ClCntKeyHandleT userKey)

Gets called While doing hash table related operations.

Header File:
clCntApi.h
Parameters
userKey(in) Key of the node is being accessed.
Return values
hashValwill be returned.
Description:
Whenever any hash table related operations is being performed, this hash callback will be invoked.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind(), clCntDataForKeyGet()
typedef ClInt32T(* ClCntKeyCompareCallbackT)(CL_IN ClCntKeyHandleT key1, CL_IN ClCntKeyHandleT key2)

Compares the two keys.

Header File:
clCntApi.h
Parameters
key1(in) Users passed Key value.
key2(in) already stored Key value in the container.
Return values
0both the keys are equal
>0key1 is larger than key2
<0key2 is larger than key1
Description:
This compare callback function does the comparison two keys and returns the result back to the calling function. This will get called, whenever the container does any key related operations.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind(), clCntDataForKeyGet()
typedef ClRcT(* ClCntWalkCallbackT)(CL_IN ClCntKeyHandleT userKey, CL_IN ClCntDataHandleT userData, CL_IN ClCntArgHandleT userArg, CL_IN ClUint32T dataLength)

Gets called While performing container walk operation.

Header File:
clCntApi.h
Parameters
userKey(in) Key of the node is being accessed.
userData(in) Data of the node is being accessed.
userArg(in) Userarg whatever they pass to clCntWalk function will passed.
length(in) Length of the arg data.
Return values
hashValwill be returned.
Description:
Whenever a container Walk is performed on any container, this call back will get invoked.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(),

Enumeration Type Documentation

This enum describes type of the container.

Enumerator:
CL_CNT_UNIQUE_KEY 

Container contains unique key.

Duplicate entries are not allowed.

CL_CNT_NON_UNIQUE_KEY 

Container contains non unique key.

Duplicate entries are allowed.

CL_CNT_INVALID_KEY_TYPE 

Invalid container type.

Function Documentation

ClRcT clCntAllNodesDelete ( CL_IN ClCntHandleT  containerHandle)

Deletes all the nodes from the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle.
CL_ERR_NOT_EXISTIf node does not exist.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to delete all the nodes from the Container, but does not affect the user-data. You are required to perform memory allocation and de-allocation for data.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(),
ClRcT clCntAllNodesForKeyDelete ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntKeyHandleT  userKey 
)
Deletes all the nodes associated with specific key from the Container.
Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
userKey(in) User specified key.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle.
CL_ERR_NOT_EXISTIf node does not exist.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to delete all the nodes associated with the specific user key, but does not affect the user-data. You are required to perform memory allocation and de-allocation for data.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind(), clCntDataForKeyGet(), clCntNodeUserDataGet(), clCntNodeUserKeyGet()
ClRcT clCntDataForKeyGet ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntKeyHandleT  userKey,
CL_OUT ClCntDataHandleT pUserData 
)

Returns the user-data associated with a specified key.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of the Container returned by the create API.
userKey(in) User-key, for which associated data is to be retrieved.
pUserData(out) Pointer to the variable of type ClCntNodeHandleT in which the handle of the user-data associated with a specific key is returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
CL_ERR_NOT_EXISTIf user-key does not exist.
CL_ERR_NOT_IMPLEMENTEDIf this API is used with non-unique keys.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to retrieve the user-data associated with a specified key. It must be used only if the keys are unique. For non-unique keys, the API returns an error.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind(), clCntNodeUserKeyGet(), clCntNodeUserDataGet()
ClRcT clCntDelete ( CL_IN ClCntHandleT  containerHandle)

Destroys the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in)Handle of Container returned by the create API.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to delete all the nodes and destroy the Container but it does not affect any user-data.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate()
ClRcT clCntFirstNodeGet ( CL_IN ClCntHandleT  containerHandle,
CL_OUT ClCntNodeHandleT pNodeHandle 
)

Returns the first node from the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
pNodeHandle(out) Pointer to the variable of type ClCntNodeHandleT in which handle of the node is found.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to retrieve the first node from the Container.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind()
ClRcT clCntHashtblCreate ( CL_IN ClUint32T  numberOfBuckets,
CL_IN ClCntKeyCompareCallbackT  fpKeyCompare,
CL_IN ClCntHashCallbackT  fpHashFunction,
CL_IN ClCntDeleteCallbackT  fpUserDeleteCallback,
CL_IN ClCntDeleteCallbackT  fpUserDestroyCallback,
CL_IN ClCntKeyTypeT  containerKeyType,
CL_IN ClCntHandleT pContainerHandle 
)

Creates the hash table.

Header File:
clCntApi.h
Parameters
numberOfBucketsNumber of buckets (table size) in the hash table.
fpKeyCompare(in) Pointer to the user's key compare function. It accepts two parameters of type ClCntKeyHandleT. This function returns the following values:
  • a negative value: If first key is lesser than the second key.
  • zero: If both the keys are equal.
  • a positive value: If first key is greater than second key.
    Note:
    For the APIs where a traversal of the nodes in the container is involved, you must pass a key for a node to be found. This callback function is called by the Container library for every node in the container with the key passed by you and the key for that node. The implementation of this function must compare the keys in the application specific way and return a value as documented below.
fpUserDeleteCallback(in) Pointer to the user's destroy callback function. This function is called by the container library whenever either clCntNodeDelete or clCntNodeAllDelete API is called. The delete callback function must free any memory allocated by the application for the node being deleted.
fpUserDestroyCallback(in) Pointer to the user's destroy callback function. This function is called, whenever you invoke the destroy API. The user-key and user-data of each node, which is being deleted is passed as first and second argument to this callback.
containerKeyType(in) Enum indicating whether the Container is of a unique key type or a non-unique key type.
pContainerHandle(out) Pointer to the variable of type ClCntHandleT in which the function returns a valid Container handle on successful creation of Container.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_NULL_POINTEROn passing NULL values for either pContainerHandle or compare call back funtion.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
CL_ERR_MUTEX_ERROROn passing invalid values for creationg mutex.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to create a hash table Container with Numbuckets. It populates all the function pointers related with hash table.
Library File:
ClCnt
See Also
none
ClRcT clCntKeySizeGet ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntKeyHandleT  userKey,
CL_OUT ClUint32T *  pSize 
)

Returns the number of nodes associated with a user-key.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of the Container returned by the create API.
userKey(in) Handle of the user-key.
pSize(out) Pointer to the variable of type ClCntNodeHandleT in which the number of nodes associated with the specified user-key is returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to return the number of nodes associated with a specific user-key.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate()
ClRcT clCntLastNodeGet ( CL_IN ClCntHandleT  containerHandle,
CL_OUT ClCntNodeHandleT pNodeHandle 
)

Returns the last node from the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
currentNodeHandle(out) Handle of the current node.
pNextNodeHandle(out) Pointer to the variable of type ClCntNodeHandleT in which the handle of the next node is returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to return the last node from the Container.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind()
ClRcT clCntLlistCreate ( CL_IN ClCntKeyCompareCallbackT  fpKeyCompare,
CL_IN ClCntDeleteCallbackT  fpUserDeleteCallback,
CL_IN ClCntDeleteCallbackT  fpUserDestroyCallback,
CL_IN ClCntKeyTypeT  containerKeyType,
CL_OUT ClCntHandleT pContainerHandle 
)

Creates the container doubly linked list.

Header File:
clCntApi.h
Parameters
fpKeyCompare(in) Pointer to the user's key compare function. It accepts two parameters of type ClCntKeyHandleT. This function returns the following values:
  • a negative value: If first key is lesser than the second key.
  • zero: If both the keys are equal.
  • a positive value: If first key is greater than second key.
    Note:
    For the APIs where a traversal of the nodes in the container is involved, you must pass a key for a node to be found. This callback function is called by the Container library for every node in the container with the key passed by you and the key for that node. The implementation of this function must compare the keys in the application specific way and return a value as documented below.
fpUserDeleteCallback(in): Pointer to the user's destroy callback function. This function is called by the container library whenever either clCntNodeDelete or clCntNodeAllDelete API is called. The delete callback function must free any memory allocated by the application for the node being deleted.
fpUserDestroyCallback(in) Pointer to the user's destroy callback function. This function is called, whenever you invoke the destroy API. The user-key and user-data of each node, which is being deleted is passed as first and second argument to this callback.
containerKeyType(in) Enum indicating whether the Container is of a unique key type or a non-unique key type.
pContainerHandle(out) Pointer to the variable of type ClCntHandleT in which the function returns a valid Container handle on successful creation of Container.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_NULL_POINTEROn passing NULL values for either pContainerHandle or compare call back funtion.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to create a linked list of a Container. It populates all the functions related with linked list.
Library File:
ClCnt
See Also
none
ClRcT clCntNextNodeGet ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntNodeHandleT  currentNodeHandle,
CL_OUT ClCntNodeHandleT pNextNodeHandle 
)

Returns the next node from the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
currentNodeHandle(in) Handle of current node.
pNextNodeHandle(out) Pointer to the variable of type ClCntNodeHandleT in which the handle of the next node is returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to return the next node after a specific node in the Container.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind()
ClRcT clCntNodeAdd ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntKeyHandleT  userKey,
CL_IN ClCntDataHandleT  userData,
CL_IN ClRuleExprT rbeExpression 
)

Adds a new node to Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
userKey(in) Handle of the user-key.
userData(in) User specified data. Memory allocation for userData must be done by you.
rbeExpression(in) An RBE expression to associate with the new node.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_DUPLICATEIf user-key already exists and the Container created supports only unique keys.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to create and insert a new node into the Container.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(),
ClRcT clCntNodeAddAndNodeGet ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntKeyHandleT  userKey,
CL_IN ClCntDataHandleT  userData,
CL_IN ClRuleExprT pExp,
CL_IN ClCntNodeHandleT pNodeHandle 
)

Adds a new node to Container and returns the node handle.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
userKey(in) Handle of the user key.
userData(in) User specified data. Memory allocation for this parameter must be done by you.
pExp(in) An RBE Expression to associate with this new node.
pNodeHandle(out) Pointer to the variable of type ClCntNodeHandleT in which handle of the node is added.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_DUPLICATEIf user-key already exists and the Container created supports only unique keys.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to create and insert a new node into the Container as well as to return the handle of the newly created node.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(),
ClRcT clCntNodeDelete ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntNodeHandleT  nodeHandle 
)

Deletes a specific node from the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
nodeHandle(in) Handle of the node to be deleted.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle.
CL_ERR_NOT_EXISTIf node does not exist.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to delete the specific node from the Container, but it does not affect the user data. You are required to perform memory allocation and de-allocation for data.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind(), clCntDataForKeyGet(), clCntNodeUserDataGet(), clCntNodeUserKeyGet()
ClRcT clCntNodeFind ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntKeyHandleT  userKey,
CL_IN ClCntNodeHandleT pNodeHandle 
)

Finds a specific node in the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of Container returned by the create API.
userKey(in) User specified key.
pNodeHandle(out) Pointer to the variable of type ClCntNodeHandleT in which handle of the node is found.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle.
CL_ERR_NOT_EXISTIf user-key does not exist.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to search for a specific node in the Container. It returns the node associated with the specific key from the Container. If multiple nodes are associated with the same key, the node handle of first node associated with the key is returned.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntDataForKeyGet(), clCntNodeUserDataGet(), clCntNodeUserKeyGet()
ClRcT clCntNodeUserDataGet ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntNodeHandleT  nodeHandle,
CL_OUT ClCntDataHandleT pUserDataHandle 
)

Returns the user-data from the node.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of the Container returned by the create API.
nodeHandle(in) Handle of the node.
pUserDataHandle(out) Pointer to the variable of type ClCntNodeHandleT in which the handle of the user-data associated with a specific key is returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to retrieve the user-data from a specific node.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind(), clCntNodeUserKeyGet(), clCntDataForKeyGet()
ClRcT clCntNodeUserKeyGet ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntNodeHandleT  nodeHandle,
CL_OUT ClCntKeyHandleT pUserKey 
)

Returns the user-key from the node.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of the Container returned by the create API.
nodeHandle(in) Handle of node from which user-key is to be retrieved.
pUserKey(out) Pointer to the variable of type ClCntNodeHandleT in which the handle of the user-key is returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to retrieve the user-key from a specified node.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind(), clCntDataForKeyGet(), clCntNodeUserDataGet()
ClRcT clCntPreviousNodeGet ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntNodeHandleT  currentNodeHandle,
CL_OUT ClCntNodeHandleT pPreviousNodeHandle 
)

Returns the previous node from the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of the Container returned by the create API.
currentNodeHandle(in) Handle of the current node.
pPreviousNodeHandle(out) Pointer to the variable of type ClCntNodeHandleT in which the handle of the previous node is returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to return the node before a specific node in the Container.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(), clCntNodeFind()
ClRcT clCntRbtreeCreate ( CL_IN ClCntKeyCompareCallbackT  fpKeyCompare,
CL_IN ClCntDeleteCallbackT  fpUserDeleteCallback,
CL_IN ClCntDeleteCallbackT  fpUserDestroyCallback,
CL_IN ClCntKeyTypeT  containerKeyType,
CL_OUT ClCntHandleT pContainerHandle 
)

Creates the container red black tree.

Header File:
clCntApi.h
Parameters
fpKeyCompare(in) Pointer to the user's key compare function. It accepts two parameters of type ClCntKeyHandleT. This function returns the following values:
  • a negative value: If first key is lesser than the second key.
  • zero: If both the keys are equal.
  • a positive value: If first key is greater than second key.
    Note:
    For the APIs where a traversal of the nodes in the container is involved, you must pass a key for a node to be found. This callback function is called by the Container library for every node in the container with the key passed by you and the key for that node. The implementation of this function must compare the keys in the application specific way and return a value as documented below.
fpUserDeleteCallback(in): Pointer to the user's destroy callback function. This function is called by the container library whenever either clCntNodeDelete or clCntNodeAllDelete API is called. The delete callback function must free any memory allocated by the application for the node being deleted.
fpUserDestroyCallback(in) Pointer to the user's destroy callback function. This function is called, whenever you invoke the destroy API. The user-key and user-data of each node, which is being deleted is passed as first and second argument to this callback.
containerKeyType(in) Enum indicating whether the Container is of a unique key type or a non-unique key type.
pContainerHandle(out) Pointer to the variable of type ClCntHandleT in which the function returns a valid Container handle on successful creation of Container.
Return values
CL_OK,:The API executed successfully.
CL_ERR_NO_MEMORY,:On memory allocation failure.
CL_ERR_NULL_POINTER,:On passing NULL values for either pContainerHandle or compare call back funtion.
CL_ERR_INVALID_PARAMETER,:On passing invalid values to container type.
CL_ERR_INVALID_PARAMETER,:On passing invalid values to container type.
CL_ERR_MUTEX_ERROR,:On passing invalid values for creationg mutex.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to create and initialize Red Black Tree Container that supports only unique keys.
Library File:
ClCnt
See Also
none
ClRcT clCntSizeGet ( CL_IN ClCntHandleT  containerHandle,
CL_OUT ClUint32T *  pSize 
)

Returns the size of the Container.

Header File:
clCntApi.h
Parameters
containerHandle(in) Handle of the Container returned by the create API.
pSize(out) Pointer to the variable of type ClCntNodeHandleT in which size of the Container is returned.
Return values
CL_OKThe API executed successfully.
CL_ERR_NULL_POINTEROn passing a NULL pointer.
CL_ERR_INVALID_HANDLEOn passing an invalid Container handle or if the Container is empty.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to return the total number of nodes in the Container.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate()
ClRcT clCntThreadSafeHashtblCreate ( CL_IN ClUint32T  numberOfBuckets,
CL_IN ClCntKeyCompareCallbackT  fpKeyCompare,
CL_IN ClCntHashCallbackT  fpHashFunction,
CL_IN ClCntDeleteCallbackT  fpUserDeleteCallback,
CL_IN ClCntDeleteCallbackT  fpUserDestroyCallback,
CL_IN ClCntKeyTypeT  containerKeyType,
CL_OUT ClCntHandleT pContainerHandle 
)

Creates a thread safe hash table.

Header File:
clCntApi.h
Parameters
numberOfBucketsNumber of buckets (table size) in the hash table.
fpKeyCompare(in) Pointer to the user's key compare function. It accepts two parameters of type ClCntKeyHandleT. This function returns the following values:
  • a negative value: If first key is lesser than the second key.
  • zero: If both the keys are equal.
  • a positive value: If first key is greater than second key.
    Note:
    For the APIs where a traversal of the nodes in the container is involved, you must pass a key for a node to be found. This callback function is called by the Container library for every node in the container with the key passed by you and the key for that node. The implementation of this function must compare the keys in the application specific way and return a value as documented below.
fpUserDeleteCallback(in) Pointer to the user's destroy callback function. This function is called by the container library whenever either clCntNodeDelete or clCntNodeAllDelete API is called. The delete callback function must free any memory allocated by the application for the node being deleted.
fpUserDestroyCallback(in) Pointer to the user's destroy callback function. This function is called, whenever you invoke the destroy API. The user-key and user-data of each node, which is being deleted is passed as first and second argument to this callback.
containerKeyType(in) Enum indicating whether the Container is of a unique key type or a non-unique key type.
pContainerHandle(out) Pointer to the variable of type ClCntHandleT in which the function returns a valid Container handle on successful creation of Container.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_NULL_POINTEROn passing NULL values for either pContainerHandle or compare call back funtion.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
CL_ERR_MUTEX_ERROROn passing invalid values for creationg mutex.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to create a hash table Container with Numbuckets. It populates all the function pointers related with hash table. It provides thread safe container, so locking will be provided.
Library File:
ClCnt
See Also
none
ClRcT clCntThreadSafeLlistCreate ( CL_IN ClCntKeyCompareCallbackT  fpKeyCompare,
CL_IN ClCntDeleteCallbackT  fpUserDeleteCallback,
CL_IN ClCntDeleteCallbackT  fpUserDestroyCallback,
CL_IN ClCntKeyTypeT  containerKeyType,
CL_OUT ClCntHandleT pContainerHandle 
)

Creates the container doubly linked list with lock variable.

Header File:
clCntApi.h
Parameters
fpKeyCompare(in) Pointer to the user's key compare function. It accepts two parameters of type ClCntKeyHandleT. This function returns the following values:
  • a negative value: If first key is lesser than the second key.
  • zero: If both the keys are equal.
  • a positive value: If first key is greater than second key.
    Note:
    For the APIs where a traversal of the nodes in the container is involved, you must pass a key for a node to be found. This callback function is called by the Container library for every node in the container with the key passed by you and the key for that node. The implementation of this function must compare the keys in the application specific way and return a value as documented below.
fpUserDeleteCallback(in): Pointer to the user's destroy callback function. This function is called by the container library whenever either clCntNodeDelete or clCntNodeAllDelete API is called. The delete callback function must free any memory allocated by the application for the node being deleted.
fpUserDestroyCallback(in) Pointer to the user's destroy callback function. This function is called, whenever you invoke the destroy API. The user-key and user-data of each node, which is being deleted is passed as first and second argument to this callback.
containerKeyType(in) Enum indicating whether the Container is of a unique key type or a non-unique key type.
pContainerHandle(out) Pointer to the variable of type ClCntHandleT in which the function returns a valid Container handle on successful creation of Container.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_NULL_POINTEROn passing NULL values for either pContainerHandle or compare call back funtion.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
CL_ERR_MUTEX_ERROROn passing invalid values for creationg mutex.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to create a linked list of a Container. It populates all the functions related with linked list. It provides thread safe container to the user. At a time only one anylement can be access the container element.
Library File:
ClCnt
See Also
none
ClRcT clCntThreadSafeRbtreeCreate ( CL_IN ClCntKeyCompareCallbackT  fpKeyCompare,
CL_IN ClCntDeleteCallbackT  fpUserDeleteCallback,
CL_IN ClCntDeleteCallbackT  fpUserDestroyCallback,
CL_IN ClCntKeyTypeT  containerKeyType,
CL_OUT ClCntHandleT pContainerHandle 
)

Creates the thread safe container red black tree.

Header File:
clCntApi.h
Parameters
fpKeyCompare(in) Pointer to the user's key compare function. It accepts two parameters of type ClCntKeyHandleT. This function returns the following values:
  • a negative value: If first key is lesser than the second key.
  • zero: If both the keys are equal.
  • a positive value: If first key is greater than second key.
    Note:
    For the APIs where a traversal of the nodes in the container is involved, you must pass a key for a node to be found. This callback function is called by the Container library for every node in the container with the key passed by you and the key for that node. The implementation of this function must compare the keys in the application specific way and return a value as documented below.
fpUserDeleteCallback(in): Pointer to the user's destroy callback function. This function is called by the container library whenever either clCntNodeDelete or clCntNodeAllDelete API is called. The delete callback function must free any memory allocated by the application for the node being deleted.
fpUserDestroyCallback(in) Pointer to the user's destroy callback function. This function is called, whenever you invoke the destroy API. The user-key and user-data of each node, which is being deleted is passed as first and second argument to this callback.
containerKeyType(in) Enum indicating whether the Container is of a unique key type or a non-unique key type.
pContainerHandle(out) Pointer to the variable of type ClCntHandleT in which the function returns a valid Container handle on successful creation of Container.
Return values
CL_OKThe API executed successfully.
CL_ERR_NO_MEMORYOn memory allocation failure.
CL_ERR_NULL_POINTEROn passing NULL values for either pContainerHandle or compare call back funtion.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
CL_ERR_INVALID_PARAMETEROn passing invalid values to container type.
CL_ERR_MUTEX_ERROROn passing invalid values for creationg mutex.
Note
Return value is a combination of the component id and error code. As Return values only the Error Codes are listed above. Use CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.
Description:
This API is used to create and initialize Red Black Tree Container that supports only unique keys. It provides thread safe through mutex variables.
Library File:
ClCnt
See Also
none
ClRcT clCntWalk ( CL_IN ClCntHandleT  containerHandle,
CL_IN ClCntWalkCallbackT  fpUserWalkCallback,
CL_IN ClCntArgHandleT  userArg,
CL_IN ClInt32T  length 
)

Walks through the Container.

\param containerHandle (in) Handle of the Container returned by the create API.

\param fpUserWalkCallback (in) Pointer to the user's walk callback function. 
It accepts the following arguments: 
\arg ClCntKeyHandleT   Handle to user-key of the node
\arg ClCntDataHandleT  Handle to user-data of the node.
The \e userKey and \e userData of each node are passed as first and second 
arguments to the callback function. User specified \e userArg is also passed.

\param userArg (in)  User specified argument, which is passed as third parameter
to the user walk callback function. This parameter is also passed to the
\e clRbeExprEvaluate API. 

\param length (in) Length of \e userArg. This parameter is also passed to 
clRbeExprEvaluate API.

\retval CL_OK The API executed successfully. 
\retval CL_ERR_NULL_POINTER On passing a NULL pointer.
\retval CL_ERR_INVALID_HANDLE On passing an invalid Container handle or if the Container is empty.

\note
Return value is a combination of the component id and error code. As Return 
values only the Error Codes are listed above. 
Use \c CL_GET_ERROR_CODE(RET_CODE) defined in clCommonErrors.h to retrieve the error code.  

\par Description:
This API is used to perform a walk through the Container. For each node encountered 
during the walk, if the RBE associated with the node evaluates to: \n


  • TRUE or NULL The user specific callback function is called with the key and data handles present in the encountered node.
  • FALSE: The callback function is not called for the current node. The walk function continues with the next node.
Library File:
ClCnt
See Also
clCntLlistCreate(), clCntHashtblCreate(), clCntRbtreeCreate(),

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen