Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6queue.h
Go to the documentation of this file.
1 
15 #ifndef P6QUEUE_H__
16 #define P6QUEUE_H__ 1
17 
18 #include "p6com.h"
19 
20 
21 #ifdef __cplusplus
22 namespace P6R {
23 extern "C" {
24 #endif
25 
30 #define P6MAX_SIMPLE_MSG_PAYLOAD 64
31 #define P6MAX_QUEUENAME_LEN 64
32 
34 static const P6QFLAGS P6Q_NOFLAGS = 0x00000000;
35 static const P6QFLAGS P6Q_SYNCHRONOUS = 0x00000001;
37 typedef enum {
38  P6QP_LOW = 1,
39  P6QP_HIGH = 10,
41 } P6QPRIORITY;
42 
44 interface p6IQueue;
45 
51 typedef P6VOID (*QMSGCLEANUPCB)(P6VOID *pData,P6VOID *pCtx);
52 
58 #undef INTERFACE
59 #define INTERFACE p6IInitMessage
61 {
69  P6DECLCOMMETHOD(initialize)(P6THIS) P6PURE;
70 
80  P6DECLCOMMETHOD(setType)(P6THIS_ P6ATOM nType) P6PURE;
81 
82 
93  P6DECLCOMMETHOD(setErr)(P6THIS_ P6ERR err) P6PURE;
94 
110  P6DECLCOMMETHOD(setData)(P6THIS_ P6VOID *pData) P6PURE;
111 
122  P6DECLCOMMETHOD(setDataObject)(P6THIS_ p6ICom *pIface) P6PURE;
123 
133  P6DECLCOMMETHOD(setSourceQueue)(P6THIS_ p6IQueue *pQueue) P6PURE;
134 
148  P6DECLCOMMETHOD(setCleanupRoutine)(P6THIS_ QMSGCLEANUPCB pfnCleanup,P6VOID *pCtx) P6PURE;
149 };
150 #define IF_p6IInitMessage {0x72675A63,0x538A,0x4900,{0x99,0xD4,0x48,0x6B,0x03,0x55,0x02,0x64}}
151 
163 #undef INTERFACE
164 #define INTERFACE p6IMessage
166 {
177  P6DECLCOMMETHOD(getType)(P6THIS_ P6ATOM *pAtom) P6PURE;
178 
189  P6DECLCOMMETHOD(getErr)(P6THIS_ P6ERR *pErr) P6PURE;
190 
211  P6DECLCOMMETHOD(getData)(P6THIS_ OUT P6VOID **ppData) P6PURE;
212 
225  P6DECLCOMMETHOD(getDataObject)(P6THIS_ const P6REFIID iid,P6VOID **ppIface) P6PURE;
226 
241  P6DECLCOMMETHOD(getSourceQueue)(P6THIS_ p6IQueue **ppQueue) P6PURE;
242 
252  P6DECLCOMMETHOD(send)(P6THIS_ p6IQueue *pQueue,P6QPRIORITY nPriority) P6PURE;
253 
263  P6DECLCOMMETHOD(respond)(P6THIS_ P6ERR err,P6QPRIORITY nPriority) P6PURE;
264 };
265 #define IF_p6IMessage {0xC0747717,0xF483,0x4537,{0xAD,0x32,0x85,0x90,0x8F,0x84,0xF0,0x7A}}
266 
267 #define COMP_p6Message {0xB4486353,0x0DE7,0x47f9,{0x89,0x86,0xFB,0x02,0xA5,0x7A,0xAC,0x09}}
268 
272 #define SIMPLEMSG_SECTION P6TEXT("SimpleMsg")
273 #define SIMPLEMSG_INITCOUNT P6TEXT("initialCount")
274 #define SIMPLEMSG_INITCOUNT_DEF 1000
275 #define SIMPLEMSG_GROWCOUNT P6TEXT("growby")
276 #define SIMPLEMSG_GROWCOUNT_DEF 100
277 
278 typedef P6VOID (*QUEUEWORKER)(p6ICurThread *pCurThread,p6ILogProducer *pThreadLogger,p6IMessage *pMessage,P6VOID *pCtx);
279 
288 #undef INTERFACE
289 #define INTERFACE p6IQueue
291 {
304  P6DECLCOMMETHOD(enQueue)(P6THIS_ p6IMessage *pMessage,P6QPRIORITY nPriority) P6PURE;
305 
317  P6DECLCOMMETHOD(getName)(P6THIS_ P6WCHAR *pBuffer,P6INT32 cBuffer) P6PURE;
318 
327  P6DECLCOMMETHOD(numQueued)(P6THIS_ P6UINT32 *pcQueued) P6PURE;
328 };
329 #define IF_p6IQueue {0x4F6136F9,0x55DB,0x4514,{0x97,0x54,0xAE,0x37,0x1D,0x7A,0x74,0x21}}
330 
337 #undef INTERFACE
338 #define INTERFACE p6IQueueManager
340 {
356  P6DECLCOMMETHOD(initialize)(P6THIS_ P6QFLAGS fFlags,const P6WCHAR *pcszQueueName,P6INT32 cThreads,QUEUEWORKER pfnWorker,P6VOID *pCtx) P6PURE;
357 
366  P6DECLCOMMETHOD(start)(P6THIS) P6PURE;
367 
380  P6DECLCOMMETHOD(getQueue)(P6THIS_ p6IQueue **ppQueue) P6PURE;
381 
389  P6DECLCOMMETHOD(setWorker)(P6THIS) P6PURE;
390 
398  P6DECLCOMMETHOD(purge)(P6THIS) P6PURE;
399 
406  P6DECLCOMMETHOD(flush)(P6THIS) P6PURE;
407 
417 };
418 #define IF_p6IQueueManager {0xBDF24915,0xE067,0x4a94,{0x8D,0x20,0x20,0x42,0x3C,0x02,0x91,0xDB}}
419 #define COMP_p6Queue {0x39F9BC73,0x5898,0x454f,{0x84,0x8A,0x48,0x46,0x7D,0xE3,0xD7,0xDF}}
420 
421 #ifdef __cplusplus
422 } /* extern "C" */
423 } // namespace
424 #endif
425 
426 
427 #endif
#define P6REFIID
Definition: p6defs.h:197
uint32_t P6UINT32
Definition: p6types.h:77
This interface provides an asynchronous multi-threaded priority queue.
Definition: p6queue.h:290
#define P6DECLAREICOM
Definition: p6defs.h:191
#define P6PURE
Definition: p6defs.h:192
This interface is used by a thread to manage information about itself.
Definition: p6thread.h:99
P6SIZE P6ATOM
Atom type see P6R::p6IAtom in p6com.h.
Definition: p6types.h:142
#define OUT
Definition: p6defs.h:23
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:111
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:97
P6VOID(* QUEUEWORKER)(p6ICurThread *pCurThread, p6ILogProducer *pThreadLogger, p6IMessage *pMessage, P6VOID *pCtx)
Definition: p6queue.h:278
The p6IQueueManager interface is used to initilze and manage a queue component,.
Definition: p6queue.h:339
P6UINT32 P6ERR
COM err return type see P6ERR.h.
Definition: p6types.h:141
#define P6DECLCOMMETHOD(method)
Definition: p6defs.h:189
#define P6THIS_
Definition: p6defs.h:193
This interface represents a generic p6IQueue message.
Definition: p6queue.h:165
P6COM definitions and interfaces.
P6QPRIORITY
Definition: p6queue.h:37
P6VOID(* QMSGCLEANUPCB)(P6VOID *pData, P6VOID *pCtx)
Defines a message data cleanup routine which is called when the message is destoryed to cleanup any d...
Definition: p6queue.h:51
void P6VOID
Definition: p6types.h:109
This interface is used to initialize an p6IMessage component.
Definition: p6queue.h:60
int32_t P6INT32
Definition: p6types.h:76
#define P6THIS
Definition: p6defs.h:194
P6UINT32 P6QFLAGS
Definition: p6queue.h:33
#define P6DECLAREIF_(iface, baseif)
Definition: p6defs.h:188