1 /* 2 * Copyright 2003-2005, Haiku. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef MESSENGER_PRIVATE_H 6 #define MESSENGER_PRIVATE_H 7 8 9 #include <Messenger.h> 10 #include <TokenSpace.h> 11 12 13 class BMessenger::Private { 14 public: 15 Private(BMessenger* messenger) : fMessenger(messenger) {} 16 Private(BMessenger& messenger) : fMessenger(&messenger) {} 17 18 port_id Port() 19 { return fMessenger->fPort; } 20 int32 Token() 21 { return fMessenger->fHandlerToken; } 22 team_id Team() 23 { return fMessenger->fTeam; } 24 bool IsPreferredTarget() 25 { return fMessenger->fHandlerToken == B_PREFERRED_TOKEN; } 26 27 void SetTo(team_id team, port_id port, int32 token) 28 { fMessenger->_SetTo(team, port, token); } 29 30 private: 31 BMessenger* fMessenger; 32 }; 33 34 #endif // MESSENGER_PRIVATE_H 35