1 /* 2 * Copyright 2007, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 #ifndef _DIRECT_MESSAGE_TARGET_H 9 #define _DIRECT_MESSAGE_TARGET_H 10 11 12 #include <MessageQueue.h> 13 14 15 namespace BPrivate { 16 17 class BDirectMessageTarget { 18 public: 19 BDirectMessageTarget(); 20 ~BDirectMessageTarget(); 21 22 bool AddMessage(BMessage* message); 23 24 void Close(); 25 void Acquire(); 26 void Release(); 27 28 BMessageQueue* Queue() { return &fQueue; } 29 30 private: 31 int32 fReferenceCount; 32 BMessageQueue fQueue; 33 bool fClosed; 34 }; 35 36 } // namespace BPrivate 37 38 #endif // _DIRECT_MESSAGE_TARGET_H 39