vfs: check userland buffers before reading them.
[haiku.git] / src / tests / kits / app / bmessenger / SMInvoker.h
blob95cf6481dd3803dbd31b6b04ec7d0ce62cc13003
1 // SMInvoker.h
3 #ifndef SM_INVOKER_H
4 #define SM_INVOKER_H
6 #include <Messenger.h>
8 class SMInvoker {
9 public:
10 SMInvoker();
11 virtual ~SMInvoker();
13 virtual status_t Invoke(BMessenger &target, BHandler *replyHandler,
14 BMessenger &replyMessenger) = 0;
16 bool ReplySuccess();
17 bool DirectReply();
19 protected:
20 BMessage *fReplyMessage;
23 // Invoker for SendMessage(uint32, BHandler *)
24 class SMInvoker1 : public SMInvoker {
25 public:
26 SMInvoker1(bool useReplyTo);
28 virtual status_t Invoke(BMessenger &target, BHandler *replyHandler,
29 BMessenger &replyMessenger);
31 private:
32 bool fUseReplyTo;
35 // Invoker for SendMessage(BMessage *, BHandler *, bigtime_t)
36 class SMInvoker2 : public SMInvoker {
37 public:
38 SMInvoker2(bool useMessage, bool useReplyTo, bigtime_t timeout);
40 virtual status_t Invoke(BMessenger &target, BHandler *replyHandler,
41 BMessenger &replyMessenger);
43 private:
44 bool fUseMessage;
45 bool fUseReplyTo;
46 bigtime_t fTimeout;
49 // Invoker for SendMessage(BMessage *, BMessenger, bigtime_t)
50 class SMInvoker3 : public SMInvoker {
51 public:
52 SMInvoker3(bool useMessage, bool useReplyTo, bigtime_t timeout);
54 virtual status_t Invoke(BMessenger &target, BHandler *replyHandler,
55 BMessenger &replyMessenger);
57 private:
58 bool fUseMessage;
59 bool fUseReplyTo;
60 bigtime_t fTimeout;
63 // Invoker for SendMessage(uint32, BMessage *)
64 class SMInvoker4 : public SMInvoker {
65 public:
66 SMInvoker4(bool useReply);
68 virtual status_t Invoke(BMessenger &target, BHandler *replyHandler,
69 BMessenger &replyMessenger);
71 private:
72 bool fUseReply;
75 // Invoker for SendMessage(BMessage *, BMessage *, bigtime_t, bigtime_t)
76 class SMInvoker5 : public SMInvoker {
77 public:
78 SMInvoker5(bool useMessage, bool useReply, bigtime_t deliveryTimeout,
79 bigtime_t replyTimeout);
81 virtual status_t Invoke(BMessenger &target, BHandler *replyHandler,
82 BMessenger &replyMessenger);
84 private:
85 bool fUseMessage;
86 bool fUseReply;
87 bigtime_t fDeliveryTimeout;
88 bigtime_t fReplyTimeout;
91 #endif // SM_INVOKER_H