You can now test if there are more messages waiting in the link.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15512 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-12-12 13:45:09 +00:00
parent 58290b7b37
commit 1b974d07ee
2 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,7 @@ class LinkReceiver {
port_id Port(void) { return fReceivePort; } port_id Port(void) { return fReceivePort; }
status_t GetNextMessage(int32 &code, bigtime_t timeout = B_INFINITE_TIMEOUT); status_t GetNextMessage(int32 &code, bigtime_t timeout = B_INFINITE_TIMEOUT);
bool HasMessages() const;
bool NeedsReply() const; bool NeedsReply() const;
int32 Code() const; int32 Code() const;

View File

@ -101,6 +101,13 @@ LinkReceiver::GetNextMessage(int32 &code, bigtime_t timeout)
} }
bool
LinkReceiver::HasMessages() const
{
return port_count(fReceivePort) > 0;
}
bool bool
LinkReceiver::NeedsReply() const LinkReceiver::NeedsReply() const
{ {