Sophie

Sophie

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

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_e6faee39d20d45fac309cc35f2ddb285.html">gbxsickacfr</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_40c823cb7c24b596a1e1c0c483dfcd86.html">gbxiceutilacfr</a>
  </div>
</div>
<div class="contents">
<h1>store.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 GBXICEUTILACFR_STORE_H</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define GBXICEUTILACFR_STORE_H</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;gbxutilacfr/exceptions.h&gt;</span>
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;IceUtil/Monitor.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;IceUtil/Mutex.h&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;IceUtil/Time.h&gt;</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="keyword">namespace </span>gbxiceutilacfr {
<a name="l00021"></a>00021 
<a name="l00041"></a>00041 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00042"></a><a class="code" href="classgbxiceutilacfr_1_1Store.html">00042</a> <span class="keyword">class </span><a class="code" href="classgbxiceutilacfr_1_1Store.html" title="Thread-safe storage for a single data objects.">Store</a> : <span class="keyword">public</span> IceUtil::Monitor&lt;IceUtil::Mutex&gt;
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044 <span class="keyword">public</span>:
<a name="l00045"></a>00045 
<a name="l00046"></a>00046     <a class="code" href="classgbxiceutilacfr_1_1Store.html" title="Thread-safe storage for a single data objects.">Store</a>();
<a name="l00047"></a>00047     <span class="keyword">virtual</span> ~<a class="code" href="classgbxiceutilacfr_1_1Store.html" title="Thread-safe storage for a single data objects.">Store</a>();
<a name="l00048"></a>00048 
<a name="l00052"></a>00052     <span class="keywordtype">bool</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a2ad270588b78c2141254d024dfc52aa9">isEmpty</a>() <span class="keyword">const</span>;
<a name="l00053"></a>00053     
<a name="l00055"></a>00055     <span class="keywordtype">bool</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a9ad94fcb79126e6fea65a2f3f88ddca0" title="Returns TRUE if the data in the Store has not been accessed with get() yet.">isNewData</a>() <span class="keyword">const</span>;
<a name="l00056"></a>00056 
<a name="l00058"></a>00058     <span class="keywordtype">void</span> <span class="keyword">set</span>( <span class="keyword">const</span> Type &amp; obj );
<a name="l00059"></a>00059 
<a name="l00063"></a>00063     <span class="keywordtype">void</span> <span class="keyword">get</span>( Type &amp; obj );
<a name="l00064"></a>00064 
<a name="l00068"></a>00068     <span class="keywordtype">void</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a1d2bd86fbe17b1e2027b0afd6fac8558">peek</a>( Type &amp; obj ) <span class="keyword">const</span>;
<a name="l00069"></a>00069 
<a name="l00079"></a>00079     <span class="keywordtype">int</span>  <a class="code" href="classgbxiceutilacfr_1_1Store.html#a6b0cd62a7217e2edadbc2ccde18f41d2" title="Waits until the next update and returns the new value. If the Store is empty, getNext...">getNext</a>( Type &amp; obj, <span class="keywordtype">int</span> timeoutMs=-1 );
<a name="l00080"></a>00080     
<a name="l00083"></a>00083     <span class="keywordtype">void</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a12aecb60ba03316e3709d15ca7c38622">purge</a>();
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 <span class="keyword">protected</span>:
<a name="l00086"></a>00086     
<a name="l00087"></a>00087     <span class="comment">// local copy of the object</span>
<a name="l00088"></a>00088     Type obj_;
<a name="l00089"></a>00089 
<a name="l00090"></a>00090     <span class="comment">// Reimplement this function for non-standard types.</span>
<a name="l00091"></a>00091     <span class="keyword">virtual</span> <span class="keywordtype">void</span> internalGet( Type &amp; obj ) <span class="keyword">const</span> ;
<a name="l00092"></a>00092     
<a name="l00093"></a>00093     <span class="comment">// Reimplement this function for non-standard types.</span>
<a name="l00094"></a>00094     <span class="keyword">virtual</span> <span class="keywordtype">void</span> internalSet( <span class="keyword">const</span> Type &amp; obj );
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 <span class="keyword">private</span>:
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 
<a name="l00099"></a>00099     <span class="keywordtype">bool</span> isEmpty_;
<a name="l00100"></a>00100     
<a name="l00101"></a>00101     <span class="comment">// flag to keep track of new data.</span>
<a name="l00102"></a>00102     <span class="keywordtype">bool</span> isNewData_;
<a name="l00103"></a>00103 
<a name="l00104"></a>00104     <span class="comment">// internal implementation of front( obj, -1 ); returns 0.</span>
<a name="l00105"></a>00105     <span class="keywordtype">int</span>  getNextNoWait( Type &amp; obj );
<a name="l00106"></a>00106 
<a name="l00107"></a>00107 };
<a name="l00108"></a>00108 
<a name="l00109"></a>00109 
<a name="l00111"></a>00111 
<a name="l00112"></a>00112 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00113"></a>00113 <a class="code" href="classgbxiceutilacfr_1_1Store.html" title="Thread-safe storage for a single data objects.">Store&lt;Type&gt;::Store</a>()
<a name="l00114"></a>00114     : isEmpty_(true),
<a name="l00115"></a>00115       isNewData_(false)
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117 }
<a name="l00118"></a>00118 
<a name="l00119"></a>00119 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00120"></a>00120 Store&lt;Type&gt;::~Store()
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00125"></a><a class="code" href="classgbxiceutilacfr_1_1Store.html#a2ad270588b78c2141254d024dfc52aa9">00125</a> <span class="keywordtype">bool</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a2ad270588b78c2141254d024dfc52aa9">Store&lt;Type&gt;::isEmpty</a>()<span class="keyword"> const</span>
<a name="l00126"></a>00126 <span class="keyword"></span>{
<a name="l00127"></a>00127     IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(*<span class="keyword">this</span>);
<a name="l00128"></a>00128     <span class="keywordflow">return</span> isEmpty_;
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130 
<a name="l00131"></a>00131 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00132"></a><a class="code" href="classgbxiceutilacfr_1_1Store.html#a9ad94fcb79126e6fea65a2f3f88ddca0">00132</a> <span class="keywordtype">bool</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a9ad94fcb79126e6fea65a2f3f88ddca0" title="Returns TRUE if the data in the Store has not been accessed with get() yet.">Store&lt;Type&gt;::isNewData</a>()<span class="keyword"> const</span>
<a name="l00133"></a>00133 <span class="keyword"></span>{
<a name="l00134"></a>00134     IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(*<span class="keyword">this</span>);
<a name="l00135"></a>00135     <span class="keywordflow">return</span> isNewData_;
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137 
<a name="l00138"></a>00138 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00139"></a><a class="code" href="classgbxiceutilacfr_1_1Store.html#ae0dad32492d44a01e70185cb1cbfa1cb">00139</a> <span class="keywordtype">void</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#ae0dad32492d44a01e70185cb1cbfa1cb">Store&lt;Type&gt;::get</a>( Type &amp; obj )
<a name="l00140"></a>00140 {
<a name="l00141"></a>00141     IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(*<span class="keyword">this</span>);
<a name="l00142"></a>00142     <span class="keywordflow">if</span> ( !isEmpty_ )
<a name="l00143"></a>00143     {
<a name="l00144"></a>00144         internalGet( obj );
<a name="l00145"></a>00145         isNewData_ = <span class="keyword">false</span>;
<a name="l00146"></a>00146     }
<a name="l00147"></a>00147     <span class="keywordflow">else</span>
<a name="l00148"></a>00148     {
<a name="l00149"></a>00149         <span class="keywordflow">throw</span> <a class="code" href="classgbxutilacfr_1_1Exception.html" title="Base class for all GbxUtilAcfr exceptions.">gbxutilacfr::Exception</a>( ERROR_INFO, <span class="stringliteral">&quot;trying to read from an empty Store.&quot;</span> );
<a name="l00150"></a>00150     }
<a name="l00151"></a>00151 }
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00154"></a><a class="code" href="classgbxiceutilacfr_1_1Store.html#a1d2bd86fbe17b1e2027b0afd6fac8558">00154</a> <span class="keywordtype">void</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a1d2bd86fbe17b1e2027b0afd6fac8558">Store&lt;Type&gt;::peek</a>( Type &amp; obj )<span class="keyword"> const</span>
<a name="l00155"></a>00155 <span class="keyword"></span>{
<a name="l00156"></a>00156     IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(*<span class="keyword">this</span>);
<a name="l00157"></a>00157     <span class="keywordflow">if</span> ( !isEmpty_ )
<a name="l00158"></a>00158     {
<a name="l00159"></a>00159         internalGet( obj );
<a name="l00160"></a>00160         <span class="comment">// do NOT set isNewData_ to false</span>
<a name="l00161"></a>00161     }
<a name="l00162"></a>00162     <span class="keywordflow">else</span>
<a name="l00163"></a>00163     {
<a name="l00164"></a>00164         <span class="keywordflow">throw</span> <a class="code" href="classgbxutilacfr_1_1Exception.html" title="Base class for all GbxUtilAcfr exceptions.">gbxutilacfr::Exception</a>( ERROR_INFO, <span class="stringliteral">&quot;trying to read from an empty Store.&quot;</span> );
<a name="l00165"></a>00165     }
<a name="l00166"></a>00166 }
<a name="l00167"></a>00167 
<a name="l00168"></a>00168 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00169"></a><a class="code" href="classgbxiceutilacfr_1_1Store.html#a6b0cd62a7217e2edadbc2ccde18f41d2">00169</a> <span class="keywordtype">int</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a6b0cd62a7217e2edadbc2ccde18f41d2" title="Waits until the next update and returns the new value. If the Store is empty, getNext...">Store&lt;Type&gt;::getNext</a>( Type &amp; obj, <span class="keywordtype">int</span> timeoutMs )
<a name="l00170"></a>00170 {
<a name="l00171"></a>00171     <span class="comment">// special case: infinite wait time</span>
<a name="l00172"></a>00172     <span class="keywordflow">if</span> ( timeoutMs == -1 ) {
<a name="l00173"></a>00173         <span class="keywordflow">return</span> getNextNoWait( obj );
<a name="l00174"></a>00174     }
<a name="l00175"></a>00175 
<a name="l00176"></a>00176     <span class="comment">// finite wait time</span>
<a name="l00177"></a>00177     IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(*<span class="keyword">this</span>);
<a name="l00178"></a>00178 
<a name="l00179"></a>00179     <span class="comment">// if already have data in the buffer, return it and get out</span>
<a name="l00180"></a>00180     <span class="keywordflow">if</span> ( isNewData_ )
<a name="l00181"></a>00181     {
<a name="l00182"></a>00182         internalGet( obj );
<a name="l00183"></a>00183         isNewData_ = <span class="keyword">false</span>;
<a name="l00184"></a>00184         <span class="keywordflow">return</span> 0;
<a name="l00185"></a>00185     }
<a name="l00186"></a>00186 
<a name="l00187"></a>00187     <span class="comment">// empty buffer: figure out when to wake up</span>
<a name="l00188"></a>00188     <span class="comment">// notice that we are still holding the lock, so it&#39;s ok to call timedWait()</span>
<a name="l00189"></a>00189     <span class="keywordflow">if</span> (  this-&gt;timedWait( IceUtil::Time::milliSeconds( timeoutMs ) ) )  
<a name="l00190"></a>00190     {
<a name="l00191"></a>00191         <span class="comment">// someone woke us up, we are holding the lock again</span>
<a name="l00192"></a>00192         <span class="comment">// check new data again (could be a spurious wakeup)</span>
<a name="l00193"></a>00193         <span class="keywordflow">if</span> ( isNewData_ ) 
<a name="l00194"></a>00194         {
<a name="l00195"></a>00195             internalGet( obj );
<a name="l00196"></a>00196             isNewData_ = <span class="keyword">false</span>;
<a name="l00197"></a>00197             <span class="keywordflow">return</span> 0;
<a name="l00198"></a>00198         }
<a name="l00199"></a>00199         <span class="keywordflow">else</span> {
<a name="l00200"></a>00200             <span class="comment">// spurious wakup, don&#39;t wait again, just return</span>
<a name="l00201"></a>00201             <span class="keywordflow">return</span> 1;
<a name="l00202"></a>00202         }
<a name="l00203"></a>00203     }
<a name="l00204"></a>00204     <span class="keywordflow">else</span> {
<a name="l00205"></a>00205         <span class="comment">// wait timedout, nobody woke us up</span>
<a name="l00206"></a>00206         <span class="keywordflow">return</span> -1;
<a name="l00207"></a>00207     }
<a name="l00208"></a>00208 }
<a name="l00209"></a>00209 
<a name="l00210"></a>00210 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00211"></a>00211 <span class="keywordtype">int</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html" title="Thread-safe storage for a single data objects.">Store&lt;Type&gt;::getNextNoWait</a>( Type &amp; obj )
<a name="l00212"></a>00212 {
<a name="l00213"></a>00213     IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(*<span class="keyword">this</span>);
<a name="l00214"></a>00214 
<a name="l00215"></a>00215     <span class="comment">// check the condition before and after waiting to deal with spurious wakeups</span>
<a name="l00216"></a>00216     <span class="comment">// (see Ice manual sec. 28.9.2)</span>
<a name="l00217"></a>00217     <span class="keywordflow">while</span> ( !isNewData_ ) 
<a name="l00218"></a>00218     {
<a name="l00219"></a>00219         this-&gt;wait();
<a name="l00220"></a>00220     }
<a name="l00221"></a>00221    
<a name="l00222"></a>00222     internalGet( obj );
<a name="l00223"></a>00223     isNewData_ = <span class="keyword">false</span>;
<a name="l00224"></a>00224     <span class="keywordflow">return</span> 0;
<a name="l00225"></a>00225 }
<a name="l00226"></a>00226 
<a name="l00227"></a>00227 <span class="comment">// NOTE: see notes on efficient notification in Ice sec. 28.9.3</span>
<a name="l00228"></a>00228 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00229"></a><a class="code" href="classgbxiceutilacfr_1_1Store.html#ac0bf7d34583d028405615475ed30c745">00229</a> <span class="keywordtype">void</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#ac0bf7d34583d028405615475ed30c745" title="Sets the contents of the Store.">Store&lt;Type&gt;::set</a>( <span class="keyword">const</span> Type &amp;obj )
<a name="l00230"></a>00230 {
<a name="l00231"></a>00231     IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(*<span class="keyword">this</span>);
<a name="l00232"></a>00232     
<a name="l00233"></a>00233     internalSet( obj );
<a name="l00234"></a>00234 
<a name="l00235"></a>00235     <span class="comment">// mark as having new data (nobody has looked at it yet)</span>
<a name="l00236"></a>00236     isNewData_ = <span class="keyword">true</span>;
<a name="l00237"></a>00237     
<a name="l00238"></a>00238     <span class="comment">// mark Store non-empty (only usefull the very first time)</span>
<a name="l00239"></a>00239     isEmpty_ = <span class="keyword">false</span>;
<a name="l00240"></a>00240     
<a name="l00241"></a>00241     <span class="comment">// wakeup someone who&#39;s waiting for an update</span>
<a name="l00242"></a>00242     this-&gt;notify();
<a name="l00243"></a>00243 }
<a name="l00244"></a>00244 
<a name="l00245"></a>00245 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00246"></a><a class="code" href="classgbxiceutilacfr_1_1Store.html#a12aecb60ba03316e3709d15ca7c38622">00246</a> <span class="keywordtype">void</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html#a12aecb60ba03316e3709d15ca7c38622">Store&lt;Type&gt;::purge</a>()
<a name="l00247"></a>00247 {
<a name="l00248"></a>00248     IceUtil::Monitor&lt;IceUtil::Mutex&gt;::Lock lock(*<span class="keyword">this</span>);
<a name="l00249"></a>00249     isEmpty_ = <span class="keyword">true</span>;
<a name="l00250"></a>00250 }
<a name="l00251"></a>00251 
<a name="l00252"></a>00252 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;
<a name="l00253"></a>00253 <span class="keywordtype">void</span> <a class="code" href="classgbxiceutilacfr_1_1Store.html" title="Thread-safe storage for a single data objects.">Store&lt;Type&gt;::internalGet</a>( Type &amp; obj )<span class="keyword"> const</span>
<a name="l00254"></a>00254 <span class="keyword"></span>{
<a name="l00255"></a>00255     obj = obj_;
<a name="l00256"></a>00256 }
<a name="l00257"></a>00257 
<a name="l00258"></a>00258 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Type&gt;    
<a name="l00259"></a>00259 <span class="keywordtype">void</span> Store&lt;Type&gt;::internalSet( <span class="keyword">const</span> Type &amp; obj )
<a name="l00260"></a>00260 {
<a name="l00261"></a>00261     obj_ = obj;
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263 
<a name="l00264"></a>00264 } <span class="comment">// end namespace</span>
<a name="l00265"></a>00265 
<a name="l00266"></a>00266 <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>