1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
4 //---------------------------------------------------------------------
6 #ifndef PRIORITY_MESSAGE_QUEUE_H
7 #define PRIORITY_MESSAGE_QUEUE_H
10 #include <ObjectList.h>
14 class PriorityMessageQueue
{
16 PriorityMessageQueue();
17 ~PriorityMessageQueue();
22 bool PushMessage(BMessage
*message
, int32 priority
= 0);
23 BMessage
*PopMessage();
25 int32
CountMessages() const;
29 int32
_FindInsertionIndex(int32 priority
);
35 mutable BLocker fLock
;
36 BObjectList
<MessageInfo
> fMessages
;
39 #endif // PRIORITY_MESSAGE_QUEUE_H