4 #include "SMMessages.h"
15 SMInvoker::~SMInvoker()
22 SMInvoker::ReplySuccess()
24 return (fReplyMessage
&& fReplyMessage
->what
== MSG_REPLY
);
29 SMInvoker::DirectReply()
38 SMInvoker1::SMInvoker1(bool useReplyTo
)
40 fUseReplyTo(useReplyTo
)
46 SMInvoker1::Invoke(BMessenger
&target
, BHandler
*replyHandler
,
47 BMessenger
&replyMessenger
)
49 BHandler
*replyTo
= (fUseReplyTo
? replyHandler
: NULL
);
50 status_t result
= target
.SendMessage(MSG_TEST
, replyTo
);
58 SMInvoker2::SMInvoker2(bool useMessage
, bool useReplyTo
, bigtime_t timeout
)
60 fUseMessage(useMessage
),
61 fUseReplyTo(useReplyTo
),
68 SMInvoker2::Invoke(BMessenger
&target
, BHandler
*replyHandler
,
69 BMessenger
&replyMessenger
)
71 BHandler
*replyTo
= (fUseReplyTo
? replyHandler
: NULL
);
72 BMessage
_message(MSG_TEST
);
73 BMessage
*message
= (fUseMessage
? &_message
: NULL
);
74 status_t result
= target
.SendMessage(message
, replyTo
, fTimeout
);
82 SMInvoker3::SMInvoker3(bool useMessage
, bool useReplyTo
, bigtime_t timeout
)
84 fUseMessage(useMessage
),
85 fUseReplyTo(useReplyTo
),
92 SMInvoker3::Invoke(BMessenger
&target
, BHandler
*replyHandler
,
93 BMessenger
&replyMessenger
)
95 BMessenger badMessenger
;
96 BMessenger
&replyTo
= (fUseReplyTo
? replyMessenger
: badMessenger
);
97 BMessage
_message(MSG_TEST
);
98 BMessage
*message
= (fUseMessage
? &_message
: NULL
);
99 status_t result
= target
.SendMessage(message
, replyTo
, fTimeout
);
107 SMInvoker4::SMInvoker4(bool useReply
)
115 SMInvoker4::Invoke(BMessenger
&target
, BHandler
*replyHandler
,
116 BMessenger
&replyMessenger
)
119 fReplyMessage
= new BMessage(uint32(0));
120 status_t result
= target
.SendMessage(MSG_TEST
, fReplyMessage
);
128 SMInvoker5::SMInvoker5(bool useMessage
, bool useReply
,
129 bigtime_t deliveryTimeout
, bigtime_t replyTimeout
)
131 fUseMessage(useMessage
),
133 fDeliveryTimeout(deliveryTimeout
),
134 fReplyTimeout(replyTimeout
)
140 SMInvoker5::Invoke(BMessenger
&target
, BHandler
*replyHandler
,
141 BMessenger
&replyMessenger
)
144 fReplyMessage
= new BMessage(uint32(0));
145 BMessage
_message(MSG_TEST
);
146 BMessage
*message
= (fUseMessage
? &_message
: NULL
);
147 status_t result
= target
.SendMessage(message
, fReplyMessage
,
148 fDeliveryTimeout
, fReplyTimeout
);