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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user