| Class Overview |
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);
Tells the roster to send the specified message to the target
BMessenger
every interval microseconds. The message will be sent
count times (if
count is -1, the message will be sent forever, or until the
BMessageRunner is reconfigured or deleted).
The second form of the constructor lets the application specify, in
replyTo, the
BMessenger
to which replies to the message should be sent.
The BMessageRunner can be reconfigured (to change the interval or count)
by calling
SetInterval() and
SetCount().
After constructing a BMessageRunner, you should call
InitCheck() to
ensure that the object was created properly.
status_t GetInfo(bigtime_t* interval,
int32* count) const;
GetInfo() returns in interval
the time in microseconds that will pass
between messages being sent, and in count the number of times the message
will be sent.
| Return Code | Description |
|---|---|
| Information returned successfully. |
| The roster returned invalid information about the
|
| The roster returned invalid information about the
|
Other errors. | In general, getting an error back from this function is a bad thing. |
status_t InitCheck() const;
InitCheck() returns a result code indicating
B_OK if the BMessageRunner
constructor executed sucessfully, or some other value if an error
occurred setting up the object. You should call this immediately after
creating a BMessageRunner, and shouldn't use the
object if this function returns anything but B_OK.
status_t SetCount(int32 count);
SetCount() sets the number of times the
BMessageRunner will send the
message. If you want the message to be sent forever (until the object is
deleted or SetCount() is called again), specify -1.