OpenClovis Logo

clQueueApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : utils
21  * File : clQueueApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * A simple queue implementation.
28  *
29  *
30  *****************************************************************************/
31 
32 /*************************************************************************/
33 /************************** QUEUE APIs ***********************************/
34 /*************************************************************************/
35 /* */
36 /* clQueueCreate */
37 /* clQueueNodeInsert */
38 /* clQueueNodeDelete */
39 /* clQueueWalk */
40 /* clQueueSizeGet */
41 /* clQueueDelete */
42 /* */
43 /*************************************************************************/
44 
57 #ifndef _CL_QUEUE_API_H_
58 #define _CL_QUEUE_API_H_
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 #include <clCommon.h>
65 
69 typedef ClPtrT ClQueueT;
70 
74 typedef ClHandleT ClQueueNodeT; // Mynk NTC
75 
79 typedef ClPtrT ClQueueDataT;
80 
81 
105  CL_IN void *userArg);
128 typedef void (*ClQueueDequeueCallbackT)(CL_IN ClQueueDataT userData);
129 
174 extern ClRcT clQueueCreate(CL_IN ClUint32T maxSize,
175  CL_IN ClQueueDequeueCallbackT fpUserDequeueCallBack,
176  CL_IN ClQueueDequeueCallbackT fpUserDestroyCallBack,
177  CL_OUT ClQueueT *pQueueHandle);
209  CL_IN ClQueueDataT userData);
241  CL_OUT ClQueueDataT* userData);
242 
280 extern ClRcT clQueueWalk(CL_IN ClQueueT queueHandle,
281  CL_IN ClQueueWalkCallbackT fpUserWalkFunction,
282  CL_IN void* userArg);
311 extern ClRcT clQueueSizeGet(CL_IN ClQueueT queueHandle,
312  CL_OUT ClUint32T *pSize);
313 
342 extern ClRcT clQueueDelete(CL_IN ClQueueT* pQueueHandle);
343 
344 #ifdef __cplusplus
345 }
346 #endif
347 
348 #endif /* _CL_QUEUE_API_H_ */
349 
Typical defines found in any software project.
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_OUT
CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:110
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106
ClRcT(* ClQueueWalkCallbackT)(CL_IN ClQueueDataT userData, CL_IN void *userArg)
Walk Callback gets called, whenever traverse happens on the Queue.
Definition: clQueueApi.h:104
void(* ClQueueDequeueCallbackT)(CL_IN ClQueueDataT userData)
Dequeue callback gets called, whenever a Node is getting deleted.
Definition: clQueueApi.h:128
ClRcT clQueueWalk(CL_IN ClQueueT queueHandle, CL_IN ClQueueWalkCallbackT fpUserWalkFunction, CL_IN void *userArg)
Walks through the queue.
ClHandleT ClQueueNodeT
The type of the handle for the queue node.
Definition: clQueueApi.h:74
ClPtrT ClQueueT
The type of the handle for the queue.
Definition: clQueueApi.h:69
ClRcT clQueueNodeInsert(CL_IN ClQueueT queueHandle, CL_IN ClQueueDataT userData)
Enqueues an element (user-data) into the Queue.
ClRcT clQueueNodeDelete(CL_IN ClQueueT queueHandle, CL_OUT ClQueueDataT *userData)
Dequeues an element from the queue.
ClRcT clQueueDelete(CL_IN ClQueueT *pQueueHandle)
Destroys the queue.
ClRcT clQueueCreate(CL_IN ClUint32T maxSize, CL_IN ClQueueDequeueCallbackT fpUserDequeueCallBack, CL_IN ClQueueDequeueCallbackT fpUserDestroyCallBack, CL_OUT ClQueueT *pQueueHandle)
Creates a queue.
ClPtrT ClQueueDataT
The type of the handle for the user-data.
Definition: clQueueApi.h:79
ClRcT clQueueSizeGet(CL_IN ClQueueT queueHandle, CL_OUT ClUint32T *pSize)
Retrieves the number of data elements in the queue.

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