Defines, Structures, Typedefs, Functions.
More...
Files |
file | clQueueApi.h |
| Header file of Queue Management related APIs.
|
Detailed Description
Defines, Structures, Typedefs, Functions.
Typedef Documentation
Dequeue callback gets called, whenever a Node is getting deleted.
- Header File:
- clQueueApi.h
- Parameters
-
userData | (in) Data of the node is being deleted. |
- Return values
-
- Description:
- This dequeue callback function gets called, whenever user performs node deletion on the Queue. The Data of the node will be exposed to the user on the callback. This is the place where user can cleanup their data.
- Library File:
- ClUtil
- See Also
- clQueueCreate(), clQueueDelete()
Walk Callback gets called, whenever traverse happens on the Queue.
- Header File:
- clQueueApi.h
- Parameters
-
userData | (in) Data of the node is being accessed. |
userArg | (in) User arg of the callback function |
- Return values
-
- Description:
- This Walk callback function gets called, whenever user performs traverse on the Queue.
- Library File:
- ClUtil
- See Also
- clQueueCreate(), clQueueDelete()
Function Documentation
Creates a queue.
- Header File:
- clQueueApi.h
- Parameters
-
maxSize | (in) Maximum size of the Queue. It specifies the maximum number of elements that can exist at any point of time in the Queue. This must be an unsigned integer. You can enqueue elements into the queue until this maximum limit is reached. If you specify this parameter as 0, then there is no limit on the size of the Queue. |
fpUserDequeueCallBack | (in) Pointer to the user's dequeue callback function. This function accepts a parameter of type ClQueueDataT. After dequeueing, the dequeued user-data is passed as an argument to the callback function. |
fpUserDestroyCallBack | (in) Pointer to the user's destroy callback function. This function accepts a parameter of type ClQueueDataT. While destroying the queue by clQueueDelete(), for each element in the queue this callback function is called. |
pQueueHandle | (out) Pointer to the variable of type ClQueueT in which the function returns a valid Queue handle. |
- Return values
-
CL_OK | The API executed successfully. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
- Note
- Returned error is a combination of the component Id and error code. Use
CL_GET_ERROR_CODE(RC)
defined in clCommonErrors.h to get the error code.
- Description:
- This API is used to create and initialize a queue.
- Library File:
- ClUtil
- See Also
- clQueueCreate()
Destroys the queue.
- Header File:
- clQueueApi.h
- Parameters
-
pQueueHandle(in) | Pointer to the queue handle returned by clQueueCreate API. |
- Return values
-
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL pointer. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle |
- Note
- Returned error is a combination of the component Id and error code. Use
CL_GET_ERROR_CODE(RET_CODE)
defined in clCommonErrors.h to get the error code.
- description:
- This API is used to delete all the elements in the queue. The destroy callback function, registered during creation is called for every element in the queue.
- Library File:
- ClUtil
- See Also
- clQueueCreate()
Dequeues an element from the queue.
- Header File:
- clQueueApi.h
- Parameters
-
queueHandle | (in) Handle of queue returned by clQueueCreate API. |
userData | (out) Handle of userData, userData of the dequeued node will be returned. |
- Return values
-
CL_OK | The API executed successfully. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
CL_ERR_NULL_POINTER | On passing null pointer of userData. |
CL_ERR_NOT_EXIST | If the queue is empty. |
- Note
- Returned error is a combination of the component Id and error code. Use
CL_GET_ERROR_CODE(RET_CODE)
defined in clCommonErrors.h to get the error code.
- Description:
- This API is used to dequeue the element from the front of the queue. The user dequeue callback, registered during the creation time, is called with the element (user-data) that is dequeued.
- Library File:
- ClUtil
- See Also
- clQueueCreate()
Enqueues an element (user-data) into the Queue.
- Header File:
- clQueueApi.h
- Parameters
-
queueHandle | (in) Handle of queue returned by clQueueCreate API. |
userData | (in) User-data. Memory allocation and deallocation for user-data must be done by you. The data of the node to be stored in the queue. |
- Return values
-
CL_OK | The API executed successfully. |
CL_ERR_NO_MEMORY | On memory allocation failure. |
CL_ERR_MAXSIZE_REACHED | If the maximum size is reached. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle. |
- Note
- Returned error is a combination of the component Id and error code. Use
CL_GET_ERROR_CODE(RET_CODE)
defined in clCommonErrors.h to get the error code.
- Description:
- This API is used to enqueue an element (user-data) into the queue.
- Library File:
- ClUtil
- See Also
- clQueueCreate()
Retrieves the number of data elements in the queue.
- Header File:
- clQueueApi.h
- Parameters
-
queueHandle | (in) Handle of queue returned by the clQueueCreate API. |
pSize | (out) Pointer to variable of type ClUint32T, in which the size of the queue is returned. |
- Return values
-
CL_OK | The API executed successfully. |
CL_ERR_NULL_POINTER | On passing a NULL value for callback function. |
CL_ERR_INVALID_HANDLE | On passing an invalid handle |
- Note
- Returned error is a combination of the component Id and error code. Use
CL_GET_ERROR_CODE(RET_CODE)
defined in clCommonErrors.h to get the error code.
- description:
- This API is used to retrieve the number of data elements in the queue.
- Library File:
- ClUtil
- See Also
- clQueueCreate()
Walks through the queue.
- Header File:
- clQueueApi.h
- Parameters
-
queueHandle | (in) handle of queue returned by clQueueCreate Api. |
fpUserWalkFunction | (in) pointer to the callback function. it accepts the following two parameters:
- ClQueueDataT
- void * each of elements in the queue is passed one by one as the first argument to the callback function.
|
userArg | (in) user-specified argument. this variable is passed as the second argument to the user's call back function. |
- Return values
-
CL_OK | the api executed successfully. |
CL_ERR_NULL_POINTER | on passing a null pointer. |
CL_ERR_INVALID_HANDLE | on passing an invalid handle |
- Note
- returned error is a combination of the component id and error code. use
CL_GET_ERROR_CODE(RET_CODE)
defined in clCommonErrors.h to get the error code.
- Description
- This Api is used to perform a walk on the queue. The user-specified callback function is called with every element (user data) in the queue.
- Library File
- ClUtil
- See Also
- clQueueCreate(), clQueueDelete()