Sophie

Sophie

distrib > Mageia > 3 > i586 > by-pkgid > 5c8601db6a43d9fadf5fb1ae4bea9d58 > files > 48

librlog5-devel-1.4-4.mga3.i586.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>rlog: rlog::RLogNode 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.5.0 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<div class="nav">
<b>rlog</b>::<a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a></div>
<h1>rlog::RLogNode Class Reference</h1><!-- doxytag: class="rlog::RLogNode" -->Core of publication system, forms activation network.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="RLogNode_8h-source.html">rlog/RLogNode.h</a>&gt;</code>
<p>
<p>Inheritance diagram for rlog::RLogNode:
<p><center><img src="classrlog_1_1RLogNode.png" usemap="#rlog::RLogNode_map" border="0" alt=""></center>
<map name="rlog::RLogNode_map">
<area href="classrlog_1_1FileNode.html" alt="rlog::FileNode" shape="rect" coords="0,56,122,80">
<area href="classrlog_1_1RLogChannel.html" alt="rlog::RLogChannel" shape="rect" coords="132,56,254,80">
<area href="classrlog_1_1RLogPublisher.html" alt="rlog::RLogPublisher" shape="rect" coords="264,56,386,80">
<area href="classrlog_1_1StdioNode.html" alt="rlog::StdioNode" shape="rect" coords="396,56,518,80">
<area href="classrlog_1_1SyslogNode.html" alt="rlog::SyslogNode" shape="rect" coords="528,56,650,80">
</map>
<a href="classrlog_1_1RLogNode-members.html">List of all members.</a><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="722e53a46692954a27efd348672e4b0a"></a><!-- doxytag: member="rlog::RLogNode::RLogNode" ref="722e53a46692954a27efd348672e4b0a" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrlog_1_1RLogNode.html#722e53a46692954a27efd348672e4b0a">RLogNode</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Instantiate an empty <a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a>. No subscribers or publishers.. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1458dfcb93892d1ef591e10439c24e68"></a><!-- doxytag: member="rlog::RLogNode::~RLogNode" ref="1458dfcb93892d1ef591e10439c24e68" args="()" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrlog_1_1RLogNode.html#1458dfcb93892d1ef591e10439c24e68">~RLogNode</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disconnects from any remaining subscribers and publishers. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="515553ff72299cc7cbc1d91f015d713e"></a><!-- doxytag: member="rlog::RLogNode::clear" ref="515553ff72299cc7cbc1d91f015d713e" args="()" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrlog_1_1RLogNode.html#515553ff72299cc7cbc1d91f015d713e">clear</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Force disconnection from any subscribers or publishers. <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="classrlog_1_1RLogNode.html#798da2f13a0d98a48c8ba454ca460b88">publish</a> (const <a class="el" href="structrlog_1_1RLogData.html">RLogData</a> &amp;data)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Publish data.  <a href="#798da2f13a0d98a48c8ba454ca460b88"></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="classrlog_1_1RLogNode.html#be5614bb3ba7e44011ac7481ca269f4c">addPublisher</a> (<a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Have this node subscribe to a new publisher.  <a href="#be5614bb3ba7e44011ac7481ca269f4c"></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="classrlog_1_1RLogNode.html#593ea69a6db72f218f63aedc97f55a8c">dropPublisher</a> (<a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *, bool callbacks=true)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Drop our subscription to a publisher.  <a href="#593ea69a6db72f218f63aedc97f55a8c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrlog_1_1RLogNode.html#8b0a5c1e96ccfda89f42394594acc04b">enabled</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns <em>true</em> if this node is active.  <a href="#8b0a5c1e96ccfda89f42394594acc04b"></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="classrlog_1_1RLogNode.html#028e1afe72b105dbeef49e6f2489979e">addSubscriber</a> (<a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a subscriber.  <a href="#028e1afe72b105dbeef49e6f2489979e"></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="classrlog_1_1RLogNode.html#9aaca53c6b92ce090baa8f7a9e9196fa">dropSubscriber</a> (<a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a subscriber.  <a href="#9aaca53c6b92ce090baa8f7a9e9196fa"></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="classrlog_1_1RLogNode.html#0666eb2417ed152d59fb8144c1990793">isInterested</a> (<a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *node, bool isInterested)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Change the state of one of our subscribers.  <a href="#0666eb2417ed152d59fb8144c1990793"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrlog_1_1RLogNode.html#356356b9eb9f668a5d7326cc10518f55">setEnabled</a> (bool newState)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">For derived classes to get notified of activation status change.  <a href="#356356b9eb9f668a5d7326cc10518f55"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5490712a73a5bc73bf510dd78e45338"></a><!-- doxytag: member="rlog::RLogNode::publishers" ref="a5490712a73a5bc73bf510dd78e45338" args="" -->
std::list&lt; <a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrlog_1_1RLogNode.html#a5490712a73a5bc73bf510dd78e45338">publishers</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">list of nodes we are subscribed to <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8d9bac7da03bb38254409a32f9adee1d"></a><!-- doxytag: member="rlog::RLogNode::subscribers" ref="8d9bac7da03bb38254409a32f9adee1d" args="" -->
std::list&lt; <a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrlog_1_1RLogNode.html#8d9bac7da03bb38254409a32f9adee1d">subscribers</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">list of nodes we publish to <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="72715972dd641d3ddafd99041185aee5"></a><!-- doxytag: member="rlog::RLogNode::interestList" ref="72715972dd641d3ddafd99041185aee5" args="" -->
std::list&lt; <a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrlog_1_1RLogNode.html#72715972dd641d3ddafd99041185aee5">interestList</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">list of subscribers that are interested in receiving publications.. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="26b82ae94fd651283db4176d0a69890d"></a><!-- doxytag: member="rlog::RLogNode::mutex" ref="26b82ae94fd651283db4176d0a69890d" args="" -->
<a class="el" href="classrlog_1_1Mutex.html">Mutex</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>mutex</b></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Core of publication system, forms activation network. 
<p>
<a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> formes the core of the publication system. It has two primary purposes :<ul>
<li>link publications with subscribers</li><li>transfer meta-data in the form or node activations</li></ul>
<p>
Both publishers (eg <a class="el" href="classrlog_1_1RLogPublisher.html">RLogPublisher</a>) and subscribers (eg <a class="el" href="classrlog_1_1StdioNode.html">StdioNode</a>) are derived from <a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a>, although <a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> can be used entirely unmodified.<p>
An <a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> contains a list of publishers which it is linked with. It also contains a list of subscribers which it is linked with. Publications always flow from publishers to subscribers, and activation information flows the opposite direction from subscribers to publishers.<p>
An <a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> by default acts as both a subscriber and publisher -- when it has been subscribed to another node and receives a publication it simply repeats the information to all of its subscribers.<p>
More specifically, it only publishes to subscribers who have also voiced an interest in receiving the publication. If a node has no subscribers which are also interested (or no subscribers at all), then it can be said to be dormant and it tells the publishers that it is subscribed to that it is no longer interested. This propogates all the way up to RLogPublishers which will disable the logging statement completely if there are no interested parties.<p>
<dl class="author" compact><dt><b>Author:</b></dt><dd>Valient Gough </dd></dl>

<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="798da2f13a0d98a48c8ba454ca460b88"></a><!-- doxytag: member="rlog::RLogNode::publish" ref="798da2f13a0d98a48c8ba454ca460b88" args="(const RLogData &amp;data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RLogNode::publish           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structrlog_1_1RLogData.html">RLogData</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>data</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Publish data. 
<p>
This iterates over the list of subscribers which have stated interest and sends them the data. 
<p>
Reimplemented in <a class="el" href="classrlog_1_1RLogChannel.html#b02534e508bec0d90cddd3c2ca2b12a7">rlog::RLogChannel</a>, <a class="el" href="classrlog_1_1StdioNode.html#ce329c8b9cf6c2308dc2678f5e941071">rlog::StdioNode</a>, and <a class="el" href="classrlog_1_1SyslogNode.html#f565cf6bacf5e2d41ad2bf3029178542">rlog::SyslogNode</a>.
</div>
</div><p>
<a class="anchor" name="be5614bb3ba7e44011ac7481ca269f4c"></a><!-- doxytag: member="rlog::RLogNode::addPublisher" ref="be5614bb3ba7e44011ac7481ca269f4c" args="(RLogNode *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RLogNode::addPublisher           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *&nbsp;</td>
          <td class="paramname"> <em>publisher</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Have this node subscribe to a new publisher. 
<p>
We become a subscriber of the publisher. The publisher's <a class="el" href="classrlog_1_1RLogNode.html#028e1afe72b105dbeef49e6f2489979e">addSubscriber()</a> function is called to complete the link.<p>
If our node is active then we also tell the publisher that we want publications. 
</div>
</div><p>
<a class="anchor" name="593ea69a6db72f218f63aedc97f55a8c"></a><!-- doxytag: member="rlog::RLogNode::dropPublisher" ref="593ea69a6db72f218f63aedc97f55a8c" args="(RLogNode *, bool callbacks=true)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RLogNode::dropPublisher           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *&nbsp;</td>
          <td class="paramname"> <em>publisher</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>callback</em> = <code>true</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Drop our subscription to a publisher. 
<p>
A callback parameter is provided to help avoid loops in the code which may affect the thread locking code.<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>callback</em>&nbsp;</td><td>If True, then we call publisher-&gt;<a class="el" href="classrlog_1_1RLogNode.html#9aaca53c6b92ce090baa8f7a9e9196fa">dropSubscriber()</a> to make sure the publisher also drops us as a subscriber. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="8b0a5c1e96ccfda89f42394594acc04b"></a><!-- doxytag: member="rlog::RLogNode::enabled" ref="8b0a5c1e96ccfda89f42394594acc04b" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool RLogNode::enabled           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns <em>true</em> if this node is active. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><em>true</em> if we have one or more interested subscribers, otherwise false </dd></dl>

</div>
</div><p>
<a class="anchor" name="028e1afe72b105dbeef49e6f2489979e"></a><!-- doxytag: member="rlog::RLogNode::addSubscriber" ref="028e1afe72b105dbeef49e6f2489979e" args="(RLogNode *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RLogNode::addSubscriber           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *&nbsp;</td>
          <td class="paramname"> <em>subscriber</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add a subscriber. 
<p>
Normally a subscriber calls this for itself when it's <a class="el" href="classrlog_1_1RLogNode.html#be5614bb3ba7e44011ac7481ca269f4c">addPublisher()</a> method is called. 
</div>
</div><p>
<a class="anchor" name="9aaca53c6b92ce090baa8f7a9e9196fa"></a><!-- doxytag: member="rlog::RLogNode::dropSubscriber" ref="9aaca53c6b92ce090baa8f7a9e9196fa" args="(RLogNode *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RLogNode::dropSubscriber           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *&nbsp;</td>
          <td class="paramname"> <em>subscriber</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove a subscriber. 
<p>
Normally a subscriber calls this for itself when it's <a class="el" href="classrlog_1_1RLogNode.html#593ea69a6db72f218f63aedc97f55a8c">dropPublisher()</a> method is called.<p>
Note that the subscriber list is kept separate from the interest list. If the subscriber is active, then you must undo that by calling isInterested(subscriber, false) in addition to dropSubscriber 
</div>
</div><p>
<a class="anchor" name="0666eb2417ed152d59fb8144c1990793"></a><!-- doxytag: member="rlog::RLogNode::isInterested" ref="0666eb2417ed152d59fb8144c1990793" args="(RLogNode *node, bool isInterested)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RLogNode::isInterested           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classrlog_1_1RLogNode.html">RLogNode</a> *&nbsp;</td>
          <td class="paramname"> <em>node</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>interest</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Change the state of one of our subscribers. 
<p>
This allows a subscriber to say that it wants to be notified of publications or not. The <em>node</em> should already be registered as a subscriber.<p>
If we previously had no interested parties and now we do, then we need to notify the publishers in our publishers list that we are now interested.<p>
If we previously had interested parties and we remove the last one, then we can notify the publishers that we are no longer interested.. 
</div>
</div><p>
<a class="anchor" name="356356b9eb9f668a5d7326cc10518f55"></a><!-- doxytag: member="rlog::RLogNode::setEnabled" ref="356356b9eb9f668a5d7326cc10518f55" args="(bool newState)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RLogNode::setEnabled           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>newState</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
For derived classes to get notified of activation status change. 
<p>
This is called by <a class="el" href="classrlog_1_1RLogNode.html#0666eb2417ed152d59fb8144c1990793">isInterested()</a> when our state changes. If <em>true</em> is passed, then this node has become active. If <em>false</em> is passed, then this node has just become dormant. 
<p>
Reimplemented in <a class="el" href="classrlog_1_1RLogPublisher.html#9df30b60c4c8e4ca76e961c3c7470d2d">rlog::RLogPublisher</a>.
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="RLogNode_8h-source.html">RLogNode.h</a><li>RLogNode.cpp</ul>
<hr size="1"><address style="align: right;"><small>Generated on Mon Nov 20 22:57:45 2006 for rlog by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.0 </small></address>
</body>
</html>