2006-03-12 12:27:16 +00:00
|
|
|
/*
|
2015-01-16 18:00:27 -05:00
|
|
|
* Copyright 2001-2010 Haiku, Inc. All rights reserved.
|
2006-03-12 12:27:16 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-06-04 20:29:23 +00:00
|
|
|
#ifndef _MESSAGE_RUNNER_H
|
|
|
|
#define _MESSAGE_RUNNER_H
|
|
|
|
|
|
|
|
|
2006-03-12 12:27:16 +00:00
|
|
|
#include <Messenger.h>
|
2003-06-04 20:29:23 +00:00
|
|
|
|
|
|
|
|
2006-03-12 12:27:16 +00:00
|
|
|
class BMessageRunner {
|
2010-11-17 23:18:08 +00:00
|
|
|
public:
|
|
|
|
BMessageRunner(BMessenger target,
|
|
|
|
const BMessage* message, bigtime_t interval,
|
|
|
|
int32 count = -1);
|
2010-11-17 23:23:09 +00:00
|
|
|
BMessageRunner(BMessenger target,
|
|
|
|
const BMessage& message, bigtime_t interval,
|
|
|
|
int32 count = -1);
|
2010-11-17 23:18:08 +00:00
|
|
|
BMessageRunner(BMessenger target,
|
|
|
|
const BMessage* message, bigtime_t interval,
|
|
|
|
int32 count, BMessenger replyTo);
|
2010-11-17 23:23:09 +00:00
|
|
|
BMessageRunner(BMessenger target,
|
|
|
|
const BMessage& message, bigtime_t interval,
|
|
|
|
int32 count, BMessenger replyTo);
|
2010-11-17 23:18:08 +00:00
|
|
|
virtual ~BMessageRunner();
|
|
|
|
|
|
|
|
status_t InitCheck() const;
|
|
|
|
|
|
|
|
status_t SetInterval(bigtime_t interval);
|
|
|
|
status_t SetCount(int32 count);
|
|
|
|
status_t GetInfo(bigtime_t* interval,
|
|
|
|
int32* count) const;
|
|
|
|
|
|
|
|
static status_t StartSending(BMessenger target,
|
|
|
|
const BMessage* message, bigtime_t interval,
|
|
|
|
int32 count);
|
|
|
|
static status_t StartSending(BMessenger target,
|
|
|
|
const BMessage* message, bigtime_t interval,
|
|
|
|
int32 count, BMessenger replyTo);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BMessageRunner(const BMessageRunner &);
|
2015-01-16 18:00:27 -05:00
|
|
|
BMessageRunner& operator=(const BMessageRunner&);
|
2010-11-17 23:18:08 +00:00
|
|
|
|
|
|
|
static int32 _RegisterRunner(BMessenger target,
|
|
|
|
const BMessage* message, bigtime_t interval,
|
|
|
|
int32 count, bool detach,
|
|
|
|
BMessenger replyTo);
|
|
|
|
|
|
|
|
void _InitData(BMessenger target,
|
|
|
|
const BMessage* message, bigtime_t interval,
|
|
|
|
int32 count, BMessenger replyTo);
|
|
|
|
status_t _SetParams(bool resetInterval,
|
|
|
|
bigtime_t interval, bool resetCount,
|
|
|
|
int32 count);
|
|
|
|
|
|
|
|
virtual void _ReservedMessageRunner1();
|
|
|
|
virtual void _ReservedMessageRunner2();
|
|
|
|
virtual void _ReservedMessageRunner3();
|
|
|
|
virtual void _ReservedMessageRunner4();
|
|
|
|
virtual void _ReservedMessageRunner5();
|
|
|
|
virtual void _ReservedMessageRunner6();
|
|
|
|
|
|
|
|
private:
|
|
|
|
int32 fToken;
|
|
|
|
uint32 _reserved[6];
|
2003-06-04 20:29:23 +00:00
|
|
|
};
|
|
|
|
|
2010-11-17 23:18:08 +00:00
|
|
|
|
2003-06-04 20:29:23 +00:00
|
|
|
#endif // _MESSAGE_RUNNER_H
|