diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02348.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to 'docs/doxygen/nel/a02348.html')
-rw-r--r-- | docs/doxygen/nel/a02348.html | 320 |
1 files changed, 320 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02348.html b/docs/doxygen/nel/a02348.html new file mode 100644 index 00000000..176ad032 --- /dev/null +++ b/docs/doxygen/nel/a02348.html @@ -0,0 +1,320 @@ +<!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>NeL: NLMISC::CClassRegistry class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLMISC::CClassRegistry Class Reference</h1><code>#include <<a class="el" href="a05550.html">class_registry.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +The Class registry where we can instanciate <a class="el" href="a02540.html">IClassable</a> objects from their names. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2000 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05550.html#l00088">88</a> of file <a class="el" href="a05550.html">class_registry.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02348.html#NLMISC_1_1CClassRegistrye0">checkObject</a> (<a class="el" href="a02540.html">IClassable</a> *obj)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">check if the object has been correctly registered. Must be used for debug only, and Must compile with RTTI. <a href="#NLMISC_1_1CClassRegistrye0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02540.html">IClassable</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02348.html#NLMISC_1_1CClassRegistrye1">create</a> (const std::string &className) throw (ERegistry)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an object from his class name. <a href="#NLMISC_1_1CClassRegistrye1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02348.html#NLMISC_1_1CClassRegistrye2">registerClass</a> (const std::string &className, <a class="el" href="a02540.html">IClassable</a> *(*creator)(), const std::string &typeidCheck) throw (ERegistry)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Register your class for future Instanciation. <a href="#NLMISC_1_1CClassRegistrye2"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::hash_map< std::string,<br> + <a class="el" href="a02349.html">CClassNode</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02348.html#NLMISC_1_1CClassRegistryy0">TClassMap</a></td></tr> + +<tr><td colspan=2><br><h2>Static Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02348.html#NLMISC_1_1CClassRegistryh0">init</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Inits the ClassRegistry (especially RegistredClasses). <a href="#NLMISC_1_1CClassRegistryh0"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Static Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02348.html#NLMISC_1_1CClassRegistryy0">TClassMap</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02348.html#NLMISC_1_1CClassRegistryv0">RegistredClasses</a> = NULL</td></tr> + +</table> +<hr><h2>Member Typedef Documentation</h2> +<a class="anchor" name="NLMISC_1_1CClassRegistryy0" doxytag="NLMISC::CClassRegistry::TClassMap" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> typedef std::hash_map<std::string, <a class="el" href="a02349.html">CClassNode</a>> <a class="el" href="a02348.html#NLMISC_1_1CClassRegistryy0">NLMISC::CClassRegistry::TClassMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05550.html#l00108">108</a> of file <a class="el" href="a05550.html">class_registry.h</a>. +<p> +Referenced by <a class="el" href="a05549.html#l00043">init()</a>. </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1CClassRegistrye0" doxytag="NLMISC::CClassRegistry::checkObject" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CClassRegistry::checkObject </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02540.html">IClassable</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>obj</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +check if the object has been correctly registered. Must be used for debug only, and Must compile with RTTI. +<p> + +<p> +Definition at line <a class="el" href="a05549.html#l00091">91</a> of file <a class="el" href="a05549.html">class_registry.cpp</a>. +<p> +References <a class="el" href="a02540.html#NL3D_1_1ITrackKeyFramer_3_01CKeyVector_01_4a6">NLMISC::IClassable::getClassName()</a>, <a class="el" href="a05549.html#l00043">init()</a>, and <a class="el" href="a05549.html#l00039">RegistredClasses</a>. +<p> +<div class="fragment"><pre>00092 { +00093 <a class="code" href="a02348.html#NLMISC_1_1CClassRegistryh0">init</a>(); +00094 +00095 TClassMap::iterator it; +00096 it=<a class="code" href="a02348.html#NLMISC_1_1CClassRegistryv0">RegistredClasses</a>->find(obj->getClassName()); +00097 <span class="keywordflow">if</span>(it==<a class="code" href="a02348.html#NLMISC_1_1CClassRegistryv0">RegistredClasses</a>->end()) +00098 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00099 +00100 <span class="keywordflow">if</span>( it->second.TypeIdCheck != string(<span class="keyword">typeid</span>(*obj).name()) ) +00101 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00102 +00103 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00104 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CClassRegistrye1" doxytag="NLMISC::CClassRegistry::create" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02540.html">IClassable</a> * NLMISC::CClassRegistry::create </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname1" valign="top" nowrap> <em>className</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> throw (<a class="el" href="a03804.html">ERegistry</a>)<code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Create an object from his class name. +<p> + +<p> +Definition at line <a class="el" href="a05549.html#l00051">51</a> of file <a class="el" href="a05549.html">class_registry.cpp</a>. +<p> +References <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +<div class="fragment"><pre>00052 { +00053 <a class="code" href="a02348.html#NLMISC_1_1CClassRegistryh0">init</a>(); +00054 +00055 TClassMap::iterator it; +00056 +00057 it=<a class="code" href="a02348.html#NLMISC_1_1CClassRegistryv0">RegistredClasses</a>->find(className); +00058 +00059 <span class="keywordflow">if</span>(it==<a class="code" href="a02348.html#NLMISC_1_1CClassRegistryv0">RegistredClasses</a>->end()) +00060 <span class="keywordflow">return</span> NULL; +00061 <span class="keywordflow">else</span> +00062 { +00063 IClassable *ptr; +00064 ptr=it->second.Creator(); +00065 <span class="preprocessor"> #ifdef NL_DEBUG</span> +00066 <span class="preprocessor"></span> <a class="code" href="a04199.html#a6">nlassert</a>(CClassRegistry::checkObject(ptr)); +00067 <span class="preprocessor"> #endif</span> +00068 <span class="preprocessor"></span> <span class="keywordflow">return</span> ptr; +00069 } +00070 +00071 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CClassRegistryh0" doxytag="NLMISC::CClassRegistry::init" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CClassRegistry::init </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Inits the ClassRegistry (especially RegistredClasses). +<p> + +<p> +Definition at line <a class="el" href="a05549.html#l00043">43</a> of file <a class="el" href="a05549.html">class_registry.cpp</a>. +<p> +References <a class="el" href="a05549.html#l00039">RegistredClasses</a>, and <a class="el" href="a05550.html#l00108">TClassMap</a>. +<p> +Referenced by <a class="el" href="a05549.html#l00091">checkObject()</a>. +<p> +<div class="fragment"><pre>00044 { +00045 <span class="keywordflow">if</span> (<a class="code" href="a02348.html#NLMISC_1_1CClassRegistryv0">RegistredClasses</a> == NULL) +00046 <a class="code" href="a02348.html#NLMISC_1_1CClassRegistryv0">RegistredClasses</a> = <span class="keyword">new</span> <a class="code" href="a02348.html#NLMISC_1_1CClassRegistryy0">TClassMap</a>; +00047 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CClassRegistrye2" doxytag="NLMISC::CClassRegistry::registerClass" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CClassRegistry::registerClass </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname" nowrap> <em>className</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02540.html">IClassable</a> *(* </td> + <td class="mdname" nowrap> <em>creator</em>)(), </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const std::string & </td> + <td class="mdname" nowrap> <em>typeidCheck</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> throw (<a class="el" href="a03804.html">ERegistry</a>)<code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Register your class for future Instanciation. +<p> + +<p> +Definition at line <a class="el" href="a05549.html#l00074">74</a> of file <a class="el" href="a05549.html">class_registry.cpp</a>. +<p> +References <a class="el" href="a02349.html#NLMISC_1_1CClassRegistry_1_1CClassNodeo0">NLMISC::CClassRegistry::CClassNode::Creator</a>, <a class="el" href="a05622.html#l00416">nlstop</a>, and <a class="el" href="a05550.html#l00105">NLMISC::CClassRegistry::CClassNode::TypeIdCheck</a>. +<p> +<div class="fragment"><pre>00075 { +00076 <a class="code" href="a02348.html#NLMISC_1_1CClassRegistryh0">init</a>(); +00077 +00078 CClassNode node; +00079 node.Creator=creator; +00080 node.TypeIdCheck= typeidCheck; +00081 std::pair<TClassMap::iterator, bool> result; +00082 result = <a class="code" href="a02348.html#NLMISC_1_1CClassRegistryv0">RegistredClasses</a>->insert(TClassMap::value_type(className, node)); +00083 <span class="keywordflow">if</span>(!result.second) +00084 { +00085 <a class="code" href="a04199.html#a12">nlstop</a>; +00086 <span class="keywordflow">throw</span> ERegisteredClass(); +00087 } +00088 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLMISC_1_1CClassRegistryv0" doxytag="NLMISC::CClassRegistry::RegistredClasses" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02348.html#NLMISC_1_1CClassRegistryy0">CClassRegistry::TClassMap</a> * <a class="el" href="a02348.html#NLMISC_1_1CClassRegistryv0">NLMISC::CClassRegistry::RegistredClasses</a> = NULL<code> [static, private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05549.html#l00039">39</a> of file <a class="el" href="a05549.html">class_registry.cpp</a>. +<p> +Referenced by <a class="el" href="a05549.html#l00091">checkObject()</a>, and <a class="el" href="a05549.html#l00043">init()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05550.html">class_registry.h</a><li><a class="el" href="a05549.html">class_registry.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:06:15 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |