haiku-website/static/legacy-docs/bebook/BMessageRunner.html

61 lines
14 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - Classes And Methods - The Application Kit</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheApplicationKit.html" title="The Application Kit" /><link rel="prev" href="BMessageQueue.html" title="BMessageQueue" /><link rel="next" href="BMessenger.html" title="BMessenger" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BMessageQueue.html" title="BMessageQueue"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheApplicationKit.html" title="The Application Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BMessenger.html" title="BMessenger"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - Classes And Methods - The Application Kit</div></div><div id="headerB">Prev: <a href="BMessageQueue.html">BMessageQueue</a>  Up: <a href="TheApplicationKit.html">The Application Kit</a>  Next: <a href="BMessenger.html">BMessenger</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner"></a>BMessageRunner</h2></div></div></div><a id="id932030" class="indexterm"></a><div class="classheader"><table border="0"><colgroup><col /><col /></colgroup><tbody><tr><td><table width="100%" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td>Derived From:</td><td></td></tr><tr><td>Mix-in Classes:</td><td></td></tr><tr><td>Declared In:</td><td><code class="filename">app/MessageRunner.h</code></td></tr><tr><td>Library:</td><td><code class="filename">libbe.so</code></td></tr><tr><td>Allocation:</td><td>Constructor only</td></tr></tbody></table></td><td>
<a class="link overview" href="BMessageRunner_Overview.html" title="BMessageRunner">Class Overview</a>
<div class="toc"><ul><li><span class="section"><a href="BMessageRunner.html#BMessageRunner_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BMessageRunner.html#BMessageRunner_MemberFunctions">Member Functions</a></span></li></ul></div>
</td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner_ConstructorDestructor"></a>Constructor and Destructor</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner_Constructor"></a>BMessageRunner()</h4></div></div></div><div class="synopsisgroup">
<code class="constructorsynopsis cpp"><span class="methodname">BMessageRunner</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a> </span><span class="parameter">target</span></span>,<br />               <span class="methodparam"><span class="modifier">const </span><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">message</span></span>,<br />               <span class="methodparam"><span class="type">bigtime_t </span><span class="parameter">interval</span></span>,<br />               <span class="methodparam"><span class="type">int32 </span><span class="parameter">count</span><span class="initializer"> = <span class="constant">-1</span></span></span>);</code>
<code class="constructorsynopsis cpp"><span class="methodname">BMessageRunner</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a> </span><span class="parameter">target</span></span>,<br />               <span class="methodparam"><span class="modifier">const </span><span class="type"><a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>* </span><span class="parameter">message</span></span>,<br />               <span class="methodparam"><span class="type">bigtime_t </span><span class="parameter">interval</span></span>,<br />               <span class="methodparam"><span class="type">int32 </span><span class="parameter">count</span></span>,<br />               <span class="methodparam"><span class="type">BMessenger </span><span class="parameter">replyTo</span></span>);</code>
</div><p>
Tells the roster to send the specified <code class="parameter">message</code> to the <code class="parameter">target</code>
<a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a>
every <code class="parameter">interval</code> microseconds. The message will be sent
<code class="parameter">count</code> times (if
<code class="parameter">count</code> is -1, the message will be sent forever, or until the
<code class="classname">BMessageRunner</code> is reconfigured or deleted).
</p><p>
The second form of the constructor lets the application specify, in
<code class="parameter">replyTo</code>, the
<a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a>
to which replies to the message should be sent.
</p><p>
The <code class="classname">BMessageRunner</code> can be reconfigured (to change the <code class="parameter">interval</code> or <code class="parameter">count</code>)
by calling
<a class="link" href="BMessageRunner.html#BMessageRunner_SetInterval" title="SetInterval()"><code class="methodname">SetInterval()</code></a> and
<a class="link" href="BMessageRunner.html#BMessageRunner_SetCount" title="SetCount()"><code class="methodname">SetCount()</code></a>.
</p><p>
After constructing a <code class="classname">BMessageRunner</code>, you should call
<a class="link" href="BMessageRunner.html#BMessageRunner_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a> to
ensure that the object was created properly.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner_Destructor"></a>~BMessageRunner()</h4></div></div></div><code class="destructorsynopsis cpp"><span class="modifier">virtual </span><span class="methodname">~BMessageRunner</span>();</code><p>
Asks the roster to stop sending the message.
</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner_MemberFunctions"></a>Member Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner_GetInfo"></a>GetInfo()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">GetInfo</span>(<span class="methodparam"><span class="type">bigtime_t* </span><span class="parameter">interval</span></span>,<br />                 <span class="methodparam"><span class="type">int32* </span><span class="parameter">count</span></span>) <span class="modifier">const</span>;</code><p>
<code class="methodname">GetInfo()</code> returns in <code class="parameter">interval</code>
the time in microseconds that will pass
between messages being sent, and in <code class="parameter">count</code> the number of times the message
will be sent.
</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_OK</code>.</span></p></td><td><p>Information returned successfully.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NAME_NOT_FOUND</code>.</span></p></td><td><p>The roster returned invalid information about the
<a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_VALUE</code>.</span></p></td><td><p>The roster returned invalid information about the
<a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a>.</p></td></tr><tr><td><p><span class="term">Other errors.</span></p></td><td><p>In general, getting an error back from this function is
a bad thing.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner_InitCheck"></a>InitCheck()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">InitCheck</span>() <span class="modifier">const</span>;</code><p>
<code class="methodname">InitCheck()</code> returns a result code indicating
<code class="constant">B_OK</code> if the <code class="classname">BMessageRunner</code>
constructor executed sucessfully, or some other value if an error
occurred setting up the object. You should call this immediately after
creating a <code class="classname">BMessageRunner</code>, and shouldn't use the
object if this function returns anything but <code class="constant">B_OK</code>.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner_SetCount"></a>SetCount()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">SetCount</span>(<span class="methodparam"><span class="type">int32 </span><span class="parameter">count</span></span>);</code><p>
<code class="methodname">SetCount()</code> sets the number of times the
<code class="classname">BMessageRunner</code> will send the
message. If you want the message to be sent forever (until the object is
deleted or <code class="methodname">SetCount()</code> is called again), specify -1.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BMessageRunner_SetInterval"></a>SetInterval()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">SetInterval</span>(<span class="methodparam"><span class="type">bigtime_t </span><span class="parameter">interval</span></span>);</code><p>
<code class="methodname">SetInterval()</code> sets the number of microseconds that will pass between
messages being sent.
</p></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BMessageQueue.html">BMessageQueue</a>  Up: <a href="TheApplicationKit.html">The Application Kit</a>  Next: <a href="BMessenger.html">BMessenger</a> </div><div id="footerB"><div id="footerBL"><a href="BMessageQueue.html" title="BMessageQueue"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheApplicationKit.html" title="The Application Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BMessenger.html" title="BMessenger"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>