| [354] | 1 | /* $Id: queue.hpp,v 1.1 2000/04/23 14:55:19 ktk Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /* SCCSID = %W% %E% */
|
|---|
| 4 | /****************************************************************************
|
|---|
| 5 | * *
|
|---|
| 6 | * Copyright (c) IBM Corporation 1994 - 1997. *
|
|---|
| 7 | * *
|
|---|
| 8 | * The following IBM OS/2 source code is provided to you solely for the *
|
|---|
| 9 | * the purpose of assisting you in your development of OS/2 device drivers. *
|
|---|
| 10 | * You may use this code in accordance with the IBM License Agreement *
|
|---|
| 11 | * provided in the IBM Device Driver Source Kit for OS/2. *
|
|---|
| 12 | * *
|
|---|
| 13 | ****************************************************************************/
|
|---|
| 14 | /**@internal %W%
|
|---|
| 15 | * Defines, class definations and prototypes for
|
|---|
| 16 | * @version %I%
|
|---|
| 17 | * @context Unless otherwise noted, all interfaces are Ring-0, 16-bit,
|
|---|
| 18 | * <stack context>.
|
|---|
| 19 | * @history
|
|---|
| 20 | *
|
|---|
| 21 | */
|
|---|
| 22 | #ifndef QUEUE_INCLUDED
|
|---|
| 23 | #define QUEUE_INCLUDED
|
|---|
| 24 |
|
|---|
| 25 | #ifndef OS2_INCLUDED
|
|---|
| 26 | #define INCL_NOPMAPI
|
|---|
| 27 | #include <os2.h>
|
|---|
| 28 | #endif
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 | class QUEUEELEMENT {
|
|---|
| 32 | public:
|
|---|
| 33 | QUEUEELEMENT *pNext; // next element on the queue
|
|---|
| 34 | QUEUEELEMENT(void):
|
|---|
| 35 | pNext(NULL)
|
|---|
| 36 | {};
|
|---|
| 37 | };
|
|---|
| 38 |
|
|---|
| 39 | typedef QUEUEELEMENT *PQUEUEELEMENT;
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 | class QUEUEHEAD {
|
|---|
| 43 | public:
|
|---|
| 44 | inline PQUEUEELEMENT Head(void) { return pHead; };
|
|---|
| 45 | inline PQUEUEELEMENT Tail(void) { return pTail; };
|
|---|
| 46 | void PushOnHead(PQUEUEELEMENT);
|
|---|
| 47 | void PushOnTail(PQUEUEELEMENT);
|
|---|
| 48 | PQUEUEELEMENT PopHead(void);
|
|---|
| 49 | PQUEUEELEMENT PopTail(void);
|
|---|
| 50 | USHORT DestroyElement(PQUEUEELEMENT);
|
|---|
| 51 | PQUEUEELEMENT PopElement(PQUEUEELEMENT);
|
|---|
| 52 | inline BOOL IsElements(void) { return pHead != NULL; };
|
|---|
| 53 | QUEUEHEAD(void) { pHead = pTail = NULL; };
|
|---|
| 54 |
|
|---|
| 55 | private:
|
|---|
| 56 | PQUEUEELEMENT pHead;
|
|---|
| 57 | PQUEUEELEMENT pTail;
|
|---|
| 58 | };
|
|---|
| 59 |
|
|---|
| 60 | typedef QUEUEHEAD *PQUEUEHEAD;
|
|---|
| 61 |
|
|---|
| 62 | #endif
|
|---|
| 63 |
|
|---|