The Support Kit Table of Contents | The Support Kit Index |
Derived from: (none)
Declared in: be/app/MessageRunner.h
Library: libbe.so
Allocation: Constructor only
The BMessageRunner class provides a handy mechanism for automatically sending an arbitrary message to a BMessenger at specified intervals. The application that creates the BMessageRunner can specify the message, the BMessenger to send the message to, how often to send the message, and how many times it should be sent.
The system roster handles actually dispatching the messages to the appropriate BMessengers at the desired time intervals; this class simply acts as an intermediary through which your application asks the roster to schedule sending the messages.
|
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.
|
Asks the roster to stop sending the message.
|
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 CODES
B_OK. Information returned successfully.
|
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.
|
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.
SetInterval() sets the number of microseconds that will pass between messages being sent.
The Support Kit Table of Contents | The Support Kit Index |
Copyright © 2000 Be, Inc. All rights reserved..