2 * Copyright 2001-2005, Haiku.
3 * Distributed under the terms of the MIT License.
6 * Marc Flerackers (mflerackers@androme.be)
13 BInvoker::BInvoker(BMessage
* message
, BMessenger messenger
)
16 fMessenger(messenger
),
18 fTimeout(B_INFINITE_TIMEOUT
),
24 BInvoker::BInvoker(BMessage
* message
, const BHandler
* handler
,
25 const BLooper
* looper
)
28 fMessenger(BMessenger(handler
, looper
)),
30 fTimeout(B_INFINITE_TIMEOUT
),
40 fTimeout(B_INFINITE_TIMEOUT
),
53 BInvoker::SetMessage(BMessage
* message
)
55 if (fMessage
== message
)
66 BInvoker::Message() const
73 BInvoker::Command() const
76 return fMessage
->what
;
83 BInvoker::SetTarget(BMessenger messenger
)
85 fMessenger
= messenger
;
91 BInvoker::SetTarget(const BHandler
* handler
, const BLooper
* looper
)
93 fMessenger
= BMessenger(handler
, looper
);
99 BInvoker::IsTargetLocal() const
101 return fMessenger
.IsTargetLocal();
106 BInvoker::Target(BLooper
** _looper
) const
108 return fMessenger
.Target(_looper
);
113 BInvoker::Messenger() const
120 BInvoker::SetHandlerForReply(BHandler
* replyHandler
)
122 fReplyTo
= replyHandler
;
128 BInvoker::HandlerForReply() const
135 BInvoker::Invoke(BMessage
* message
)
143 return fMessenger
.SendMessage(message
, fReplyTo
, fTimeout
);
148 BInvoker::InvokeNotify(BMessage
* message
, uint32 kind
)
150 if (fNotifyKind
!= 0)
151 return B_WOULD_BLOCK
;
153 BeginInvokeNotify(kind
);
154 status_t err
= Invoke(message
);
162 BInvoker::SetTimeout(bigtime_t timeout
)
170 BInvoker::Timeout() const
177 BInvoker::InvokeKind(bool* _notify
)
180 *_notify
= fNotifyKind
!= 0;
182 if (fNotifyKind
!= 0)
185 return B_CONTROL_INVOKED
;
190 BInvoker::BeginInvokeNotify(uint32 kind
)
197 BInvoker::EndInvokeNotify()
203 void BInvoker::_ReservedInvoker1() {}
204 void BInvoker::_ReservedInvoker2() {}
205 void BInvoker::_ReservedInvoker3() {}
208 BInvoker::BInvoker(const BInvoker
&)
214 BInvoker::operator=(const BInvoker
&)