2009-11-26 00:34:59 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2007, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Ingo Weinhold (bonefish@users.sf.net)
|
|
|
|
*/
|
2005-10-29 20:27:43 +04:00
|
|
|
#ifndef _MESSENGER_H
|
|
|
|
#define _MESSENGER_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <OS.h>
|
|
|
|
#include <ByteOrder.h>
|
|
|
|
#include <Message.h>
|
|
|
|
|
|
|
|
class BHandler;
|
|
|
|
class BLooper;
|
|
|
|
|
2009-11-26 00:34:59 +03:00
|
|
|
|
2005-10-29 20:27:43 +04:00
|
|
|
class BMessenger {
|
2009-11-26 00:34:59 +03:00
|
|
|
public:
|
2005-10-29 20:27:43 +04:00
|
|
|
BMessenger();
|
|
|
|
BMessenger(const BMessenger &from);
|
|
|
|
~BMessenger();
|
|
|
|
|
|
|
|
// Operators and misc
|
|
|
|
|
|
|
|
BMessenger &operator=(const BMessenger &from);
|
|
|
|
bool operator==(const BMessenger &other) const;
|
|
|
|
|
|
|
|
bool IsValid() const;
|
|
|
|
team_id Team() const;
|
|
|
|
|
|
|
|
//----- Private or reserved -----------------------------------------
|
|
|
|
|
|
|
|
class Private;
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class Private;
|
2009-11-26 00:34:59 +03:00
|
|
|
|
|
|
|
void _SetTo(team_id team, port_id port, int32 token);
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
port_id fPort;
|
|
|
|
int32 fHandlerToken;
|
|
|
|
team_id fTeam;
|
2009-11-26 00:34:59 +03:00
|
|
|
|
|
|
|
int32 _reserved[3];
|
2005-10-29 20:27:43 +04:00
|
|
|
};
|
|
|
|
|
2009-11-26 00:34:59 +03:00
|
|
|
bool operator<(const BMessenger &a, const BMessenger &b);
|
|
|
|
bool operator!=(const BMessenger &a, const BMessenger &b);
|
2005-10-29 20:27:43 +04:00
|
|
|
|
|
|
|
#endif // _MESSENGER_H
|