haiku/headers/os/app/MessageRunner.h
Axel Dörfler 60bf6a1fbe Removed the detached version of the BMessageRunner object again, and instead
have a static method for spawning one (BMessageRunner::StartSending()), as
suggested by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16966 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-02 14:47:01 +00:00

58 lines
1.7 KiB
C++

/*
* Copyright 2001-2006, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ingo Weinhold (bonefish@users.sf.net)
*/
#ifndef _MESSAGE_RUNNER_H
#define _MESSAGE_RUNNER_H
#include <Messenger.h>
class BMessageRunner {
public:
BMessageRunner(BMessenger target, const BMessage *message,
bigtime_t interval, int32 count = -1);
BMessageRunner(BMessenger target, const BMessage *message,
bigtime_t interval, int32 count, BMessenger replyTo);
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 &);
BMessageRunner &operator=(const BMessageRunner &);
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();
int32 fToken;
uint32 _reserved[6];
};
#endif // _MESSAGE_RUNNER_H