Add BMessenger::SetTo() to reinitialize a BMessenger.

This allows to reuse BMessenger objects for different targets, or to
recheck validity after initial creation. With that one can use the same
BMessenger after launching an application that was previously not found
valid for example.
This commit is contained in:
Michael Lotz
2013-03-31 20:16:04 +02:00
parent 32057ce922
commit 6de478363e
2 changed files with 98 additions and 27 deletions
+5
View File
@@ -48,6 +48,9 @@ public:
// Operators and misc
status_t SetTo(const char *signature, team_id team = -1);
status_t SetTo(const BHandler *handler, const BLooper *looper = NULL);
BMessenger &operator=(const BMessenger &from);
bool operator==(const BMessenger &other) const;
@@ -63,6 +66,8 @@ private:
void _SetTo(team_id team, port_id port, int32 token);
void _InitData(const char *signature, team_id team, status_t *result);
void _InitData(const BHandler *handler, const BLooper *looper,
status_t *result);
private:
port_id fPort;