<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Soprano: Soprano::Client::TcpClient Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <script type="text/javascript"> function hasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); } function addClass(ele,cls) { if (!this.hasClass(ele,cls)) ele.className += " "+cls; } function removeClass(ele,cls) { if (hasClass(ele,cls)) { var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)'); ele.className=ele.className.replace(reg,' '); } } function toggleVisibility(linkObj) { var base = linkObj.getAttribute('id'); var summary = document.getElementById(base + '-summary'); var content = document.getElementById(base + '-content'); var trigger = document.getElementById(base + '-trigger'); if ( hasClass(linkObj,'closed') ) { summary.style.display = 'none'; content.style.display = 'block'; trigger.src = 'open.png'; removeClass(linkObj,'closed'); addClass(linkObj,'opened'); } else if ( hasClass(linkObj,'opened') ) { summary.style.display = 'block'; content.style.display = 'none'; trigger.src = 'closed.png'; removeClass(linkObj,'opened'); addClass(linkObj,'closed'); } return false; } </script> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"> <ul> <li><a class="el" href="namespaceSoprano.html">Soprano</a> </li> <li><a class="el" href="namespaceSoprano_1_1Client.html">Client</a> </li> <li><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html">Soprano::Client::TcpClient</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-static-attribs">Static Public Attributes</a> </div> <div class="headertitle"> <h1>Soprano::Client::TcpClient Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="Soprano::Client::TcpClient" --><!-- doxytag: inherits="QObject,Soprano::Error::ErrorCache" --> <p>Creates a connection to the Soprano server through a TCP connection. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="tcpclient_8h_source.html">Soprano/Client/TcpClient</a>></code></p> <div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"> <img id="dynsection-0-trigger" src="closed.png"/> Inheritance diagram for Soprano::Client::TcpClient:</div> <div id="dynsection-0-summary" class="dynsummary" style="display:block;"> </div> <div id="dynsection-0-content" class="dyncontent" style="display:none;"> <div class="center"><img src="classSoprano_1_1Client_1_1TcpClient__inherit__graph.png" border="0" usemap="#Soprano_1_1Client_1_1TcpClient_inherit__map" alt="Inheritance graph"/></div> <map name="Soprano_1_1Client_1_1TcpClient_inherit__map" id="Soprano_1_1Client_1_1TcpClient_inherit__map"> <area shape="rect" id="node2" href="qobject.html" title="QObject" alt="" coords="5,5,75,35"/><area shape="rect" id="node4" href="classSoprano_1_1Error_1_1ErrorCache.html" title="Core class of Soprano's exception system." alt="" coords="99,5,277,35"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classSoprano_1_1Client_1_1TcpClient-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#ab9fd1b5e709224ac61da1ddcedf802b5">TcpClient</a> (<a class="elRef" href="qobject.html">QObject</a> *<a class="elRef" href="qobject.html#parent">parent</a>=0)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#ab8e75187b5a075761d7c6a55b7d2fdcb">~TcpClient</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#abb5ee4f5c96edf2b2c83170e837ebfb2">connect</a> (const <a class="elRef" href="qhostaddress.html">QHostAddress</a> &address=QHostAddress::LocalHost, int port=<a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#acfed0d5ca6b0eafa590d9caa83db0f18">DEFAULT_PORT</a>)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#aa3ac6a62eb84523cd28ff2b30eb569d7">isConnected</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#aed70203b97f46015f5296221eaa8c9e5">disconnect</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classSoprano_1_1Model.html">Model</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#a0498664dbf2cea552facebae9c6c0fb7">createModel</a> (const <a class="elRef" href="qstring.html">QString</a> &<a class="elRef" href="qobject.html#name">name</a>, const <a class="elRef" href="qlist.html">QList</a>< <a class="el" href="classSoprano_1_1BackendSetting.html">BackendSetting</a> > &settings=<a class="elRef" href="qlist.html">QList</a>< <a class="el" href="classSoprano_1_1BackendSetting.html">BackendSetting</a> >())</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#adda0281660f4e8ed03af8b4b9e47d02e">removeModel</a> (const <a class="elRef" href="qstring.html">QString</a> &<a class="elRef" href="qobject.html#name">name</a>)</td></tr> <tr><td colspan="2"><h2><a name="pub-static-attribs"></a> Static Public Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static const quint16 </td><td class="memItemRight" valign="bottom"><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#acfed0d5ca6b0eafa590d9caa83db0f18">DEFAULT_PORT</a></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Creates a connection to the Soprano server through a TCP connection. </p> <p>The Soprano server supports more than one way of communication. Beside D-Bus (see <a class="el" href="classSoprano_1_1Client_1_1DBusClient.html" title="Core class to handle a connection to a Soprano server through the DBus interface.">DBusClient</a>) and local socket communication (<a class="el" href="classSoprano_1_1Client_1_1LocalSocketClient.html" title="Creates a connection to the Soprano server through a local socket interface.">LocalSocketClient</a>) it can be contacted via TCP. For that to work the server has to be listening on some port (<a class="el" href="classSoprano_1_1Server_1_1ServerCore.html#ac4f1d3911ee454430e754d1cda058fe5">Server::ServerCore::listen</a>).</p> <dl class="warning"><dt><b>Warning:</b></dt><dd>The <a class="el" href="classSoprano_1_1Client_1_1TcpClient.html" title="Creates a connection to the Soprano server through a TCP connection.">TcpClient</a> does not support signals. Thus, the models created by it will not emit signals such as <a class="el" href="classSoprano_1_1Model.html#a3e2595166caac3621fd4268e46049adf">Model::statementAdded</a>. Also no permission handling or any kind of security is implemented at the moment. Thus, if a server is running and is listening on a port, it is open to connections from any client on any computer in the network.</dd></dl> <dl class="author"><dt><b>Author:</b></dt><dd>Sebastian Trueg <<a href="mailto:trueg@kde.org">trueg@kde.org</a>> </dd></dl> <p>Definition at line <a class="el" href="tcpclient_8h_source.html#l00057">57</a> of file <a class="el" href="tcpclient_8h_source.html">tcpclient.h</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="ab9fd1b5e709224ac61da1ddcedf802b5"></a><!-- doxytag: member="Soprano::Client::TcpClient::TcpClient" ref="ab9fd1b5e709224ac61da1ddcedf802b5" args="(QObject *parent=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Soprano::Client::TcpClient::TcpClient </td> <td>(</td> <td class="paramtype"><a class="elRef" href="qobject.html">QObject</a> * </td> <td class="paramname"> <em>parent</em> = <code>0</code></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Create a new <a class="el" href="namespaceSoprano_1_1Client.html">Client</a> instance. </p> </div> </div> <a class="anchor" id="ab8e75187b5a075761d7c6a55b7d2fdcb"></a><!-- doxytag: member="Soprano::Client::TcpClient::~TcpClient" ref="ab8e75187b5a075761d7c6a55b7d2fdcb" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual Soprano::Client::TcpClient::~TcpClient </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Destructor. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="abb5ee4f5c96edf2b2c83170e837ebfb2"></a><!-- doxytag: member="Soprano::Client::TcpClient::connect" ref="abb5ee4f5c96edf2b2c83170e837ebfb2" args="(const QHostAddress &address=QHostAddress::LocalHost, int port=DEFAULT_PORT)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Soprano::Client::TcpClient::connect </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qhostaddress.html">QHostAddress</a> & </td> <td class="paramname"> <em>address</em> = <code>QHostAddress::LocalHost</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>port</em> = <code><a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#acfed0d5ca6b0eafa590d9caa83db0f18">DEFAULT_PORT</a></code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Tries to connect to the Soprano server.</p> <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> on success, <code>false</code> if an error occured. Check <a class="el" href="classSoprano_1_1Error_1_1ErrorCache.html#a3251b8052cdf932d59a523ca215d21c9">lastError()</a> for details. </dd></dl> </div> </div> <a class="anchor" id="aa3ac6a62eb84523cd28ff2b30eb569d7"></a><!-- doxytag: member="Soprano::Client::TcpClient::isConnected" ref="aa3ac6a62eb84523cd28ff2b30eb569d7" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Soprano::Client::TcpClient::isConnected </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Check if the client is connected to a server.</p> <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if this client is connected to a server, <code>false</code> otherwise. </dd></dl> </div> </div> <a class="anchor" id="aed70203b97f46015f5296221eaa8c9e5"></a><!-- doxytag: member="Soprano::Client::TcpClient::disconnect" ref="aed70203b97f46015f5296221eaa8c9e5" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Soprano::Client::TcpClient::disconnect </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Disconnect from the server. The created model instances are not deleted but remain useless; open iterators are closed. </p> </div> </div> <a class="anchor" id="a0498664dbf2cea552facebae9c6c0fb7"></a><!-- doxytag: member="Soprano::Client::TcpClient::createModel" ref="a0498664dbf2cea552facebae9c6c0fb7" args="(const QString &name, const QList< BackendSetting > &settings=QList< BackendSetting >())" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classSoprano_1_1Model.html">Model</a>* Soprano::Client::TcpClient::createModel </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"> <em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qlist.html">QList</a>< <a class="el" href="classSoprano_1_1BackendSetting.html">BackendSetting</a> > & </td> <td class="paramname"> <em>settings</em> = <code><a class="elRef" href="qlist.html">QList</a>< <a class="el" href="classSoprano_1_1BackendSetting.html">BackendSetting</a> >()</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates a new <a class="el" href="classSoprano_1_1Model.html" title="A Model is the central class in Soprano. It is a queryable collection of RDF quadruples, i.e statements.">Model</a> instance that wraps a server model. Client models are very light wrappers and creating them is very fast.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the model to access. </td></tr> <tr><td valign="top"></td><td valign="top"><em>settings</em> </td><td>The settings to send to the server for creating a new model. These settings may be ignored by the server if a model with that name has already been created.</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>A new <a class="el" href="classSoprano_1_1Model.html" title="A Model is the central class in Soprano. It is a queryable collection of RDF quadruples, i.e statements.">Model</a> instance wrapping the requested server model or 0 on error (check <a class="el" href="classSoprano_1_1Error_1_1ErrorCache.html#a3251b8052cdf932d59a523ca215d21c9">lastError()</a> for details.) </dd></dl> </div> </div> <a class="anchor" id="adda0281660f4e8ed03af8b4b9e47d02e"></a><!-- doxytag: member="Soprano::Client::TcpClient::removeModel" ref="adda0281660f4e8ed03af8b4b9e47d02e" args="(const QString &name)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Soprano::Client::TcpClient::removeModel </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"> <em>name</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Deletes a model including all its data.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the model to remove.</td></tr> </table> </dd> </dl> <dl class="warning"><dt><b>Warning:</b></dt><dd>Calling this method will remove all data physically. It can not be reverted. Use with care.</dd></dl> <dl class="since"><dt><b>Since:</b></dt><dd>2.1 </dd></dl> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="acfed0d5ca6b0eafa590d9caa83db0f18"></a><!-- doxytag: member="Soprano::Client::TcpClient::DEFAULT_PORT" ref="acfed0d5ca6b0eafa590d9caa83db0f18" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const quint16 <a class="el" href="classSoprano_1_1Client_1_1TcpClient.html#acfed0d5ca6b0eafa590d9caa83db0f18">Soprano::Client::TcpClient::DEFAULT_PORT</a><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>The default Soprano server connection port. </p> <p>Definition at line <a class="el" href="tcpclient_8h_source.html#l00075">75</a> of file <a class="el" href="tcpclient_8h_source.html">tcpclient.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>/builddir/build/BUILD/soprano-2.5.2/client/<a class="el" href="tcpclient_8h_source.html">tcpclient.h</a></li> </ul> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Oct 21 2010 for Soprano by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>