1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
<title>peekabot: Status Class Reference</title>
6
<link href="tabs.css" rel="stylesheet" type="text/css"/>
7
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
10
<!-- Generated by Doxygen 1.7.1 -->
11
<div class="navigation" id="top">
14
<li><a href="main.html"><span>Main Page</span></a></li>
15
<li><a href="pages.html"><span>Related Pages</span></a></li>
16
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
17
<li><a href="files.html"><span>Files</span></a></li>
22
<li><a href="annotated.html"><span>Class List</span></a></li>
23
<li><a href="classes.html"><span>Class Index</span></a></li>
24
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
25
<li><a href="functions.html"><span>Class Members</span></a></li>
30
<li><b>peekabot</b> </li>
31
<li><b>client</b> </li>
32
<li><a class="el" href="classpeekabot_1_1client_1_1Status.html">Status</a> </li>
38
<a href="#pub-methods">Public Member Functions</a> </div>
39
<div class="headertitle">
40
<h1>Status Class Reference</h1> </div>
42
<div class="contents">
43
<!-- doxytag: class="peekabot::client::Status" -->
44
<p>Provides a <em>thread-safe</em> way for surveying the outcome, henceforth referred to as status, of <em>one</em> operation (action).
45
<a href="#_details">More...</a></p>
46
<div class="dynheader">
47
Inheritance diagram for Status:</div>
48
<div class="dyncontent">
49
<div class="center"><img src="classpeekabot_1_1client_1_1Status__inherit__graph.png" border="0" usemap="#Status_inherit__map" alt="Inheritance graph"/></div>
50
<map name="Status_inherit__map" id="Status_inherit__map">
51
<area shape="rect" id="node3" href="classpeekabot_1_1client_1_1Result.html" title="Encapsulates a result from an operation, such as getting an object's color, executed remotely on ..." alt="" coords="5,83,107,112"/></map>
52
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
54
<p><a href="classpeekabot_1_1client_1_1Status-members.html">List of all members.</a></p>
55
<table class="memberdecls">
56
<tr><td colspan="2"><h2><a name="pub-methods"></a>
57
Public Member Functions</h2></td></tr>
58
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aafde58df1b2a6a91d5b674373be3ffc5"></a><!-- doxytag: member="peekabot::client::Status::Status" ref="aafde58df1b2a6a91d5b674373be3ffc5" args="()" -->
59
</td><td class="memItemRight" valign="bottom"><a class="el" href="classpeekabot_1_1client_1_1Status.html#aafde58df1b2a6a91d5b674373be3ffc5">Status</a> ()</td></tr>
60
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an unused status object, not initially associated with an operation. <br/></td></tr>
61
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpeekabot_1_1client_1_1Status.html#a239c8a58231de2a3407b87ad4b63a40a">Status</a> (boost::shared_ptr< OperationStatus > status)</td></tr>
62
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a status object tracking the outcome of the operation associated with the given OperationStatus object. <a href="#a239c8a58231de2a3407b87ad4b63a40a"></a><br/></td></tr>
63
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2e08d1186b7c6566c5b0b8a9009df182"></a><!-- doxytag: member="peekabot::client::Status::operator=" ref="a2e08d1186b7c6566c5b0b8a9009df182" args="(boost::shared_ptr< OperationStatus > status)" -->
64
<a class="el" href="classpeekabot_1_1client_1_1Status.html">Status</a> & </td><td class="memItemRight" valign="bottom"><b>operator=</b> (boost::shared_ptr< OperationStatus > status)</td></tr>
65
<tr><td class="memItemLeft" align="right" valign="top">OperationOutcome </td><td class="memItemRight" valign="bottom"><a class="el" href="classpeekabot_1_1client_1_1Status.html#a1faa468105426c442f7ac64eba8f6d8d">get_outcome</a> () const </td></tr>
66
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the operation's outcome. <a href="#a1faa468105426c442f7ac64eba8f6d8d"></a><br/></td></tr>
67
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classpeekabot_1_1client_1_1Status.html#a146e37bcbdea065d6cba3ea0c6f73af2">has_completed</a> () const </td></tr>
68
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get whether the operation's status is available. <a href="#a146e37bcbdea065d6cba3ea0c6f73af2"></a><br/></td></tr>
69
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classpeekabot_1_1client_1_1Status.html#a5c8674792c35aee596f7fcb3e7a1455f">succeeded</a> () const </td></tr>
70
<tr><td class="mdescLeft"> </td><td class="mdescRight">Waits until the operation has completed and returns <code>true</code> if it succeeded. <a href="#a5c8674792c35aee596f7fcb3e7a1455f"></a><br/></td></tr>
71
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classpeekabot_1_1client_1_1Status.html#a7b81417e1a230fb8b6f46e5ae68b25d9">failed</a> () const </td></tr>
72
<tr><td class="mdescLeft"> </td><td class="mdescRight">Waits until the operation has completed and returns <code>false</code> if it failed. <a href="#a7b81417e1a230fb8b6f46e5ae68b25d9"></a><br/></td></tr>
73
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classpeekabot_1_1client_1_1Status.html#ac73f74a61e39e9e42b5b2b585e8b9b7d">wait_until_completed</a> () const </td></tr>
74
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait until <a class="el" href="classpeekabot_1_1client_1_1Status.html#a146e37bcbdea065d6cba3ea0c6f73af2" title="Get whether the operation's status is available.">has_completed()</a> is <code>true</code>. <a href="#ac73f74a61e39e9e42b5b2b585e8b9b7d"></a><br/></td></tr>
75
<tr><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classpeekabot_1_1client_1_1Status.html#a150beb1e8252419fd540364902c7c763">get_error_message</a> () const </td></tr>
76
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return's the error message in case of failure. <a href="#a150beb1e8252419fd540364902c7c763"></a><br/></td></tr>
78
<hr/><a name="_details"></a><h2>Detailed Description</h2>
79
<p>Provides a <em>thread-safe</em> way for surveying the outcome, henceforth referred to as status, of <em>one</em> operation (action). </p>
80
<p>It provides the "end user" with methods for querying whether a status is yet available and blocking until a status is available.</p>
81
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classpeekabot_1_1client_1_1Result.html" title="Encapsulates a result from an operation, such as getting an object's color, executed remotely on ...">Result</a>, <a class="el" href="classpeekabot_1_1client_1_1DelayedDispatch.html" title="A wrapper class that enables optional status tracking of operations.">DelayedDispatch</a>, OperationStatus </dd></dl>
82
<hr/><h2>Constructor & Destructor Documentation</h2>
83
<a class="anchor" id="a239c8a58231de2a3407b87ad4b63a40a"></a><!-- doxytag: member="peekabot::client::Status::Status" ref="a239c8a58231de2a3407b87ad4b63a40a" args="(boost::shared_ptr< OperationStatus > status)" -->
85
<div class="memproto">
86
<table class="memname">
88
<td class="memname"><a class="el" href="classpeekabot_1_1client_1_1Status.html">Status</a> </td>
90
<td class="paramtype">boost::shared_ptr< OperationStatus > </td>
91
<td class="paramname"> <em>status</em></td>
92
<td> ) </td>
99
<p>Create a status object tracking the outcome of the operation associated with the given OperationStatus object. </p>
100
<dl><dt><b>Parameters:</b></dt><dd>
101
<table border="0" cellspacing="2" cellpadding="0">
102
<tr><td valign="top"></td><td valign="top"><em>status</em> </td><td>The OperationStatus object associated with the operation to track. </td></tr>
109
<hr/><h2>Member Function Documentation</h2>
110
<a class="anchor" id="a7b81417e1a230fb8b6f46e5ae68b25d9"></a><!-- doxytag: member="peekabot::client::Status::failed" ref="a7b81417e1a230fb8b6f46e5ae68b25d9" args="() const " -->
111
<div class="memitem">
112
<div class="memproto">
113
<table class="memname">
115
<td class="memname">bool failed </td>
117
<td class="paramname"></td>
118
<td> ) </td>
125
<p>Waits until the operation has completed and returns <code>false</code> if it failed. </p>
126
<p>Note if the operation succeeds but the client is disconnected before the client is notified <a class="el" href="classpeekabot_1_1client_1_1Status.html#a7b81417e1a230fb8b6f46e5ae68b25d9" title="Waits until the operation has completed and returns false if it failed.">failed()</a> will return true, even though the operation didn't really fail.</p>
127
<dl class="pre"><dt><b>Precondition:</b></dt><dd>The object is not unused, e.g. it tracks the outcome of an operation.</dd></dl>
128
<dl><dt><b>Exceptions:</b></dt><dd>
129
<table border="0" cellspacing="2" cellpadding="0">
130
<tr><td valign="top"></td><td valign="top"><em>std::logic_error</em> </td><td>The status object is unused. </td></tr>
137
<a class="anchor" id="a150beb1e8252419fd540364902c7c763"></a><!-- doxytag: member="peekabot::client::Status::get_error_message" ref="a150beb1e8252419fd540364902c7c763" args="() const " -->
138
<div class="memitem">
139
<div class="memproto">
140
<table class="memname">
142
<td class="memname">std::string get_error_message </td>
144
<td class="paramname"></td>
145
<td> ) </td>
152
<p>Return's the error message in case of failure. </p>
153
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Defined only when the outcome is <code>OPERATION_FAILED</code>.</dd></dl>
154
<dl><dt><b>Exceptions:</b></dt><dd>
155
<table border="0" cellspacing="2" cellpadding="0">
156
<tr><td valign="top"></td><td valign="top"><em>std::logic_error</em> </td><td>The status object is unused. </td></tr>
163
<a class="anchor" id="a1faa468105426c442f7ac64eba8f6d8d"></a><!-- doxytag: member="peekabot::client::Status::get_outcome" ref="a1faa468105426c442f7ac64eba8f6d8d" args="() const " -->
164
<div class="memitem">
165
<div class="memproto">
166
<table class="memname">
168
<td class="memname">OperationOutcome get_outcome </td>
170
<td class="paramname"></td>
171
<td> ) </td>
178
<p>Get the operation's outcome. </p>
179
<dl class="pre"><dt><b>Precondition:</b></dt><dd>Defined only when <a class="el" href="classpeekabot_1_1client_1_1Status.html#a146e37bcbdea065d6cba3ea0c6f73af2" title="Get whether the operation's status is available.">has_completed()</a> is <code>true</code>. The object must also not be unused.</dd></dl>
180
<dl><dt><b>Exceptions:</b></dt><dd>
181
<table border="0" cellspacing="2" cellpadding="0">
182
<tr><td valign="top"></td><td valign="top"><em>std::logic_error</em> </td><td>Thrown if the preconditions are not met. </td></tr>
189
<a class="anchor" id="a146e37bcbdea065d6cba3ea0c6f73af2"></a><!-- doxytag: member="peekabot::client::Status::has_completed" ref="a146e37bcbdea065d6cba3ea0c6f73af2" args="() const " -->
190
<div class="memitem">
191
<div class="memproto">
192
<table class="memname">
194
<td class="memname">bool has_completed </td>
196
<td class="paramname"></td>
197
<td> ) </td>
204
<p>Get whether the operation's status is available. </p>
205
<dl class="pre"><dt><b>Precondition:</b></dt><dd>The object is not unused, e.g. it tracks the outcome of an operation.</dd></dl>
206
<dl><dt><b>Exceptions:</b></dt><dd>
207
<table border="0" cellspacing="2" cellpadding="0">
208
<tr><td valign="top"></td><td valign="top"><em>std::logic_error</em> </td><td>The status object is unused. </td></tr>
215
<a class="anchor" id="a5c8674792c35aee596f7fcb3e7a1455f"></a><!-- doxytag: member="peekabot::client::Status::succeeded" ref="a5c8674792c35aee596f7fcb3e7a1455f" args="() const " -->
216
<div class="memitem">
217
<div class="memproto">
218
<table class="memname">
220
<td class="memname">bool succeeded </td>
222
<td class="paramname"></td>
223
<td> ) </td>
230
<p>Waits until the operation has completed and returns <code>true</code> if it succeeded. </p>
231
<dl class="pre"><dt><b>Precondition:</b></dt><dd>The object is not unused, e.g. it tracks the outcome of an operation.</dd></dl>
232
<dl><dt><b>Exceptions:</b></dt><dd>
233
<table border="0" cellspacing="2" cellpadding="0">
234
<tr><td valign="top"></td><td valign="top"><em>std::logic_error</em> </td><td>The status object is unused. </td></tr>
241
<a class="anchor" id="ac73f74a61e39e9e42b5b2b585e8b9b7d"></a><!-- doxytag: member="peekabot::client::Status::wait_until_completed" ref="ac73f74a61e39e9e42b5b2b585e8b9b7d" args="() const " -->
242
<div class="memitem">
243
<div class="memproto">
244
<table class="memname">
246
<td class="memname">bool wait_until_completed </td>
248
<td class="paramname"></td>
249
<td> ) </td>
256
<p>Wait until <a class="el" href="classpeekabot_1_1client_1_1Status.html#a146e37bcbdea065d6cba3ea0c6f73af2" title="Get whether the operation's status is available.">has_completed()</a> is <code>true</code>. </p>
257
<p>If the operation outcome is already available the method will return promptly.</p>
258
<dl class="pre"><dt><b>Precondition:</b></dt><dd>The object is not unused, e.g. it tracks the outcome of an operation.</dd></dl>
259
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <code>true</code> if the client was disconnected before a response was received, <code>false</code> otherwise.</dd></dl>
260
<dl><dt><b>Exceptions:</b></dt><dd>
261
<table border="0" cellspacing="2" cellpadding="0">
262
<tr><td valign="top"></td><td valign="top"><em>std::logic_error</em> </td><td>The status object is unused. </td></tr>
269
<hr/>The documentation for this class was generated from the following files:<ul>
270
<li>src/client/<a class="el" href="Status_8hh_source.html">Status.hh</a></li>
271
<li>src/client/Status.cc</li>
274
<hr class="footer"/><address class="footer"><small>Generated on Sun Jan 30 2011 for peekabot by
275
<a href="http://www.doxygen.org/index.html">
276
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>