Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3ebaf504d69f581a8834e53e04e712a5 > files > 615

gearbox-devel-9.11-6.fc14.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>GearBox Project</title>

<link rel="icon" href="gbx_icon_cardbox_sky.png" type="image/png">
<link rel="shortcut icon" href="gbx_icon_cardbox_sky.png" type="image/png">

<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<!-- Google Analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3583782-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- Returning you to your regular programming -->
</head><body>

<!-- Header -->

<table border="0" cellspacing="0" cellpadding="0">

<tr><!-- create row -->

<!-- spacer cell -->
<!-- #CC CC CC -->
<td rowspan="1" colspan="1" bgcolor="#EEEEEE">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!-- menu cell -->
<td width="170" rowspan="1" colspan="1" align="left" valign="top" bgcolor="#EEEEEE">


<p>&nbsp;</p>
<p align="center"><a href="index.html"><img src="gbx_logo_cardbox_sky_150x150.png"></a></p><br>

<strong>INTRODUCTION</strong><br>
<strong><a href="gbx_doc_overview.html" style="text-decoration:none">Overview</a></strong><br>
<strong><a href="gbx_doc_getting.html" style="text-decoration:none">Download and Install</a></strong><br>
<!-- <strong><a href="gbx_doc_quickstart.html" style="text-decoration:none">Quick Start</a></strong><br> -->
<strong><a href="gbx_doc_documentation.html" style="text-decoration:none">Documentation</a></strong><br>
<strong><a href="gbx_doc_publications.html" style="text-decoration:none">Publications</a></strong><br>
<br>

<strong>REPOSITORY</strong><br>
<strong><a href="group__gbx__libs.html" style="text-decoration:none">Libraries</a></strong><br>
<!-- <strong><a href="group__gbx__utils.html" style="text-decoration:none">Utilities</a></strong><br> -->
<br>

<strong>DEVELOPER</strong><br>

<!--<strong><a href="gbx_doc_tutorials.html" style="text-decoration:none">Tutorials</a></strong><br>
<strong><a href="group__gbx__examples.html" style="text-decoration:none">Examples</a></strong><br>-->
<strong><a href="gbx_doc_devguide.html" style="text-decoration:none">Dev Guide</a></strong><br>
<!-- 
<strong><a href="gbx_doc_faq.html" style="text-decoration:none">FAQ</a></strong><br>
-->
<strong><a href="http://cdash.acfr.usyd.edu.au/index.php?project=Gearbox" style="text-decoration:none">Dashboard</a></strong><br>
<!--<strong><a href="http://wiki2.cas.edu.au/orca">Wiki</a></strong><br>
login/pass: orca/orca<br>-->
<br>

<strong>PEOPLE</strong><br>
<strong><a href="gbx_doc_contributors.html" style="text-decoration:none">Contributors</a></strong><br>
<strong><a href="gbx_doc_users.html" style="text-decoration:none">Users</a></strong><br>
<br>

<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=216468&amp;type=2" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a><br>
<strong><a href="http://sourceforge.net/projects/gearbox">Project</a></strong><br>
<strong><a href="http://sourceforge.net/project/showfiles.php?group_id=216468">Download</a></strong><br>
<!--<strong><a href="http://sourceforge.net/tracker/?group_id=216468">Bugs/Feedback</a></strong><br>-->
<strong><a href="http://sourceforge.net/mail/?group_id=216468">Mailing lists</a></strong></p>
<p>&nbsp;</p>

</td><!-- /menu cell -->

<!-- one grey spacer cells -->
<td rowspan="1" colspan="1" bgcolor="#EEEEEE">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!-- one white spacer cells -->
<td rowspan="1" colspan="1">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!-- main content cell -->
<td rowspan="1" colspan="1" align="left" valign="top">


<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_b8ba9ebcb71a95a44c4fd60b7d348fe1.html">src</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_a849190606a9751ee92c69243c2a17cc.html">gbxutilacfr</a>
  </div>
</div>
<div class="contents">
<h1>substatus.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics</span>
<a name="l00003"></a>00003 <span class="comment"> *               http://gearbox.sf.net/</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * This distribution is licensed to you under the terms described in</span>
<a name="l00007"></a>00007 <span class="comment"> * the LICENSE file included in this distribution.</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> */</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="preprocessor">#ifndef GBXUTILACFR_SUBSYSTEM_STATUS_H</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define GBXUTILACFR_SUBSYSTEM_STATUS_H</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a>00014 <span class="preprocessor">#if defined (WIN32)</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">    #if defined (GBXUTILACFR_STATIC)</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">        #define GBXUTILACFR_EXPORT</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">    #elif defined (GBXUTILACFR_EXPORTS)</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">        #define GBXUTILACFR_EXPORT       __declspec (dllexport)</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">    #else</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">        #define GBXUTILACFR_EXPORT       __declspec (dllimport)</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">    #endif</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">    #define GBXUTILACFR_EXPORT</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;gbxutilacfr/status.h&gt;</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="keyword">namespace </span>gbxutilacfr {
<a name="l00029"></a>00029 
<a name="l00039"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html">00039</a> <span class="keyword">class </span>GBXUTILACFR_EXPORT <a class="code" href="classgbxutilacfr_1_1SubStatus.html" title="Convenience class which maniupulates the status of a subsystem.">SubStatus</a>
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="keyword">public</span>:
<a name="l00045"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#aa1e74ff50587383c417392acf28eb456">00045</a>     <a class="code" href="classgbxutilacfr_1_1SubStatus.html" title="Convenience class which maniupulates the status of a subsystem.">SubStatus</a>( <a class="code" href="classgbxutilacfr_1_1Status.html" title="Local interface to component status.">Status</a>&amp; status, <span class="keyword">const</span> std::string&amp; subsysName, <span class="keywordtype">double</span> maxHeartbeatIntervalSec=-1.0 ) :
<a name="l00046"></a>00046         status_(status),
<a name="l00047"></a>00047         subsysName_(subsysName) 
<a name="l00048"></a>00048     {
<a name="l00049"></a>00049         status_.addSubsystem( subsysName_, maxHeartbeatIntervalSec );
<a name="l00050"></a>00050     };
<a name="l00051"></a>00051 
<a name="l00053"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#ac15313ce52a83008a43b3230a4cb6222">00053</a>     ~<a class="code" href="classgbxutilacfr_1_1SubStatus.html" title="Convenience class which maniupulates the status of a subsystem.">SubStatus</a>()
<a name="l00054"></a>00054     {
<a name="l00055"></a>00055         status_.removeSubsystem( subsysName_ );
<a name="l00056"></a>00056     }
<a name="l00057"></a>00057 
<a name="l00058"></a>00058     <span class="comment">//</span>
<a name="l00059"></a>00059     <span class="comment">// set expectations about ourselves</span>
<a name="l00060"></a>00060     <span class="comment">//</span>
<a name="l00061"></a>00061 
<a name="l00063"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#a4e78399a8fb322a4bc1e188c4b007400">00063</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#a4e78399a8fb322a4bc1e188c4b007400" title="Passes this information to the system Status.">setMaxHeartbeatInterval</a>( <span class="keywordtype">double</span> interval ) { status_.setMaxHeartbeatInterval( subsysName_, interval ); };
<a name="l00064"></a>00064 
<a name="l00066"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#ac4b3a2cad961a7a91fbe525008ef226a">00066</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#ac4b3a2cad961a7a91fbe525008ef226a" title="Passes this information to the system Status.">setSubsystemType</a>( <a class="code" href="namespacegbxutilacfr.html#a83955362590d05dc433ff5ba377a704b" title="Subsystem type which describes common behavior models of a subsystem.">SubsystemType</a> type ) { status_.setSubsystemType( subsysName_, type ); };
<a name="l00067"></a>00067 
<a name="l00068"></a>00068     <span class="comment">//</span>
<a name="l00069"></a>00069     <span class="comment">// set health</span>
<a name="l00070"></a>00070     <span class="comment">//</span>
<a name="l00071"></a>00071 
<a name="l00073"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#a5604e9434630cf86af4413de0f9942c9">00073</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#a5604e9434630cf86af4413de0f9942c9" title="Passes this information to the system Status.">heartbeat</a>() { status_.heartbeat( subsysName_ ); };
<a name="l00074"></a>00074 
<a name="l00076"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#aeb3ccd98bbd8538f25e025c92a55795d">00076</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#aeb3ccd98bbd8538f25e025c92a55795d" title="Passes this information to the system Status.">message</a>( <span class="keyword">const</span> std::string&amp; message ) { status_.message( subsysName_, message ); };
<a name="l00077"></a>00077 
<a name="l00079"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#a0620674f75ac8ef16360d4b3471b3c78">00079</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#a0620674f75ac8ef16360d4b3471b3c78" title="Passes this information to the system Status.">ok</a>( <span class="keyword">const</span> std::string&amp; message=<span class="stringliteral">&quot;&quot;</span> ) { status_.ok( subsysName_, message ); };
<a name="l00080"></a>00080 
<a name="l00082"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#afe967684ec3aa20ad063a1bbcfc5508b">00082</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#afe967684ec3aa20ad063a1bbcfc5508b" title="Passes this information to the system Status.">warning</a>( <span class="keyword">const</span> std::string&amp; message ) { status_.warning( subsysName_, message ); };
<a name="l00083"></a>00083 
<a name="l00085"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#a9a6d1cefde68c7df53a63fe580d2b53c">00085</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#a9a6d1cefde68c7df53a63fe580d2b53c" title="Passes this information to the system Status.">fault</a>( <span class="keyword">const</span> std::string&amp; message ) { status_.fault( subsysName_, message ); };
<a name="l00086"></a>00086 
<a name="l00087"></a>00087     <span class="comment">//</span>
<a name="l00088"></a>00088     <span class="comment">// Set state machine states</span>
<a name="l00089"></a>00089     <span class="comment">//</span>
<a name="l00090"></a>00090 
<a name="l00092"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#af527b7dfaffc05d73d2d5d10e79e32f6">00092</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#af527b7dfaffc05d73d2d5d10e79e32f6" title="Passes this information to the system Status.">initialising</a>( <span class="keyword">const</span> std::string&amp; message=<span class="stringliteral">&quot;&quot;</span> ) { status_.initialising( subsysName_, message ); };
<a name="l00093"></a>00093 
<a name="l00095"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#ab9ec3cced0be787a7a4fd3a9ede9bf70">00095</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#ab9ec3cced0be787a7a4fd3a9ede9bf70" title="Passes this information to the system Status.">working</a>( <span class="keyword">const</span> std::string&amp; message=<span class="stringliteral">&quot;&quot;</span> ) { status_.working( subsysName_, message ); };
<a name="l00096"></a>00096 
<a name="l00098"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#a46b27f8be5d7ef5ab80d520b72120323">00098</a>     <span class="keywordtype">void</span> <a class="code" href="classgbxutilacfr_1_1SubStatus.html#a46b27f8be5d7ef5ab80d520b72120323" title="Passes this information to the system Status.">finalising</a>( <span class="keyword">const</span> std::string&amp; message=<span class="stringliteral">&quot;&quot;</span> ) { status_.finalising( subsysName_, message ); };
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 
<a name="l00102"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#a6378494b04bda11ca73f1b78f96107f9">00102</a>     <a class="code" href="classgbxutilacfr_1_1Status.html" title="Local interface to component status.">Status</a>&amp; <a class="code" href="classgbxutilacfr_1_1SubStatus.html#a6378494b04bda11ca73f1b78f96107f9" title="Returns system Status object.">status</a>() { <span class="keywordflow">return</span> status_; };
<a name="l00103"></a>00103 
<a name="l00105"></a><a class="code" href="classgbxutilacfr_1_1SubStatus.html#a13301a0999cbbe7edebf2988f30262f7">00105</a>     std::string <a class="code" href="classgbxutilacfr_1_1SubStatus.html#a13301a0999cbbe7edebf2988f30262f7" title="Returns subsystem&amp;#39;s name.">name</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> subsysName_; };
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 <span class="keyword">private</span>:
<a name="l00108"></a>00108 
<a name="l00109"></a>00109     <a class="code" href="classgbxutilacfr_1_1Status.html" title="Local interface to component status.">Status</a>&amp; status_;
<a name="l00110"></a>00110     std::string subsysName_;
<a name="l00111"></a>00111 };
<a name="l00112"></a>00112 
<a name="l00113"></a>00113 } <span class="comment">// namespace</span>
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="preprocessor">#endif</span>
</pre></div></div>

            </td>
            <td colspan="1">&nbsp;</td>
         </tr>
        </table>
<!-- end of table -->

 <hr size="1"><address style="align: right;"><small>Generated for GearBox by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.5 </small></address>
</body>
</html>