Click here to Skip to main content
15,894,343 members
Articles / Programming Languages / C++

RCF - Interprocess Communication for C++

Rate me:
Please Sign up or sign in to vote.
4.94/5 (147 votes)
25 Oct 2011CPOL20 min read 4.6M   8.4K   331  
A server/client IPC framework, using the C++ preprocessor as an IDL compiler.
<!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>RCF: RCF::Filter Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.5 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li id="current"><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><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="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
  </ul></div>
<div class="nav">
<b>RCF</b>::<a class="el" href="class_r_c_f_1_1_filter.html">Filter</a></div>
<h1>RCF::Filter Class Reference</h1><!-- doxytag: class="RCF::Filter" --><code>#include &lt;<a class="el" href="_async_filter_8hpp-source.html">AsyncFilter.hpp</a>&gt;</code>
<p>
<p>Inheritance diagram for RCF::Filter:
<p><center><img src="class_r_c_f_1_1_filter.png" usemap="#RCF::Filter_map" border="0" alt=""></center>
<map name="RCF::Filter_map">
<area href="class_r_c_f_1_1_identity_filter.html" alt="RCF::IdentityFilter" shape="rect" coords="0,56,181,80">
<area href="class_r_c_f_1_1_open_ssl_encryption_filter.html" alt="RCF::OpenSslEncryptionFilter" shape="rect" coords="0,112,181,136">
</map>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Interface for synchronous/asynchronous communications filters. 
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6dc360b49d2a90f44ebf2cf77e642667"></a><!-- doxytag: member="RCF::Filter::~Filter" ref="6dc360b49d2a90f44ebf2cf77e642667" args="()" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#6dc360b49d2a90f44ebf2cf77e642667">~Filter</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Virtual destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#efa405b0304ef6d72ec6d3d986a25017">read</a> (char *buffer, std::size_t bufferLen)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads data from the filter.  <a href="#efa405b0304ef6d72ec6d3d986a25017"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#bca6c0f6992adf286552a4180e41d807">write</a> (const char *buffer, std::size_t bufferLen)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes data to the filter.  <a href="#bca6c0f6992adf286552a4180e41d807"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#ec2b2243e2affcbe5b3323a1c14cb64a">onReadWriteCompleted</a> (std::size_t bytesTransferred, int error)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Callback, generally invoked by the next filter downstream in a filter chain, upon completion of a read or write request.  <a href="#ec2b2243e2affcbe5b3323a1c14cb64a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="class_r_c_f_1_1_filter_description.html">FilterDescription</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#97a097a8fa8e2d39c56ce78097b167b0">getFilterDescription</a> () const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Provides a runtime description of the filter.  <a href="#97a097a8fa8e2d39c56ce78097b167b0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0094f45433aa38bb952b1fa5bc8f9798"></a><!-- doxytag: member="RCF::Filter::setReadFunction" ref="0094f45433aa38bb952b1fa5bc8f9798" args="(ReadFunction readFunction)=0" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#0094f45433aa38bb952b1fa5bc8f9798">setReadFunction</a> (ReadFunction readFunction)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the downstream read function. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9244267c8cc589a725833ea1d2e6e842"></a><!-- doxytag: member="RCF::Filter::setWriteFunction" ref="9244267c8cc589a725833ea1d2e6e842" args="(WriteFunction writeFunction)=0" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#9244267c8cc589a725833ea1d2e6e842">setWriteFunction</a> (WriteFunction writeFunction)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the downstream write function. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0527804920150b2d06d4dce689a4a301"></a><!-- doxytag: member="RCF::Filter::setReadWriteCompletionCallback" ref="0527804920150b2d06d4dce689a4a301" args="(ReadWriteCompletionCallback readWriteCompletionCallback)=0" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#0527804920150b2d06d4dce689a4a301">setReadWriteCompletionCallback</a> (ReadWriteCompletionCallback readWriteCompletionCallback)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the upstream read/write completion callback. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9f5832565681a5ae451801fb651e3b80"></a><!-- doxytag: member="RCF::Filter::getReadFunction" ref="9f5832565681a5ae451801fb651e3b80" args="()=0" -->
virtual ReadFunction&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#9f5832565681a5ae451801fb651e3b80">getReadFunction</a> ()=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets a functor wrapping the filters <a class="el" href="class_r_c_f_1_1_filter.html#efa405b0304ef6d72ec6d3d986a25017">read()</a> function. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3d792d71825cf385feb4cfc4e18fc827"></a><!-- doxytag: member="RCF::Filter::getWriteFunction" ref="3d792d71825cf385feb4cfc4e18fc827" args="()=0" -->
virtual WriteFunction&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#3d792d71825cf385feb4cfc4e18fc827">getWriteFunction</a> ()=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets a functor wrapping the filters <a class="el" href="class_r_c_f_1_1_filter.html#bca6c0f6992adf286552a4180e41d807">write()</a> function. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="30b81b2c6230698ea0b71ece93c023e5"></a><!-- doxytag: member="RCF::Filter::getReadWriteCompletionCallback" ref="30b81b2c6230698ea0b71ece93c023e5" args="()=0" -->
virtual ReadWriteCompletionCallback&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_r_c_f_1_1_filter.html#30b81b2c6230698ea0b71ece93c023e5">getReadWriteCompletionCallback</a> ()=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets a functor wrapping the filters read/write completion callback. <br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="97a097a8fa8e2d39c56ce78097b167b0"></a><!-- doxytag: member="RCF::Filter::getFilterDescription" ref="97a097a8fa8e2d39c56ce78097b167b0" args="() const =0" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual <a class="el" href="class_r_c_f_1_1_filter_description.html">FilterDescription</a> RCF::Filter::getFilterDescription           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [pure virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Provides a runtime description of the filter. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd><a class="el" href="class_r_c_f_1_1_filter_description.html">FilterDescription</a> structure. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ec2b2243e2affcbe5b3323a1c14cb64a"></a><!-- doxytag: member="RCF::Filter::onReadWriteCompleted" ref="ec2b2243e2affcbe5b3323a1c14cb64a" args="(std::size_t bytesTransferred, int error)=0" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual void RCF::Filter::onReadWriteCompleted           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">std::size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>bytesTransferred</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>error</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [pure virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Callback, generally invoked by the next filter downstream in a filter chain, upon completion of a read or write request. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>bytesTransferred</em>&nbsp;</td><td>Count of bytes transferred. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>error</em>&nbsp;</td><td>-1 for error, otherwise 0. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="efa405b0304ef6d72ec6d3d986a25017"></a><!-- doxytag: member="RCF::Filter::read" ref="efa405b0304ef6d72ec6d3d986a25017" args="(char *buffer, std::size_t bufferLen)=0" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual void RCF::Filter::read           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">char *&nbsp;</td>
          <td class="mdname" nowrap> <em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>std::size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>bufferLen</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [pure virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Reads data from the filter. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>Buffer to transfer data to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>bufferLen</em>&nbsp;</td><td>Maximum count of bytes to transfer. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="bca6c0f6992adf286552a4180e41d807"></a><!-- doxytag: member="RCF::Filter::write" ref="bca6c0f6992adf286552a4180e41d807" args="(const char *buffer, std::size_t bufferLen)=0" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual void RCF::Filter::write           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>std::size_t&nbsp;</td>
          <td class="mdname" nowrap> <em>bufferLen</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [pure virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Writes data to the filter. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>Buffer from which to transfer data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>bufferLen</em>&nbsp;</td><td>Maximum count of bytes to transfer. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_async_filter_8hpp-source.html">AsyncFilter.hpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Sep 19 19:02:37 2006 for RCF 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>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Australia Australia
Software developer, from Sweden and now living in Canberra, Australia, working on distributed C++ applications. When he is not programming, Jarl enjoys skiing and playing table tennis. He derives immense satisfaction from referring to himself in third person.

Comments and Discussions