mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
931 B
73 lines
931 B
/*++
|
|
|
|
|
|
--*/
|
|
|
|
#ifndef __QUEUE_HXX__
|
|
#define __QUEUE_HXX__
|
|
|
|
#define INITIALQUEUESLOTS 4
|
|
|
|
typedef struct
|
|
{
|
|
void * Buffer;
|
|
unsigned int BufferLength;
|
|
} QUEUE_ITEM;
|
|
|
|
class QUEUE
|
|
{
|
|
private:
|
|
|
|
QUEUE_ITEM * QueueSlots;
|
|
int NumberOfQueueSlots;
|
|
int EndOfQueue;
|
|
QUEUE_ITEM InitialQueueSlots[INITIALQUEUESLOTS];
|
|
|
|
public:
|
|
|
|
QUEUE (
|
|
);
|
|
|
|
~QUEUE (
|
|
);
|
|
|
|
int
|
|
PutOnQueue (
|
|
IN void * Item,
|
|
IN unsigned int Length
|
|
);
|
|
|
|
void *
|
|
TakeOffQueue (
|
|
OUT unsigned int * Length
|
|
);
|
|
|
|
int
|
|
IsQueueEmpty (
|
|
);
|
|
};
|
|
|
|
|
|
inline int
|
|
QUEUE::IsQueueEmpty (
|
|
)
|
|
/*++
|
|
|
|
Routine Description:
|
|
|
|
This method is used to determine if a queue is empty.
|
|
|
|
Return Value:
|
|
|
|
Non-zero will be returned if the queue is empty, otherwise, zero
|
|
will be returned.
|
|
|
|
--*/
|
|
{
|
|
return((EndOfQueue == 0 ? 1 : 0));
|
|
}
|
|
|
|
#endif // __QUEUE_HXX__
|
|
|
|
|
|
|