<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Crystal Space 1.2.1: csArrayCmp< T, K > Class Template Reference (Crystal Space 1.2.1 Public API Reference)</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <table border="0" cellpadding="0" cellspacing="0" width="100%" class="head"> <tr height="59"> <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td> <td class="head"><h2>Public API Reference</h2></td> </tr> <tr height="11"> <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td> </tr> </table> <div class="content"> <!-- Generated by Doxygen 1.5.3 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="classes.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <li><a href="annotated.html"><span>Class List</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> <h1>csArrayCmp< T, K > Class Template Reference<br> <small> [<a class="el" href="group__util__containers.html">Containers</a>]</small> </h1><!-- doxytag: class="csArrayCmp" -->A functor template which encapsulates a key and a comparison function for use with key-related csArray<> searching methods, such as FindKey() and FindSortedKey(). <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="csutil_2array_8h-source.html">csutil/array.h</a>></code> <p> Inherited by csUserRenderBufferManager::UserBufArrayCmp. <p> <p> <a href="classcsArrayCmp-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 Types</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="classcsArrayCmp.html#74fd8dcc6e26e46c720646cb8f4ad033">CF</a> )(T const &, K const &)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Type of the comparison function which compares a key against an element contained in a csArray<>. <a href="#74fd8dcc6e26e46c720646cb8f4ad033"></a><br></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classcsArrayCmp.html#ad5c91353a569566cfcdccd1aa40a2a7">csArrayCmp</a> (<a class="el" href="classcsArrayCmp.html">csArrayCmp</a> const &o)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Construct a functor from another functor. <a href="#ad5c91353a569566cfcdccd1aa40a2a7"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classcsArrayCmp.html#69e1b40e4b6388d49e2f7982e64451c7">csArrayCmp</a> (K const &k, <a class="el" href="classcsArrayCmp.html#74fd8dcc6e26e46c720646cb8f4ad033">CF</a> c=DefaultCompare)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Construct a functor from a search key and a comparison function. <a href="#69e1b40e4b6388d49e2f7982e64451c7"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classcsArrayCmp.html#0bcd41e960d9a5f1e5ba82e5deccf175">operator CF</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the comparison function with which this functor was constructed. <a href="#0bcd41e960d9a5f1e5ba82e5deccf175"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classcsArrayCmp.html#0362c8177dd3ac9497bdec66aa62a4ba">operator K const &</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the key with which this functor was constructed. <a href="#0362c8177dd3ac9497bdec66aa62a4ba"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classcsArrayCmp.html#7cf2d8d19fe8fc9d1984687366861355">operator()</a> (T const &r) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Invoke the functor. <a href="#7cf2d8d19fe8fc9d1984687366861355"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classcsArrayCmp.html">csArrayCmp</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classcsArrayCmp.html#1946bcbb1e5fd2216ad4c4deb6e9d815">operator=</a> (<a class="el" href="classcsArrayCmp.html">csArrayCmp</a> const &o)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Assign another functor to this one. <a href="#1946bcbb1e5fd2216ad4c4deb6e9d815"></a><br></td></tr> <tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="classcsArrayCmp.html#25d4277adeb9223836151fcee75d642a">DefaultCompare</a> (T const &r, K const &k)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Compare two objects of the same type or different types (T and K). <a href="#25d4277adeb9223836151fcee75d642a"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> <h3>template<class T, class K><br> class csArrayCmp< T, K ></h3> A functor template which encapsulates a key and a comparison function for use with key-related csArray<> searching methods, such as FindKey() and FindSortedKey(). <p> Being a template instaniated upon two (possibly distinct) types, this allows the searching methods to perform type-safe searches even when the search key type differs from the contained element type. The supplied search function defines the relationship between the search key and the contained element. <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00053">53</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> <hr><h2>Member Typedef Documentation</h2> <a class="anchor" name="74fd8dcc6e26e46c720646cb8f4ad033"></a><!-- doxytag: member="csArrayCmp::CF" ref="74fd8dcc6e26e46c720646cb8f4ad033" args=")(T const &, K const &)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, class K> </div> <table class="memname"> <tr> <td class="memname">typedef int(* <a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K >::<a class="el" href="classcsArrayCmp.html#74fd8dcc6e26e46c720646cb8f4ad033">CF</a>)(T const &, K const &) </td> </tr> </table> </div> <div class="memdoc"> <p> Type of the comparison function which compares a key against an element contained in a csArray<>. <p> T is the type of the contained element. K is the type of the search key. <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00061">61</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> </div> </div><p> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="69e1b40e4b6388d49e2f7982e64451c7"></a><!-- doxytag: member="csArrayCmp::csArrayCmp" ref="69e1b40e4b6388d49e2f7982e64451c7" args="(K const &k, CF c=DefaultCompare)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, class K> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K >::<a class="el" href="classcsArrayCmp.html">csArrayCmp</a> </td> <td>(</td> <td class="paramtype">K const & </td> <td class="paramname"> <em>k</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classcsArrayCmp.html#74fd8dcc6e26e46c720646cb8f4ad033">CF</a> </td> <td class="paramname"> <em>c</em> = <code>DefaultCompare</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Construct a functor from a search key and a comparison function. <p> <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00063">63</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> </div> </div><p> <a class="anchor" name="ad5c91353a569566cfcdccd1aa40a2a7"></a><!-- doxytag: member="csArrayCmp::csArrayCmp" ref="ad5c91353a569566cfcdccd1aa40a2a7" args="(csArrayCmp const &o)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, class K> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K >::<a class="el" href="classcsArrayCmp.html">csArrayCmp</a> </td> <td>(</td> <td class="paramtype"><a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K > const & </td> <td class="paramname"> <em>o</em> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Construct a functor from another functor. <p> <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00065">65</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="25d4277adeb9223836151fcee75d642a"></a><!-- doxytag: member="csArrayCmp::DefaultCompare" ref="25d4277adeb9223836151fcee75d642a" args="(T const &r, K const &k)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, class K> </div> <table class="memname"> <tr> <td class="memname">static int <a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K >::DefaultCompare </td> <td>(</td> <td class="paramtype">T const & </td> <td class="paramname"> <em>r</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">K const & </td> <td class="paramname"> <em>k</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [inline, static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Compare two objects of the same type or different types (T and K). <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>r</em> </td><td>Reference to the element to which the key should be compared. </td></tr> <tr><td valign="top"></td><td valign="top"><em>k</em> </td><td>Reference to the key to which the element should be compared. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Zero if the key matches the element; less-than-zero if the element is less than the key; greater-than-zero if the element is greater than the key. </dd></dl> <dl class="remark" compact><dt><b>Remarks:</b></dt><dd>Assumes the presence of T::operator<(K) and K::operator<(T). Default comparison function if client does not supply one. </dd></dl> <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00092">92</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> </div> </div><p> <a class="anchor" name="0bcd41e960d9a5f1e5ba82e5deccf175"></a><!-- doxytag: member="csArrayCmp::operator CF" ref="0bcd41e960d9a5f1e5ba82e5deccf175" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, class K> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K >::operator <a class="el" href="classcsArrayCmp.html#74fd8dcc6e26e46c720646cb8f4ad033">CF</a> </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the comparison function with which this functor was constructed. <p> <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00079">79</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> </div> </div><p> <a class="anchor" name="0362c8177dd3ac9497bdec66aa62a4ba"></a><!-- doxytag: member="csArrayCmp::operator K const &" ref="0362c8177dd3ac9497bdec66aa62a4ba" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, class K> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K >::operator K const & </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the key with which this functor was constructed. <p> <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00081">81</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> </div> </div><p> <a class="anchor" name="7cf2d8d19fe8fc9d1984687366861355"></a><!-- doxytag: member="csArrayCmp::operator()" ref="7cf2d8d19fe8fc9d1984687366861355" args="(T const &r) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, class K> </div> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K >::operator() </td> <td>(</td> <td class="paramtype">T const & </td> <td class="paramname"> <em>r</em> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Invoke the functor. <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>r</em> </td><td>Reference to the element to which the stored key should be compared. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Zero if the key matches the element; less-than-zero if the element is less than the key; greater-than-zero if the element is greater than the key. </dd></dl> <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00077">77</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> </div> </div><p> <a class="anchor" name="1946bcbb1e5fd2216ad4c4deb6e9d815"></a><!-- doxytag: member="csArrayCmp::operator=" ref="1946bcbb1e5fd2216ad4c4deb6e9d815" args="(csArrayCmp const &o)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, class K> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classcsArrayCmp.html">csArrayCmp</a>& <a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K >::operator= </td> <td>(</td> <td class="paramtype"><a class="el" href="classcsArrayCmp.html">csArrayCmp</a>< T, K > const & </td> <td class="paramname"> <em>o</em> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Assign another functor to this one. <p> <p>Definition at line <a class="el" href="csutil_2array_8h-source.html#l00067">67</a> of file <a class="el" href="csutil_2array_8h-source.html">array.h</a>.</p> </div> </div><p> <hr>The documentation for this class was generated from the following file:<ul> <li>csutil/<a class="el" href="csutil_2array_8h-source.html">array.h</a></ul> <hr size="1"><address><small>Generated for Crystal Space 1.2.1 by <a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 </small></address> </div></body> </html>