Files
pip/doc/html/class_p_i_collection.html

195 lines
14 KiB
HTML

<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PIP: PICollection Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">PIP
&#160;<span id="projectnumber">1.0.0_rc3</span>
</div>
<div id="projectbrief">Platform-Independent Primitives</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_p_i_collection.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#related">Related Functions</a> &#124;
<a href="class_p_i_collection-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">PICollection Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Interface to discover element groups.
<a href="class_p_i_collection.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a84d0050eaeb3187ed61a46ac31aa812f"><td class="memItemLeft" align="right" valign="top"><a id="a84d0050eaeb3187ed61a46ac31aa812f"></a>
static <a class="el" href="class_p_i_string_list.html">PIStringList</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_collection.html#a84d0050eaeb3187ed61a46ac31aa812f">groups</a> ()</td></tr>
<tr class="memdesc:a84d0050eaeb3187ed61a46ac31aa812f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns all existing groups by their names. <br /></td></tr>
<tr class="separator:a84d0050eaeb3187ed61a46ac31aa812f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8f8eb883104f57c4fd7a9937a8821d1"><td class="memItemLeft" align="right" valign="top"><a id="ad8f8eb883104f57c4fd7a9937a8821d1"></a>
static <a class="el" href="class_p_i_vector.html">PIVector</a>&lt; const <a class="el" href="class_p_i_object.html">PIObject</a> *&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_collection.html#ad8f8eb883104f57c4fd7a9937a8821d1">groupElements</a> (const <a class="el" href="class_p_i_string.html">PIString</a> &amp;group)</td></tr>
<tr class="memdesc:ad8f8eb883104f57c4fd7a9937a8821d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns all elements of group "group". <br /></td></tr>
<tr class="separator:ad8f8eb883104f57c4fd7a9937a8821d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a>
Related Functions</h2></td></tr>
<tr><td class="ititle" colspan="2"><p>(Note that these are not member functions.) </p>
</td></tr>
<tr class="memitem:a450e8ac720c8b0f6223ad2bf42f83ae2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_collection.html#a450e8ac720c8b0f6223ad2bf42f83ae2">ADD_TO_COLLECTION</a>(group, object)</td></tr>
<tr class="memdesc:a450e8ac720c8b0f6223ad2bf42f83ae2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add existing element "object" in group with name "group". <a href="#a450e8ac720c8b0f6223ad2bf42f83ae2">More...</a><br /></td></tr>
<tr class="separator:a450e8ac720c8b0f6223ad2bf42f83ae2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78cc4937360f5e286cdd8baf403edfec"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_collection.html#a78cc4937360f5e286cdd8baf403edfec">ADD_NEW_TO_COLLECTION</a>(group, class)</td></tr>
<tr class="memdesc:a78cc4937360f5e286cdd8baf403edfec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add new element of class "class" in group with name "group". <a href="#a78cc4937360f5e286cdd8baf403edfec">More...</a><br /></td></tr>
<tr class="separator:a78cc4937360f5e286cdd8baf403edfec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Interface to discover element groups. </p>
<h1><a class="anchor" id="PICollection_sec0"></a>
Synopsis</h1>
<p>This class has only static functions so no need to create instance of the PICollection. This class provide macros to add some classes or existing objects to global collection and access to them from any place of the code. </p><div class="fragment"><div class="line"><span class="keyword">class </span>ElementA: <span class="keyword">public</span> <a class="code" href="class_p_i_object.html">PIObject</a> {</div><div class="line"> <a class="code" href="piobject_8h.html#affa62b02040517a34b3f173d804e487f">PIOBJECT</a>(ElementA)</div><div class="line"> <span class="comment">// ...</span></div><div class="line">};</div><div class="line"><a class="code" href="class_p_i_collection.html#a78cc4937360f5e286cdd8baf403edfec">ADD_NEW_TO_COLLECTION</a>(ab_group, ElementA)</div><div class="line"></div><div class="line"><span class="keyword">class </span>ElementB: <span class="keyword">public</span> <a class="code" href="class_p_i_object.html">PIObject</a> {</div><div class="line"> <a class="code" href="piobject_8h.html#affa62b02040517a34b3f173d804e487f">PIOBJECT</a>(ElementB)</div><div class="line"> <span class="comment">// ...</span></div><div class="line">};</div><div class="line"><a class="code" href="class_p_i_collection.html#a78cc4937360f5e286cdd8baf403edfec">ADD_NEW_TO_COLLECTION</a>(ab_group, ElementB)</div><div class="line"></div><div class="line"><span class="keyword">class </span>ElementC: <span class="keyword">public</span> <a class="code" href="class_p_i_object.html">PIObject</a> {</div><div class="line"> <a class="code" href="piobject_8h.html#affa62b02040517a34b3f173d804e487f">PIOBJECT</a>(ElementC)</div><div class="line"> <span class="comment">// ...</span></div><div class="line">};</div><div class="line"><a class="code" href="class_p_i_collection.html#a78cc4937360f5e286cdd8baf403edfec">ADD_NEW_TO_COLLECTION</a>(c_group, ElementC)</div><div class="line"></div><div class="line"><span class="keyword">class </span>ElementD: <span class="keyword">public</span> <a class="code" href="class_p_i_object.html">PIObject</a> {</div><div class="line"> <a class="code" href="piobject_8h.html#affa62b02040517a34b3f173d804e487f">PIOBJECT</a>(ElementD)</div><div class="line"> <span class="comment">// ...</span></div><div class="line">};</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> ElementD * el_d = <span class="keyword">new</span> ElementD();</div><div class="line"> <a class="code" href="class_p_i_collection.html#a450e8ac720c8b0f6223ad2bf42f83ae2">ADD_TO_COLLECTION</a>(ab_group, el_d)</div><div class="line"> </div><div class="line"> <a class="code" href="class_p_i_string_list.html">PIStringList</a> gl = <a class="code" href="class_p_i_collection.html#a84d0050eaeb3187ed61a46ac31aa812f">PICollection::groups</a>();</div><div class="line"> <a class="code" href="picout_8h.html#ad21862cbba89aead064fbef4c825030e">piCout</a> &lt;&lt; gl; <span class="comment">// {&quot;ab_group&quot;, &quot;c_group&quot;}</span></div><div class="line"> <a class="code" href="picontainers_8h.html#a807914d038e5a193d2e36b4b82b6df96">piForeachC</a> (<a class="code" href="class_p_i_string.html">PIString</a> g, gl) {</div><div class="line"> <a class="code" href="class_p_i_vector.html">PIVector&lt;const PIObject * &gt;</a> go = <a class="code" href="class_p_i_collection.html#ad8f8eb883104f57c4fd7a9937a8821d1">PICollection::groupElements</a>(g);</div><div class="line"> <a class="code" href="picout_8h.html#ad21862cbba89aead064fbef4c825030e">piCout</a> &lt;&lt; <span class="stringliteral">&quot;group&quot;</span> &lt;&lt; g &lt;&lt; <span class="stringliteral">&quot;:&quot;</span>;</div><div class="line"> <a class="code" href="picontainers_8h.html#a807914d038e5a193d2e36b4b82b6df96">piForeachC</a> (<a class="code" href="class_p_i_object.html">PIObject</a> * o, go)</div><div class="line"> <a class="code" href="picout_8h.html#ad21862cbba89aead064fbef4c825030e">piCout</a> &lt;&lt; <a class="code" href="namespace_p_i_cout_manipulators.html#a66678520ac7701c016e3e90e17a7dfa2a9d183ab2eef93987077269cad1047bcb">Tab</a> &lt;&lt; o-&gt;className();</div><div class="line"> }</div><div class="line"> </div><div class="line"> <span class="comment">/*</span></div><div class="line"><span class="comment"> group ab_group :</span></div><div class="line"><span class="comment"> ElementA</span></div><div class="line"><span class="comment"> ElementB</span></div><div class="line"><span class="comment"> ElementD</span></div><div class="line"><span class="comment"> group c_group :</span></div><div class="line"><span class="comment"> ElementC</span></div><div class="line"><span class="comment"> */</span></div><div class="line">};</div></div><!-- fragment --></div><h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="a450e8ac720c8b0f6223ad2bf42f83ae2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a450e8ac720c8b0f6223ad2bf42f83ae2">&#9670;&nbsp;</a></span>ADD_TO_COLLECTION</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">#define ADD_TO_COLLECTION</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">group, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">object&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Add existing element "object" in group with name "group". </p>
<p>If there is no group with name "group" it will be created. Only one element of the class "object" can be in group "group". If this is already exists nothing be happens. <br />
"object" should to be pointer to object based on <a class="el" href="class_p_i_object.html" title="This is base class for any classes which use events -&gt; handlers mechanism. ">PIObject</a>. </p>
</div>
</div>
<a id="a78cc4937360f5e286cdd8baf403edfec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78cc4937360f5e286cdd8baf403edfec">&#9670;&nbsp;</a></span>ADD_NEW_TO_COLLECTION</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">#define ADD_NEW_TO_COLLECTION</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">group, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">class&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Add new element of class "class" in group with name "group". </p>
<p>If there is no group with name "group" it will be created. Only one element of the class "class" can be in group "group". If this is already exists nothing be happens. <br />
"class" should to be name of the any class based on <a class="el" href="class_p_i_object.html" title="This is base class for any classes which use events -&gt; handlers mechanism. ">PIObject</a>. </p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="class_p_i_collection.html">PICollection</a></li>
<li class="footer">Generated on Tue May 23 2017 11:20:44 for PIP by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>