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 21 bool AddMessage(BMessage* message); 22 23 void Close(); 24 void Acquire(); 25 void Release(); 26 27 BMessageQueue* Queue() { return &fQueue; } 28 29 private: 30 ~BDirectMessageTarget(); 31 32 int32 fReferenceCount; 33 BMessageQueue fQueue; 34 bool fClosed; 35 }; 36 37 } // namespace BPrivate 38 39 #endif // _DIRECT_MESSAGE_TARGET_H 40