2002-07-09 16:24:59 +04:00
|
|
|
//
|
2002-10-26 22:59:16 +04:00
|
|
|
// $Id: MessageQueue.h,v 1.2 2002/10/26 18:59:16 beveloper Exp $
|
2002-07-09 16:24:59 +04:00
|
|
|
//
|
|
|
|
// This is the BMessageQueue interface for OpenBeOS. It has been created
|
|
|
|
// to be source and binary compatible with the BeOS version of
|
|
|
|
// BMessageQueue.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _OPENBEOS_MESSAGEQUEUE_H
|
|
|
|
#define _OPENBEOS_MESSAGEQUEUE_H
|
|
|
|
|
|
|
|
|
2002-10-26 22:59:16 +04:00
|
|
|
#include <Locker.h>
|
|
|
|
#include <Message.h> /* For convenience */
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef USE_OPENBEOS_NAMESPACE
|
|
|
|
namespace OpenBeOS {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class BMessageQueue {
|
|
|
|
public:
|
|
|
|
BMessageQueue();
|
|
|
|
virtual ~BMessageQueue();
|
|
|
|
|
|
|
|
void AddMessage(BMessage *message);
|
|
|
|
void RemoveMessage(BMessage *message);
|
|
|
|
|
|
|
|
int32 CountMessages(void) const;
|
|
|
|
bool IsEmpty(void) const;
|
|
|
|
|
|
|
|
BMessage *FindMessage(int32 index) const;
|
|
|
|
BMessage *FindMessage(uint32 what, int32 index=0) const;
|
|
|
|
|
|
|
|
bool Lock(void);
|
|
|
|
void Unlock(void);
|
|
|
|
bool IsLocked(void);
|
|
|
|
|
|
|
|
BMessage *NextMessage(void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
// Reserved space in the vtable for future changes to BMessageQueue
|
|
|
|
virtual void _ReservedMessageQueue1(void);
|
|
|
|
virtual void _ReservedMessageQueue2(void);
|
|
|
|
virtual void _ReservedMessageQueue3(void);
|
|
|
|
|
|
|
|
BMessageQueue(const BMessageQueue &);
|
|
|
|
BMessageQueue &operator=(const BMessageQueue &);
|
|
|
|
|
|
|
|
BMessage *fTheQueue;
|
|
|
|
BMessage *fQueueTail;
|
|
|
|
int32 fMessageCount;
|
|
|
|
BLocker fLocker;
|
|
|
|
|
|
|
|
// Reserved space for future changes to BMessageQueue
|
|
|
|
uint32 fReservedSpace[3];
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef USE_OPENBEOS_NAMESPACE
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _OPENBEOS_MESSAGEQUEUE_H
|