[haiku-commits] haiku: hrev48692 - src/kits/app docs/user/app

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 17 Jan 2015 00:01:14 +0100 (CET)

hrev48692 adds 3 changesets to branch 'master'
old head: fd3c25a9283b926acfcee45c63901ea56c42362a
new head: db7ef1292a12e2bb248580fb7b22af8cd697979f
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=db7ef1292a12+%5Efd3c25a9283b

----------------------------------------------------------------------------

2eb2dcfabee1: Small fixes to BMessenger docs

1f4de50d39b8: Style fixes to BMessageRunner, no functional changes intended

db7ef1292a12: Add BMessageRunner docs

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

4 files changed, 359 insertions(+), 230 deletions(-)
docs/user/app/MessageRunner.dox | 267 ++++++++++++++++++++++++++++++
docs/user/app/Messenger.dox     |   5 +-
headers/os/app/MessageRunner.h  |   5 +-
src/kits/app/MessageRunner.cpp  | 312 ++++++++++--------------------------

############################################################################

Commit:      2eb2dcfabee17c2c09a4cb1349a319c24da4fe43
URL:         http://cgit.haiku-os.org/haiku/commit/?id=2eb2dcfabee1
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Fri Jan 16 22:59:41 2015 UTC

Small fixes to BMessenger docs

----------------------------------------------------------------------------

diff --git a/docs/user/app/Messenger.dox b/docs/user/app/Messenger.dox
index 1ba3825..100fab7 100644
--- a/docs/user/app/Messenger.dox
+++ b/docs/user/app/Messenger.dox
@@ -34,7 +34,7 @@
        The most significant (set of) method(s) in the class is SendMessage(),
        which sends its message to the target. For a local target SendMessage()
        is roughly equivalent in terms of efficiency to posting a message
-       directly to the BMessenger's target (i.e. BLooper::PostMessage()).
+       directly to the messenger's target (i.e. BLooper::PostMessage()).
 
        The global \a be_app_messenger pointer targets the main message
        loop of \a be_app is automatically initialized for you when you create
@@ -496,7 +496,8 @@
 */
 
 
-/*!    \fn bool operator!=(const BMessenger& a, const BMessenger& b)
+/*!
+       \fn bool operator!=(const BMessenger& a, const BMessenger& b)
        \brief Returns whether two BMessengers do NOT have the same target.
 
        \param a The first messenger.

############################################################################

Commit:      1f4de50d39b8cbaa5c9f83477e695038c0f76fcb
URL:         http://cgit.haiku-os.org/haiku/commit/?id=1f4de50d39b8
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Fri Jan 16 23:00:27 2015 UTC

Style fixes to BMessageRunner, no functional changes intended

----------------------------------------------------------------------------

diff --git a/headers/os/app/MessageRunner.h b/headers/os/app/MessageRunner.h
index 9e492b3..06236bf 100644
--- a/headers/os/app/MessageRunner.h
+++ b/headers/os/app/MessageRunner.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2010, Haiku, Inc.
+ * Copyright 2001-2010 Haiku, Inc. All rights reserved.
  * Distributed under the terms of the MIT License.
  */
 #ifndef _MESSAGE_RUNNER_H
@@ -41,8 +41,7 @@ public:
 
 private:
                                                                
BMessageRunner(const BMessageRunner &);
-                                                               BMessageRunner 
&operator=(
-                                                                       const 
BMessageRunner &);
+                       BMessageRunner&         operator=(const 
BMessageRunner&);
 
        static  int32                           _RegisterRunner(BMessenger 
target,
                                                                        const 
BMessage* message, bigtime_t interval,
diff --git a/src/kits/app/MessageRunner.cpp b/src/kits/app/MessageRunner.cpp
index 3464f85..4a982a4 100644
--- a/src/kits/app/MessageRunner.cpp
+++ b/src/kits/app/MessageRunner.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2010, Haiku, Inc.
+ * Copyright 2001-2010 Haiku, Inc. All rights reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -19,25 +19,6 @@
 using namespace BPrivate;
 
 
-/*!    \brief Creates and initializes a new BMessageRunner.
-
-       The target for replies to the delivered message(s) is \c 
be_app_messenger.
-
-       The success of the initialization can (and should) be asked for via
-       InitCheck(). This object will not take ownership of the \a message, you
-       may freely change or delete it after creation.
-
-       \note As soon as the last message has been sent, the message runner
-                 becomes unusable. InitCheck() will still return \c B_OK, but
-                 SetInterval(), SetCount() and GetInfo() will fail.
-
-       \param target Target of the message(s).
-       \param message The message to be sent to the target.
-       \param interval Period of time before the first message is sent and
-                  between messages (if more than one shall be sent) in 
microseconds.
-       \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
-*/
 BMessageRunner::BMessageRunner(BMessenger target, const BMessage* message,
        bigtime_t interval, int32 count)
        :
@@ -47,25 +28,6 @@ BMessageRunner::BMessageRunner(BMessenger target, const 
BMessage* message,
 }
 
 
-/*!    \brief Creates and initializes a new BMessageRunner.
-
-       The target for replies to the delivered message(s) is \c 
be_app_messenger.
-
-       The success of the initialization can (and should) be asked for via
-       InitCheck(). This object will not take ownership of the \a message, you
-       may freely change or delete it after creation.
-
-       \note As soon as the last message has been sent, the message runner
-                 becomes unusable. InitCheck() will still return \c B_OK, but
-                 SetInterval(), SetCount() and GetInfo() will fail.
-
-       \param target Target of the message(s).
-       \param message The message to be sent to the target.
-       \param interval Period of time before the first message is sent and
-                  between messages (if more than one shall be sent) in 
microseconds.
-       \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
-*/
 BMessageRunner::BMessageRunner(BMessenger target, const BMessage& message,
        bigtime_t interval, int32 count)
        :
@@ -75,27 +37,6 @@ BMessageRunner::BMessageRunner(BMessenger target, const 
BMessage& message,
 }
 
 
-/*!    \brief Creates and initializes a new BMessageRunner.
-
-       This constructor version additionally allows to specify the target for
-       replies to the delivered message(s).
-
-       The success of the initialization can (and should) be asked for via
-       InitCheck(). This object will not take ownership of the \a message, you
-       may freely change or delete it after creation.
-
-       \note As soon as the last message has been sent, the message runner
-                 becomes unusable. InitCheck() will still return \c B_OK, but
-                 SetInterval(), SetCount() and GetInfo() will fail.
-
-       \param target Target of the message(s).
-       \param message The message to be sent to the target.
-       \param interval Period of time before the first message is sent and
-                  between messages (if more than one shall be sent) in 
microseconds.
-       \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
-       \param replyTo Target replies to the delivered message(s) shall be sent 
to.
-*/
 BMessageRunner::BMessageRunner(BMessenger target, const BMessage* message,
        bigtime_t interval, int32 count, BMessenger replyTo)
        :
@@ -105,27 +46,6 @@ BMessageRunner::BMessageRunner(BMessenger target, const 
BMessage* message,
 }
 
 
-/*!    \brief Creates and initializes a new BMessageRunner.
-
-       This constructor version additionally allows to specify the target for
-       replies to the delivered message(s).
-
-       The success of the initialization can (and should) be asked for via
-       InitCheck(). This object will not take ownership of the \a message, you
-       may freely change or delete it after creation.
-
-       \note As soon as the last message has been sent, the message runner
-                 becomes unusable. InitCheck() will still return \c B_OK, but
-                 SetInterval(), SetCount() and GetInfo() will fail.
-
-       \param target Target of the message(s).
-       \param message The message to be sent to the target.
-       \param interval Period of time before the first message is sent and
-                  between messages (if more than one shall be sent) in 
microseconds.
-       \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
-       \param replyTo Target replies to the delivered message(s) shall be sent 
to.
-*/
 BMessageRunner::BMessageRunner(BMessenger target, const BMessage& message,
        bigtime_t interval, int32 count, BMessenger replyTo)
        :
@@ -135,8 +55,6 @@ BMessageRunner::BMessageRunner(BMessenger target, const 
BMessage& message,
 }
 
 
-/*!    \brief Frees all resources associated with the object.
-*/
 BMessageRunner::~BMessageRunner()
 {
        if (fToken < B_OK)
@@ -144,26 +62,17 @@ BMessageRunner::~BMessageRunner()
 
        // compose the request message
        BMessage request(B_REG_UNREGISTER_MESSAGE_RUNNER);
-       status_t error = request.AddInt32("token", fToken);
+       status_t result = request.AddInt32("token", fToken);
 
        // send the request
        BMessage reply;
-       if (error == B_OK)
-               error = BRoster::Private().SendTo(&request, &reply, false);
+       if (result == B_OK)
+               result = BRoster::Private().SendTo(&request, &reply, false);
 
        // ignore the reply, we can't do anything anyway
 }
 
 
-/*!    \brief Returns the status of the initialization.
-
-       \note As soon as the last message has been sent, the message runner
-                 becomes unusable. InitCheck() will still return \c B_OK, but
-                 SetInterval(), SetCount() and GetInfo() will fail.
-
-       \return \c B_OK, if the object is properly initialized, an error code
-                       otherwise.
-*/
 status_t
 BMessageRunner::InitCheck() const
 {
@@ -171,14 +80,6 @@ BMessageRunner::InitCheck() const
 }
 
 
-/*!    \brief Sets the interval of time between messages.
-       \param interval The new interval in microseconds.
-       \return
-       - \c B_OK: Everything went fine.
-       - \c B_NO_INIT: The message runner is not properly initialized.
-       - \c B_BAD_VALUE: \a interval is \c 0 or negative, or the message runner
-         has already sent all messages to be sent and has become unusable.
-*/
 status_t
 BMessageRunner::SetInterval(bigtime_t interval)
 {
@@ -186,15 +87,6 @@ BMessageRunner::SetInterval(bigtime_t interval)
 }
 
 
-/*!    \brief Sets the number of times message shall be sent.
-       \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
-       - \c B_BAD_VALUE: The message runner has already sent all messages to be
-         sent and has become unusable.
-       \return
-       - \c B_OK: Everything went fine.
-       - \c B_NO_INIT: The message runner is not properly initialized.
-*/
 status_t
 BMessageRunner::SetCount(int32 count)
 {
@@ -202,104 +94,67 @@ BMessageRunner::SetCount(int32 count)
 }
 
 
-/*!    \brief Returns the time interval between two messages and the number of
-                  times the message has still to be sent.
-
-       Both parameters (\a interval and \a count) may be \c NULL.
-
-       \param interval Pointer to a pre-allocated bigtime_t variable to be set
-                  to the time interval. May be \c NULL.
-       \param count Pointer to a pre-allocated int32 variable to be set
-                  to the number of times the message has still to be sent.
-                  May be \c NULL.
-       \return
-       - \c B_OK: Everything went fine.
-       - \c B_BAD_VALUE: The message runner is not longer valid. All the
-         messages that had to be sent have already been sent.
-*/
 status_t
 BMessageRunner::GetInfo(bigtime_t* interval, int32* count) const
 {
-       status_t error =  (fToken >= 0 ? B_OK : B_BAD_VALUE);
+       status_t result =  fToken >= 0 ? B_OK : B_BAD_VALUE;
 
        // compose the request message
        BMessage request(B_REG_GET_MESSAGE_RUNNER_INFO);
-       if (error == B_OK)
-               error = request.AddInt32("token", fToken);
+       if (result == B_OK)
+               result = request.AddInt32("token", fToken);
 
        // send the request
        BMessage reply;
-       if (error == B_OK)
-               error = BRoster::Private().SendTo(&request, &reply, false);
+       if (result == B_OK)
+               result = BRoster::Private().SendTo(&request, &reply, false);
 
        // evaluate the reply
-       if (error == B_OK) {
+       if (result == B_OK) {
                if (reply.what == B_REG_SUCCESS) {
                        // count
                        int32 _count;
                        if (reply.FindInt32("count", &_count) == B_OK) {
-                               if (count)
+                               if (count != 0)
                                        *count = _count;
                        } else
-                               error = B_ERROR;
+                               result = B_ERROR;
 
                        // interval
                        bigtime_t _interval;
                        if (reply.FindInt64("interval", &_interval) == B_OK) {
-                               if (interval)
+                               if (interval != 0)
                                        *interval = _interval;
                        } else
-                               error = B_ERROR;
+                               result = B_ERROR;
                } else {
-                       if (reply.FindInt32("error", &error) != B_OK)
-                               error = B_ERROR;
+                       if (reply.FindInt32("error", &result) != B_OK)
+                               result = B_ERROR;
                }
        }
-       return error;
-}
 
+       return result;
+}
 
-/*!    \brief Creates and initializes a detached BMessageRunner.
-
-       You cannot alter the runner after the creation, and it will be deleted
-       automatically once it is done.
-       The target for replies to the delivered message(s) is \c 
be_app_messenger.
 
-       \param target Target of the message(s).
-       \param message The message to be sent to the target.
-       \param interval Period of time before the first message is sent and
-                  between messages (if more than one shall be sent) in 
microseconds.
-       \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
-*/
 /*static*/ status_t
 BMessageRunner::StartSending(BMessenger target, const BMessage* message,
        bigtime_t interval, int32 count)
 {
        int32 token = _RegisterRunner(target, message, interval, count, true,
                be_app_messenger);
+
        return token >= B_OK ? B_OK : token;
 }
 
 
-/*!    \brief Creates and initializes a detached BMessageRunner.
-
-       You cannot alter the runner after the creation, and it will be deleted
-       automatically once it is done.
-
-       \param target Target of the message(s).
-       \param message The message to be sent to the target.
-       \param interval Period of time before the first message is sent and
-                  between messages (if more than one shall be sent) in 
microseconds.
-       \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
-       \param replyTo Target replies to the delivered message(s) shall be sent 
to.
-*/
 /*static*/ status_t
 BMessageRunner::StartSending(BMessenger target, const BMessage* message,
        bigtime_t interval, int32 count, BMessenger replyTo)
 {
-       int32 token = _RegisterRunner(target, message, interval, count, true, 
replyTo);
+       int32 token = _RegisterRunner(target, message, interval, count, true,
+               replyTo);
+
        return token >= B_OK ? B_OK : token;
 }
 
@@ -313,38 +168,37 @@ void BMessageRunner::_ReservedMessageRunner5() {}
 void BMessageRunner::_ReservedMessageRunner6() {}
 
 
-/*!    \brief Privatized copy constructor to prevent usage.
-*/
+//! Privatized copy constructor to prevent usage.
 BMessageRunner::BMessageRunner(const BMessageRunner &)
-       : fToken(-1)
+       :
+       fToken(-1)
 {
 }
 
 
-/*!    \brief Privatized assignment operator to prevent usage.
-*/
-BMessageRunner &
-BMessageRunner::operator=(const BMessageRunner &)
+//! Privatized assignment operator to prevent usage.
+BMessageRunner&
+BMessageRunner::operator=(const BMessageRunner&)
 {
        return* this;
 }
 
 
-/*!    \brief Initializes the BMessageRunner.
+/*!    Initializes the BMessageRunner.
 
        The success of the initialization can (and should) be asked for via
        InitCheck().
 
        \note As soon as the last message has been sent, the message runner
-                 becomes unusable. InitCheck() will still return \c B_OK, but
-                 SetInterval(), SetCount() and GetInfo() will fail.
+             becomes unusable. InitCheck() will still return \c B_OK, but
+             SetInterval(), SetCount() and GetInfo() will fail.
 
        \param target Target of the message(s).
        \param message The message to be sent to the target.
        \param interval Period of time before the first message is sent and
-                  between messages (if more than one shall be sent) in 
microseconds.
+              between messages (if more than one shall be sent) in 
microseconds.
        \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
+              A value less than \c 0 for an unlimited number of repetitions.
        \param replyTo Target replies to the delivered message(s) shall be sent 
to.
 */
 void
@@ -355,68 +209,73 @@ BMessageRunner::_InitData(BMessenger target, const 
BMessage* message,
 }
 
 
-/*!    \brief Registers the BMessageRunner in the registrar.
+/*!    Registers the BMessageRunner in the registrar.
 
        \param target Target of the message(s).
        \param message The message to be sent to the target.
        \param interval Period of time before the first message is sent and
-                  between messages (if more than one shall be sent) in 
microseconds.
+              between messages (if more than one shall be sent) in 
microseconds.
        \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
+              A value less than \c 0 for an unlimited number of repetitions.
        \param replyTo Target replies to the delivered message(s) shall be sent 
to.
 
        \return The token the message runner is registered with, or the error 
code
-               while trying to register it.
+               while trying to register it.
 */
 /*static*/ int32
 BMessageRunner::_RegisterRunner(BMessenger target, const BMessage* message,
        bigtime_t interval, int32 count, bool detach, BMessenger replyTo)
 {
-       status_t error = B_OK;
+       status_t result = B_OK;
        if (message == NULL || count == 0 || (count < 0 && detach))
-               error = B_BAD_VALUE;
+               result = B_BAD_VALUE;
 
        // compose the request message
        BMessage request(B_REG_REGISTER_MESSAGE_RUNNER);
-       if (error == B_OK)
-               error = request.AddInt32("team", BPrivate::current_team());
-       if (error == B_OK)
-               error = request.AddMessenger("target", target);
-       if (error == B_OK)
-               error = request.AddMessage("message", message);
-       if (error == B_OK)
-               error = request.AddInt64("interval", interval);
-       if (error == B_OK)
-               error = request.AddInt32("count", count);
-       if (error == B_OK)
-               error = request.AddMessenger("reply_target", replyTo);
+       if (result == B_OK)
+               result = request.AddInt32("team", BPrivate::current_team());
+
+       if (result == B_OK)
+               result = request.AddMessenger("target", target);
+
+       if (result == B_OK)
+               result = request.AddMessage("message", message);
+
+       if (result == B_OK)
+               result = request.AddInt64("interval", interval);
+
+       if (result == B_OK)
+               result = request.AddInt32("count", count);
+
+       if (result == B_OK)
+               result = request.AddMessenger("reply_target", replyTo);
 
        // send the request
        BMessage reply;
-       if (error == B_OK)
-               error = BRoster::Private().SendTo(&request, &reply, false);
+       if (result == B_OK)
+               result = BRoster::Private().SendTo(&request, &reply, false);
 
        int32 token;
 
        // evaluate the reply
-       if (error == B_OK) {
+       if (result == B_OK) {
                if (reply.what == B_REG_SUCCESS) {
                        if (reply.FindInt32("token", &token) != B_OK)
-                               error = B_ERROR;
+                               result = B_ERROR;
                } else {
-                       if (reply.FindInt32("error", &error) != B_OK)
-                               error = B_ERROR;
+                       if (reply.FindInt32("error", &result) != B_OK)
+                               result = B_ERROR;
                }
        }
 
-       if (error == B_OK)
+       if (result == B_OK)
                return token;
 
-       return error;
+       return result;
 }
 
 
-/*!    \brief Sets the message runner's interval and count parameters.
+/*!    Sets the message runner's interval and count parameters.
 
        The parameters \a resetInterval and \a resetCount specify whether
        the interval or the count parameter respectively shall be reset.
@@ -425,17 +284,18 @@ BMessageRunner::_RegisterRunner(BMessenger target, const 
BMessage* message,
        \c B_BAD_VALUE.
 
        \param resetInterval \c true, if the interval shall be reset, \c false
-                  otherwise -- then \a interval is ignored.
+              otherwise -- then \a interval is ignored.
        \param interval The new interval in microseconds.
        \param resetCount \c true, if the count shall be reset, \c false
-                  otherwise -- then \a count is ignored.
+              otherwise -- then \a count is ignored.
        \param count Specifies how many times the message shall be sent.
-                  A value less than \c 0 for an unlimited number of 
repetitions.
-       \return
-       - \c B_OK: Everything went fine.
-       - \c B_BAD_VALUE: The message runner is not longer valid. All the
-         messages that had to be sent have already been sent. Or both
-         \a resetInterval and \a resetCount are \c false.
+              A value less than \c 0 for an unlimited number of repetitions.
+
+       \return A status code.
+       \retval B_OK Everything went fine.
+       \retval B_BAD_VALUE The message runner is not longer valid. All the
+               messages that had to be sent have already been sent. Or both
+               \a resetInterval and \a resetCount are \c false.
 */
 status_t
 BMessageRunner::_SetParams(bool resetInterval, bigtime_t interval,
@@ -446,23 +306,25 @@ BMessageRunner::_SetParams(bool resetInterval, bigtime_t 
interval,
 
        // compose the request message
        BMessage request(B_REG_SET_MESSAGE_RUNNER_PARAMS);
-       status_t error = request.AddInt32("token", fToken);
-       if (error == B_OK && resetInterval)
-               error = request.AddInt64("interval", interval);
-       if (error == B_OK && resetCount)
-               error = request.AddInt32("count", count);
+       status_t result = request.AddInt32("token", fToken);
+       if (result == B_OK && resetInterval)
+               result = request.AddInt64("interval", interval);
+
+       if (result == B_OK && resetCount)
+               result = request.AddInt32("count", count);
 
        // send the request
        BMessage reply;
-       if (error == B_OK)
-               error = BRoster::Private().SendTo(&request, &reply, false);
+       if (result == B_OK)
+               result = BRoster::Private().SendTo(&request, &reply, false);
 
        // evaluate the reply
-       if (error == B_OK) {
+       if (result == B_OK) {
                if (reply.what != B_REG_SUCCESS) {
-                       if (reply.FindInt32("error", &error) != B_OK)
-                               error = B_ERROR;
+                       if (reply.FindInt32("error", &result) != B_OK)
+                               result = B_ERROR;
                }
        }
-       return error;
+
+       return result;
 }

############################################################################

Revision:    hrev48692
Commit:      db7ef1292a12e2bb248580fb7b22af8cd697979f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=db7ef1292a12
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Fri Jan 16 23:00:50 2015 UTC

Add BMessageRunner docs

----------------------------------------------------------------------------

diff --git a/docs/user/app/MessageRunner.dox b/docs/user/app/MessageRunner.dox
new file mode 100644
index 0000000..f570675
--- /dev/null
+++ b/docs/user/app/MessageRunner.dox
@@ -0,0 +1,267 @@
+/*
+ * Copyright 2001-2015 Haiku, Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *             John Scipione, jscipione@xxxxxxxxx
+ *             Ingo Weinhold, bonefish@xxxxxxxxxxxx
+ *
+ * Corresponds to:
+ *             headers/os/app/MessageRunner.h  hrev48689
+ *             src/kits/app/MessageRunner.cpp  hrev48689
+ */
+
+
+/*!
+       \file MessageRunner.h
+       \ingroup app
+       \ingroup libbe
+       \brief Provides the BMessageRunner class.
+*/
+
+
+/*!
+       \class BMessageRunner
+       \ingroup app
+       \ingroup libbe
+       \brief Provides a mechanism for sending one or more messages
+              to a messenger at a specified interval and receive
+              reply messages.
+
+       The application that creates the BMessageRunner can specify the message,
+       the BMessenger to send the message to, how often to send the message,
+       how many times to send the message, and the BMessenger to send reply
+       messages from.
+
+       The system roster handles dispatching the messages to the appropriate
+       messengers at the specified time intervals. The target for any reply
+       messages is \c be_app_messenger by default, or it can be specified in 
the
+       constructor.
+
+       After initializing a BMessageRunner, the initialization can and should 
be
+       checked by calling InitCheck(). BMessageRunner will not take ownership 
of
+       the message, you may freely change or delete the message after
+       initialization.
+
+       The BMessageRunner can be reconfigured (to change the interval or count)
+       by calling SetInterval() and SetCount(). This is useful if you want to 
stop
+       a BMessageRunner from sending messages early or if messages are set to
+       be sent forever.
+
+       \since BeOS R5
+*/
+
+
+/*!
+       \fn BMessageRunner::BMessageRunner(BMessenger target,
+               const BMessage* message, bigtime_t interval, int32 count)
+       \brief Creates and initializes a new BMessageRunner and instructs the
+              system roster to send the specified \a message to the \a target
+              \a count times every \a interval microseconds, reply messages are
+              sent to \c be_app_messenger.
+
+       \param target The target of the message(s).
+       \param message The message to be sent to the target.
+       \param interval Period of time before the first message is sent and
+              between messages (if more than one shall be sent) in 
microseconds.
+       \param count Specifies how many times the message shall be sent.
+              A negative value indicates that the message will be sent
+              forever, or until the BMessageRunner is reconfigured or deleted.
+
+       \since BeOS R5
+*/
+
+
+/*!
+       \fn BMessageRunner::BMessageRunner(BMessenger target,
+               const BMessage& message, bigtime_t interval, int32 count)
+       \brief Creates and initializes a new BMessageRunner and instructs the
+              system roster to send the specified \a message to the \a target
+              \a count times every \a interval microseconds, reply messages are
+              sent to \c be_app_messenger.
+
+       \param target Target of the message(s).
+       \param message The message to be sent to the target.
+       \param interval Period of time before the first message is sent and
+              between messages (if more than one shall be sent) in 
microseconds.
+       \param count Specifies how many times the message shall be sent.
+              A negative value indicates that the message will be sent
+              forever, or until the BMessageRunner is reconfigured or deleted.
+
+       \since Haiku R1
+*/
+
+
+/*!
+       \fn BMessageRunner::BMessageRunner(BMessenger target,
+               const BMessage* message, bigtime_t interval, int32 count,
+               BMessenger replyTo)
+       \brief Creates and initializes a new BMessageRunner and instructs the
+              system roster to send the specified \a message to the \a target
+              \a count times every \a interval microseconds.
+
+       This constructor also allows you to specify the target for replies to
+       the delivered messages.
+
+       \param target Target of the message(s).
+       \param message The message to be sent to the target.
+       \param interval Period of time before the first message is sent and
+              between messages (if more than one shall be sent) in 
microseconds.
+       \param count Specifies how many times the message shall be sent.
+              A negative value indicates that the message will be sent
+              forever, or until the BMessageRunner is reconfigured or deleted.
+       \param replyTo Target replies to the delivered message(s) shall be sent 
to.
+
+       \since BeOS R5
+*/
+
+
+/*!
+       \fn BMessageRunner::BMessageRunner(BMessenger target,
+               const BMessage& message, bigtime_t interval, int32 count,
+               BMessenger replyTo)
+       \brief Creates and initializes a new BMessageRunner and instructs the
+              system roster to send the specified \a message to the \a target
+              \a count times every \a interval microseconds.
+
+       This constructor also allows you to specify the target for replies to
+       the delivered messages.
+
+       \param target Target of the message(s).
+       \param message The message to be sent to the target.
+       \param interval Period of time before the first message is sent and
+              between messages (if more than one shall be sent) in 
microseconds.
+       \param count Specifies how many times the message shall be sent.
+              A negative value indicates that the message will be sent
+              forever, or until the BMessageRunner is reconfigured or deleted.
+       \param replyTo Target replies to the delivered message(s) shall be sent 
to.
+
+       \since Haiku R1
+*/
+
+
+/*!
+       \fn BMessageRunner::~BMessageRunner()
+       \brief Frees all resources associated with the object.
+
+       \since BeOS R5
+*/
+
+
+/*!
+       \fn status_t BMessageRunner::InitCheck() const
+       \brief Returns the initialization status.
+
+       \note As soon as the last message is sent, the message runner
+             becomes unusable. InitCheck() will still return \c B_OK, but
+             SetInterval(), SetCount() and GetInfo() will all fail.
+
+       \return \c B_OK if the object was properly initialized or an error code
+               otherwise.
+
+       \since BeOS R5
+*/
+
+
+/*!
+       \fn status_t BMessageRunner::SetInterval(bigtime_t interval)
+       \brief Sets the interval of time between messages.
+
+       \param interval The new interval in microseconds.
+
+       \return A status code, \c B_OK on success or an error code otherwise.
+       \retval B_OK Everything went fine.
+       \retval B_NO_INIT The message runner was not properly initialized.
+       \retval B_BAD_VALUE \a interval was \c 0 or negative, or the message 
runner
+               had already sent all messages and became unusable.
+
+       \since BeOS R5
+*/
+
+
+/*!
+       \fn status_t BMessageRunner::SetCount(int32 count)
+       \brief Sets the number of times message should be sent.
+
+       \param count Specifies how many times the message shall be sent.
+              A negative value indicates that the message will be sent
+              forever, or until the BMessageRunner is reconfigured or deleted.
+
+       \return A status code, \c B_OK on success or an error code otherwise.
+       \retval B_OK Everything went fine.
+       \retval B_NO_INIT The message runner was not properly initialized.
+       \retval B_BAD_VALUE \a interval was \c 0 or negative, or the message 
runner
+               had already sent all messages and became unusable.
+
+       \since BeOS R5
+*/
+
+
+/*!
+       \fn status_t BMessageRunner::GetInfo(bigtime_t* interval,
+               int32* count) const
+       \brief Returns the time interval between two messages and the number of
+              times the message has still to be sent.
+
+       Both parameters (\a interval and \a count) may be \c NULL.
+
+       \param interval Pointer to a pre-allocated bigtime_t variable to be set
+              to the time interval. May be \c NULL.
+       \param count Pointer to a pre-allocated int32 variable to be set
+              to the number of times the message has still to be sent.
+              May be \c NULL.
+
+       \return A status code, \c B_OK on success or an error code otherwise.
+       \retval B_OK Everything went fine.
+       \retval B_BAD_VALUE \a interval was 0 or negative, or the message runner
+               had already sent all messages and became unusable.
+
+       \since BeOS R5
+*/
+
+
+/*!
+       \fn status_t BMessageRunner::StartSending(BMessenger target,
+               const BMessage* message, bigtime_t interval, int32 count)
+       \brief Creates and initializes a detached BMessageRunner and instructs 
the
+              system roster to send the specified \a message to the \a target
+              \a count times every \a interval microseconds, reply messages are
+              sent to \c be_app_messenger.
+
+       You cannot alter the runner after the creation, and it will be deleted
+       automatically the last message is sent.
+
+       \param target Target of the message(s).
+       \param message The message to be sent to the target.
+       \param interval Period of time before the first message is sent and
+                  between messages (if more than one shall be sent) in 
microseconds.
+       \param count Specifies how many times the message shall be sent.
+              A negative value indicates that the message will be sent
+              forever, or until the BMessageRunner is reconfigured or deleted.
+
+       \since Haiku R1
+*/
+
+
+/*!
+       \fn status_t BMessageRunner::StartSending(BMessenger target,
+               const BMessage* message, bigtime_t interval, int32 count,
+               BMessenger replyTo)
+       \brief Creates and initializes a detached BMessageRunner and instructs 
the
+              system roster to send the specified \a message to the \a target
+              \a count times every \a interval microseconds.
+
+       You cannot alter the runner after the creation, and it will be deleted
+       automatically once the last message is sent.
+
+       \param target Target of the message(s).
+       \param message The message to be sent to the target.
+       \param interval Period of time before the first message is sent and
+              between messages (if more than one shall be sent) in 
microseconds.
+       \param count Specifies how many times the message shall be sent.
+              A negative value indicates that the message will be sent
+              forever, or until the BMessageRunner is reconfigured or deleted.
+       \param replyTo Target replies to the delivered message(s) shall be sent 
to.
+
+       \since Haiku R1
+*/


Other related posts:

  • » [haiku-commits] haiku: hrev48692 - src/kits/app docs/user/app - jscipione