<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <!-- $Id: header.html 8799 2010-06-28 04:12:42Z jpgr87 $ --> <HEAD> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=utf-8"> <meta name="keywords" content="stage, robot, simulation, player, player/stage"> <link href="doxygen.css" rel="stylesheet" type="text/css"> <style type="text/css"> .floatright { float: right; margin: 0 0 1em 1em; } body { font-family: sans-serif; #font-family: Geneva, Verdana, Helvetica, Arial, sans-serif; background-color: #FFF; color:#000; } a:link { color: #A00; } a:visited { color: #800; } a { text-decoration: none; } a:hover { text-decoration: underline; } .timestamp { text-align:right; background-color: #DDD; font-size:75%;} h1 { font-size:160%; } h2 { font-size:110%; #color: #FFF; #background-color: #666; #padding:3px; } h3 { text-align:left; } img { border: 0; } ul.menu { position:relative; left:-2.5em; margin-bottom:0px; margin-top:0px; } ul.menu1 { position:relative; left:-2.1em; margin-bottom:0px; margin-top:0px; } li.menu { list-style-type: none; position:relative; #left:-0.5em; } #sidebar { position: absolute; left:0px; padding:2em; top:0em; width:12em;} #content { position: absolute; left:12em; top:0em; padding-left:3em; padding-right:3em; padding-bottom:2em; margin-top:1em; margin-right:2em; } div.box { background-color:#EEE; border: 1px solid #000; padding: 0.5ex 0.4em 0.5ex 0.6em; margin:1em; } div.title { font-weight:bold; background-color:#eee; margin-bottom:2px;} div.topbar { position: absolute; top:0px; left:9em; margin:1em; } </style> <TITLE>Player Manual</TITLE> </HEAD> <body> <div id="sidebar"> <h2 style="text-align:center;"> <a href="index.html"> <img width=140 src="http://playerstage.sourceforge.net/images/player_button_v3.png" alt="Player logo"><br></a> </h2> <div class="box"> <div class=title>Player</div> <ul class=menu> <li class=menu><a href="index.html">Frontpage</a> <li class=menu><a href="modules.html">Contents</a> </ul> </div> <div class="box"> <div class=title>User</div> <ul class=menu> <li class=menu><a href="install.html">Installation</a> <li class=menu><a href="start.html">Quick start</a> <li class=menu><a href="supported_hardware.html">Supported devices</a> <li class=menu><a href="group__tutorials.html">Tutorials</a> <li class=menu><a href="group__utils.html">Utilities</a> <li class=menu><a href="group__clientlibs.html">Client libraries</a> <li class=menu><a href="http://playerstage.sourceforge.net/wiki/Basic_FAQ">FAQ</a> <li class=menu><a href="help.html">Help</a> </ul> </div> <div class=box> <div class="title">Developer</div> <ul class=menu> <li class=menu><a href="architecture.html">Architecture</a> <li class=menu><a href="group__libplayercore.html">libplayercore</a> <ul class=menu1> <li class=menu><a href="group__interfaces.html">interfaces</a></li> </ul> <li class=menu><a href="group__libplayerdrivers.html">libplayerdrivers</a> <ul class=menu1> <li class=menu><a href="group__drivers.html">drivers</a></li> </ul> <li class=menu><a href="group__libplayercommon.html">libplayercommon</a> <li class=menu><a href="group__libplayerutils.html">libplayerutils</a> <li class=menu><a href="group__libplayersd.html">libplayersd</a> <li class=menu><a href="group__libplayertcp.html">libplayertcp</a> <li class=menu><a href="group__libplayerxdr.html">libplayerxdr</a> <li class=menu><a href="todo.html">TODO</a> </ul> </div> <div class=box> <!-- <a href="http://sourceforge.net"><img border=0 src="http://sourceforge.net/sflogo.php?group_id=42445&type=1"></a> --> <div class="title">Online</div> <a href="http://playerstage.sourceforge.net">Homepage</a><br> <a href="http://sourceforge.net/project/showfiles.php?group_id=42445">Download</a><br> <a href="http://sourceforge.net/projects/playerstage">Project</a><br> <a href="http://sourceforge.net/tracker/?group_id=42445">Bugs</a><br> <a href="http://sourceforge.net/mail/?group_id=42445">Help</a> </div> </div> <div id="content" > <!-- Generated by Doxygen 1.7.1 --> <div class="header"> <div class="headertitle"> <h1>clientproxy.h</h1> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * Player - One Hell of a Robot Server</span> <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2003</span> <a name="l00004"></a>00004 <span class="comment"> * Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard</span> <a name="l00005"></a>00005 <span class="comment"> *</span> <a name="l00006"></a>00006 <span class="comment"> *</span> <a name="l00007"></a>00007 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span> <a name="l00008"></a>00008 <span class="comment"> * it under the terms of the GNU General Public License as published by</span> <a name="l00009"></a>00009 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span> <a name="l00010"></a>00010 <span class="comment"> * (at your option) any later version.</span> <a name="l00011"></a>00011 <span class="comment"> *</span> <a name="l00012"></a>00012 <span class="comment"> * This program is distributed in the hope that it will be useful,</span> <a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00015"></a>00015 <span class="comment"> * GNU General Public License for more details.</span> <a name="l00016"></a>00016 <span class="comment"> *</span> <a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU General Public License</span> <a name="l00018"></a>00018 <span class="comment"> * along with this program; if not, write to the Free Software</span> <a name="l00019"></a>00019 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span> <a name="l00020"></a>00020 <span class="comment"> *</span> <a name="l00021"></a>00021 <span class="comment"> */</span> <a name="l00022"></a>00022 <span class="comment">/********************************************************************</span> <a name="l00023"></a>00023 <span class="comment"> *</span> <a name="l00024"></a>00024 <span class="comment"> * This library is free software; you can redistribute it and/or</span> <a name="l00025"></a>00025 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span> <a name="l00026"></a>00026 <span class="comment"> * License as published by the Free Software Foundation; either</span> <a name="l00027"></a>00027 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span> <a name="l00028"></a>00028 <span class="comment"> *</span> <a name="l00029"></a>00029 <span class="comment"> * This library is distributed in the hope that it will be useful,</span> <a name="l00030"></a>00030 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00031"></a>00031 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00032"></a>00032 <span class="comment"> * Lesser General Public License for more details.</span> <a name="l00033"></a>00033 <span class="comment"> *</span> <a name="l00034"></a>00034 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span> <a name="l00035"></a>00035 <span class="comment"> * License along with this library; if not, write to the Free Software</span> <a name="l00036"></a>00036 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span> <a name="l00037"></a>00037 <span class="comment"> *</span> <a name="l00038"></a>00038 <span class="comment"> ********************************************************************/</span> <a name="l00039"></a>00039 <a name="l00040"></a>00040 <span class="comment">/***************************************************************************</span> <a name="l00041"></a>00041 <span class="comment"> * Desc: Player v2.0 C++ client</span> <a name="l00042"></a>00042 <span class="comment"> * Authors: Brad Kratochvil, Toby Collett</span> <a name="l00043"></a>00043 <span class="comment"> *</span> <a name="l00044"></a>00044 <span class="comment"> * Date: 23 Sep 2005</span> <a name="l00045"></a>00045 <span class="comment"> # CVS: $Id: clientproxy.h 8022 2009-07-15 03:59:24Z gbiggs $</span> <a name="l00046"></a>00046 <span class="comment"> **************************************************************************/</span> <a name="l00047"></a>00047 <a name="l00048"></a>00048 <a name="l00049"></a>00049 <span class="preprocessor">#ifndef PLAYERCC_CLIENTPROXY_H</span> <a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define PLAYERCC_CLIENTPROXY_H</span> <a name="l00051"></a>00051 <span class="preprocessor"></span> <a name="l00052"></a>00052 <span class="preprocessor">#if defined (WIN32)</span> <a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor"> #if defined (PLAYER_STATIC)</span> <a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor"> #define PLAYERCC_EXPORT</span> <a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor"> #elif defined (playerc___EXPORTS)</span> <a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor"> #define PLAYERCC_EXPORT __declspec (dllexport)</span> <a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor"> #else</span> <a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor"> #define PLAYERCC_EXPORT __declspec (dllimport)</span> <a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor"> #endif</span> <a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#else</span> <a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor"> #define PLAYERCC_EXPORT</span> <a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00063"></a>00063 <span class="preprocessor"></span> <a name="l00064"></a>00064 <span class="keyword">namespace </span>PlayerCc <a name="l00065"></a>00065 { <a name="l00066"></a>00066 <a name="l00079"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html">00079</a> <span class="keyword">class </span>PLAYERCC_EXPORT <a class="code" href="classPlayerCc_1_1ClientProxy.html" title="The client proxy base class.">ClientProxy</a> <a name="l00080"></a>00080 { <a name="l00081"></a>00081 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classPlayerCc_1_1PlayerClient.html" title="The PlayerClient is used for communicating with the player server.">PlayerClient</a>; <a name="l00082"></a>00082 <a name="l00083"></a>00083 <span class="keyword">public</span>: <a name="l00084"></a>00084 <a name="l00085"></a>00085 <span class="preprocessor">#ifdef HAVE_BOOST_SIGNALS</span> <a name="l00086"></a>00086 <span class="preprocessor"></span> <a name="l00087"></a>00087 <a name="l00088"></a>00088 <span class="keyword">typedef</span> boost::signals::connection connection_t; <a name="l00089"></a>00089 <a name="l00091"></a>00091 <span class="keyword">typedef</span> <a class="code" href="classboost_1_1mutex_1_1scoped__lock.html">boost::mutex::scoped_lock</a> <a class="code" href="classboost_1_1mutex_1_1scoped__lock.html">scoped_lock_t</a>; <a name="l00092"></a>00092 <a name="l00094"></a>00094 <span class="keyword">typedef</span> boost::signal<void (void)> read_signal_t; <a name="l00095"></a>00095 <span class="preprocessor">#else</span> <a name="l00096"></a>00096 <span class="preprocessor"></span> <span class="comment">// if we're not using boost, just define them.</span> <a name="l00097"></a>00097 <span class="keyword">typedef</span> <span class="keywordtype">int</span> connection_t; <a name="l00098"></a>00098 <span class="comment">// we redefine boost::mustex::scoped_lock in playerclient.h</span> <a name="l00099"></a>00099 <span class="keyword">typedef</span> <a class="code" href="classboost_1_1mutex_1_1scoped__lock.html">boost::mutex::scoped_lock</a> <a class="code" href="classboost_1_1mutex_1_1scoped__lock.html">scoped_lock_t</a>; <a name="l00100"></a>00100 <span class="comment">// if we're not using boost, just define them.</span> <a name="l00101"></a>00101 <span class="keyword">typedef</span> <span class="keywordtype">int</span> read_signal_t; <a name="l00102"></a>00102 <span class="preprocessor">#endif</span> <a name="l00103"></a>00103 <span class="preprocessor"></span> <a name="l00104"></a>00104 <span class="keyword">protected</span>: <a name="l00105"></a>00105 <a name="l00106"></a>00106 <span class="comment">// The ClientProxy constructor</span> <a name="l00107"></a>00107 <span class="comment">// @attention Potected, so it can only be instantiated by other clients</span> <a name="l00108"></a>00108 <span class="comment">//</span> <a name="l00109"></a>00109 <span class="comment">// @throw PlayerError Throws a PlayerError if unable to connect to the client</span> <a name="l00110"></a>00110 <a class="code" href="classPlayerCc_1_1ClientProxy.html" title="The client proxy base class.">ClientProxy</a>(<a class="code" href="classPlayerCc_1_1PlayerClient.html" title="The PlayerClient is used for communicating with the player server.">PlayerClient</a>* aPc, uint32_t aIndex); <a name="l00111"></a>00111 <a name="l00112"></a>00112 <span class="comment">// destructor will try to close access to the device</span> <a name="l00113"></a>00113 <span class="keyword">virtual</span> ~<a class="code" href="classPlayerCc_1_1ClientProxy.html" title="The client proxy base class.">ClientProxy</a>(); <a name="l00114"></a>00114 <a name="l00115"></a>00115 <span class="comment">// Subscribe to the proxy</span> <a name="l00116"></a>00116 <span class="comment">// This needs to be defined for every proxy.</span> <a name="l00117"></a>00117 <span class="comment">// @arg aIndex the index of the devce we want to connect to</span> <a name="l00118"></a>00118 <a name="l00119"></a>00119 <span class="comment">// I wish these could be pure virtual,</span> <a name="l00120"></a>00120 <span class="comment">// but they're used in the constructor/destructor</span> <a name="l00121"></a>00121 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Subscribe(uint32_t <span class="comment">/*aIndex*/</span>) {}; <a name="l00122"></a>00122 <a name="l00123"></a>00123 <span class="comment">// Unsubscribe from the proxy</span> <a name="l00124"></a>00124 <span class="comment">// This needs to be defined for every proxy.</span> <a name="l00125"></a>00125 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Unsubscribe() {}; <a name="l00126"></a>00126 <a name="l00127"></a>00127 <span class="comment">// The controlling client object.</span> <a name="l00128"></a>00128 <a class="code" href="classPlayerCc_1_1PlayerClient.html" title="The PlayerClient is used for communicating with the player server.">PlayerClient</a>* mPc; <a name="l00129"></a>00129 <a name="l00130"></a>00130 <span class="comment">// A reference to the C client</span> <a name="l00131"></a>00131 <a class="code" href="struct__playerc__client__t.html" title="Client object data.">playerc_client_t</a>* mClient; <a name="l00132"></a>00132 <a name="l00133"></a>00133 <span class="comment">// contains convenience information about the device</span> <a name="l00134"></a>00134 <a class="code" href="struct__playerc__device__t.html" title="Common device info.">playerc_device_t</a> *mInfo; <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="comment">// if set to true, the current data is "fresh"</span> <a name="l00137"></a>00137 <span class="keywordtype">bool</span> mFresh; <a name="l00138"></a>00138 <a name="l00139"></a>00139 <span class="comment">// @brief Get a variable from the client</span> <a name="l00140"></a>00140 <span class="comment">// All Get functions need to use this when accessing data from the</span> <a name="l00141"></a>00141 <span class="comment">// c library to make sure the data access is thread safe.</span> <a name="l00142"></a>00142 <span class="keyword">template</span><<span class="keyword">typename</span> T> <a name="l00143"></a>00143 T GetVar(<span class="keyword">const</span> T &aV)<span class="keyword"> const</span> <a name="l00144"></a>00144 <span class="keyword"> </span>{ <span class="comment">// these have to be defined here since they're templates</span> <a name="l00145"></a>00145 <a class="code" href="classboost_1_1mutex_1_1scoped__lock.html">scoped_lock_t</a> lock(mPc->mMutex); <a name="l00146"></a>00146 T v = aV; <a name="l00147"></a>00147 <span class="keywordflow">return</span> v; <a name="l00148"></a>00148 } <a name="l00149"></a>00149 <a name="l00150"></a>00150 <span class="comment">// @brief Get a variable from the client by reference</span> <a name="l00151"></a>00151 <span class="comment">// All Get functions need to use this when accessing data from the</span> <a name="l00152"></a>00152 <span class="comment">// c library to make sure the data access is thread safe. In this</span> <a name="l00153"></a>00153 <span class="comment">// case, a begin, end, and destination pointer must be given (similar</span> <a name="l00154"></a>00154 <span class="comment">// to C++ copy). It is up to the user to ensure there is memory</span> <a name="l00155"></a>00155 <span class="comment">// allocated at aDest.</span> <a name="l00156"></a>00156 <span class="keyword">template</span><<span class="keyword">typename</span> T> <a name="l00157"></a>00157 <span class="keywordtype">void</span> GetVarByRef(<span class="keyword">const</span> T aBegin, <span class="keyword">const</span> T aEnd, T aDest)<span class="keyword"> const</span> <a name="l00158"></a>00158 <span class="keyword"> </span>{ <span class="comment">// these have to be defined here since they're templates</span> <a name="l00159"></a>00159 <a class="code" href="classboost_1_1mutex_1_1scoped__lock.html">scoped_lock_t</a> lock(mPc->mMutex); <a name="l00160"></a>00160 std::copy(aBegin, aEnd, aDest); <a name="l00161"></a>00161 } <a name="l00162"></a>00162 <a name="l00163"></a>00163 <span class="keyword">private</span>: <a name="l00164"></a>00164 <a name="l00165"></a>00165 <span class="comment">// The last time that data was read by this client in [s].</span> <a name="l00166"></a>00166 <span class="keywordtype">double</span> mLastTime; <a name="l00167"></a>00167 <a name="l00168"></a>00168 <span class="comment">// A boost::signal which is used for our callbacks.</span> <a name="l00169"></a>00169 <span class="comment">// The signal will normally be of a type such as:</span> <a name="l00170"></a>00170 <span class="comment">// - boost::signal<void ()></span> <a name="l00171"></a>00171 <span class="comment">// - boost::signal<void (T)></span> <a name="l00172"></a>00172 <span class="comment">// where T can be any type.</span> <a name="l00173"></a>00173 <span class="comment">//</span> <a name="l00174"></a>00174 <span class="comment">// @attention we currently only use signals that return void because we</span> <a name="l00175"></a>00175 <span class="comment">// don't have checks to make sure a signal is registered. If an empty</span> <a name="l00176"></a>00176 <span class="comment">// signal is called:</span> <a name="l00177"></a>00177 <span class="comment">//</span> <a name="l00178"></a>00178 <span class="comment">// @attention "Calling the function call operator may invoke undefined</span> <a name="l00179"></a>00179 <span class="comment">// behavior if no slots are connected to the signal, depending on the</span> <a name="l00180"></a>00180 <span class="comment">// combiner used. The default combiner is well-defined for zero slots when</span> <a name="l00181"></a>00181 <span class="comment">// the return type is void but is undefined when the return type is any</span> <a name="l00182"></a>00182 <span class="comment">// other type (because there is no way to synthesize a return value)."</span> <a name="l00183"></a>00183 <span class="comment">//</span> <a name="l00184"></a>00184 read_signal_t mReadSignal; <a name="l00185"></a>00185 <a name="l00186"></a>00186 <span class="comment">// Outputs the signal if there is new data</span> <a name="l00187"></a>00187 <span class="keywordtype">void</span> ReadSignal(); <a name="l00188"></a>00188 <a name="l00189"></a>00189 <span class="keyword">public</span>: <a name="l00190"></a>00190 <a name="l00192"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#a8edcdebde9527ca71d11890ccfe30e2c">00192</a> <span class="keywordtype">bool</span> <a class="code" href="classPlayerCc_1_1ClientProxy.html#a8edcdebde9527ca71d11890ccfe30e2c" title="Returns true if we have received any data from the device.">IsValid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0!=GetVar(mInfo->datatime); }; <a name="l00193"></a>00193 <a name="l00197"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#a8e4cc50741acf3dcb435a45c56173821">00197</a> <span class="keywordtype">bool</span> <a class="code" href="classPlayerCc_1_1ClientProxy.html#a8e4cc50741acf3dcb435a45c56173821" title="Fresh is set to true on each new read.">IsFresh</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> GetVar(mFresh); }; <a name="l00198"></a>00198 <a name="l00200"></a>00200 <span class="keywordtype">void</span> NotFresh(); <a name="l00201"></a>00201 <a name="l00204"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#a4057929568e8d25843119f76b01ab48d">00204</a> std::string <a class="code" href="classPlayerCc_1_1ClientProxy.html#a4057929568e8d25843119f76b01ab48d" title="Returns the driver name.">GetDriverName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mInfo->drivername; }; <a name="l00205"></a>00205 <a name="l00207"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#ae5fc04494560ddc7b14678d1d79916b5">00207</a> <span class="keywordtype">double</span> <a class="code" href="classPlayerCc_1_1ClientProxy.html#ae5fc04494560ddc7b14678d1d79916b5" title="Returns the received timestamp [s].">GetDataTime</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> GetVar(mInfo->datatime); }; <a name="l00208"></a>00208 <a name="l00210"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#a79312c4542f58611fb7725d84b20c737">00210</a> <span class="keywordtype">double</span> GetElapsedTime()<span class="keyword"> const</span> <a name="l00211"></a>00211 <span class="keyword"> </span>{ <span class="keywordflow">return</span> GetVar(mInfo->datatime) - GetVar(mInfo->lasttime); }; <a name="l00212"></a>00212 <a name="l00214"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#ae45a48e238dad87609b141bb97789b68">00214</a> <a class="code" href="classPlayerCc_1_1PlayerClient.html" title="The PlayerClient is used for communicating with the player server.">PlayerClient</a> * <a class="code" href="classPlayerCc_1_1ClientProxy.html#ae45a48e238dad87609b141bb97789b68" title="Returns a pointer to the Player Client.">GetPlayerClient</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mPc;} <a name="l00216"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#ac00ee4a1087c568c5f99ebb8e148f451">00216</a> uint32_t <a class="code" href="classPlayerCc_1_1ClientProxy.html#ac00ee4a1087c568c5f99ebb8e148f451" title="Returns device index.">GetIndex</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> GetVar(mInfo->addr.index); }; <a name="l00217"></a>00217 <a name="l00219"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#a2992e2d8b7a5572b8ce33a59942307ad">00219</a> uint32_t <a class="code" href="classPlayerCc_1_1ClientProxy.html#a2992e2d8b7a5572b8ce33a59942307ad" title="Returns device interface.">GetInterface</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> GetVar(mInfo->addr.interf); }; <a name="l00220"></a>00220 <a name="l00222"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#a5ad4831f9aa452bf04507d807f365730">00222</a> std::string GetInterfaceStr()<span class="keyword"> const</span> <a name="l00223"></a>00223 <span class="keyword"> </span>{ <span class="keywordflow">return</span> interf_to_str(GetVar(mInfo->addr.interf)); }; <a name="l00224"></a>00224 <a name="l00238"></a>00238 <span class="keywordtype">void</span> SetReplaceRule(<span class="keywordtype">bool</span> aReplace, <a name="l00239"></a>00239 <span class="keywordtype">int</span> aType = -1, <a name="l00240"></a>00240 <span class="keywordtype">int</span> aSubtype = -1); <a name="l00241"></a>00241 <a name="l00246"></a>00246 <span class="keywordtype">int</span> HasCapability(uint32_t aType, uint32_t aSubtype); <a name="l00247"></a>00247 <a name="l00249"></a>00249 <span class="keywordtype">int</span> GetBoolProp(<span class="keywordtype">char</span> *aProperty, <span class="keywordtype">bool</span> *aValue); <a name="l00250"></a>00250 <a name="l00252"></a>00252 <span class="keywordtype">int</span> SetBoolProp(<span class="keywordtype">char</span> *aProperty, <span class="keywordtype">bool</span> aValue); <a name="l00253"></a>00253 <a name="l00255"></a>00255 <span class="keywordtype">int</span> GetIntProp(<span class="keywordtype">char</span> *aProperty, int32_t *aValue); <a name="l00256"></a>00256 <a name="l00258"></a>00258 <span class="keywordtype">int</span> SetIntProp(<span class="keywordtype">char</span> *aProperty, int32_t aValue); <a name="l00259"></a>00259 <a name="l00261"></a>00261 <span class="keywordtype">int</span> GetDblProp(<span class="keywordtype">char</span> *aProperty, <span class="keywordtype">double</span> *aValue); <a name="l00262"></a>00262 <a name="l00264"></a>00264 <span class="keywordtype">int</span> SetDblProp(<span class="keywordtype">char</span> *aProperty, <span class="keywordtype">double</span> aValue); <a name="l00265"></a>00265 <a name="l00267"></a>00267 <span class="keywordtype">int</span> GetStrProp(<span class="keywordtype">char</span> *aProperty, <span class="keywordtype">char</span> **aValue); <a name="l00268"></a>00268 <a name="l00270"></a>00270 <span class="keywordtype">int</span> SetStrProp(<span class="keywordtype">char</span> *aProperty, <span class="keywordtype">char</span> *aValue); <a name="l00271"></a>00271 <a name="l00274"></a>00274 <span class="keyword">template</span><<span class="keyword">typename</span> T> <a name="l00275"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#a8d2a82e31f62e3ca94cad558bd7ebcdd">00275</a> connection_t ConnectReadSignal(T aSubscriber) <a name="l00276"></a>00276 { <a name="l00277"></a>00277 <span class="preprocessor">#ifdef HAVE_BOOST_SIGNALS</span> <a name="l00278"></a>00278 <span class="preprocessor"></span> <a class="code" href="classboost_1_1mutex_1_1scoped__lock.html">scoped_lock_t</a> lock(mPc->mMutex); <a name="l00279"></a>00279 <span class="keywordflow">return</span> mReadSignal.connect(aSubscriber); <a name="l00280"></a>00280 <span class="preprocessor">#else</span> <a name="l00281"></a>00281 <span class="preprocessor"></span> <span class="keywordflow">return</span> -1; <a name="l00282"></a>00282 <span class="preprocessor">#endif</span> <a name="l00283"></a>00283 <span class="preprocessor"></span> } <a name="l00284"></a>00284 <a name="l00286"></a><a class="code" href="classPlayerCc_1_1ClientProxy.html#a8c7c63c32ae3c69f3469f71746580e7f">00286</a> <span class="keywordtype">void</span> DisconnectReadSignal(connection_t aSubscriber) <a name="l00287"></a>00287 { <a name="l00288"></a>00288 <span class="preprocessor">#ifdef HAVE_BOOST_SIGNALS</span> <a name="l00289"></a>00289 <span class="preprocessor"></span> <a class="code" href="classboost_1_1mutex_1_1scoped__lock.html">scoped_lock_t</a> lock(mPc->mMutex); <a name="l00290"></a>00290 aSubscriber.disconnect(); <a name="l00291"></a>00291 <span class="preprocessor">#else</span> <a name="l00292"></a>00292 <span class="preprocessor"></span> <span class="comment">// This line is here to prevent compiler warnings of "unused varaibles"</span> <a name="l00293"></a>00293 aSubscriber = aSubscriber; <a name="l00294"></a>00294 <span class="preprocessor">#endif</span> <a name="l00295"></a>00295 <span class="preprocessor"></span> } <a name="l00296"></a>00296 <a name="l00297"></a>00297 }; <a name="l00298"></a>00298 <a name="l00299"></a>00299 }<span class="comment">// namespace</span> <a name="l00300"></a>00300 <a name="l00301"></a>00301 <span class="preprocessor">#endif</span> </pre></div></div> </div> <!-- render the modification time of the source file --> <div class="timestamp"> <hr> <table style="width:100%;"> <tr> <td style="text-align:left;"> Last updated 12 September 2005 21:38:45 <!-- <td style="text-align:right;"> <a href="http://validator.w3.org/check/referer"><img style="vertical-align:middle;border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a> <a href="http://jigsaw.w3.org/css-validator/"> <img style="vertical-align:middle;border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> </a> --> </tr> </table> </div> </tr> </table> </BODY> </HTML>