📄 class_plugin_thread_pool_1_1_thread_pool.html
字号:
<!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>ThreadPool: PluginThreadPool::ThreadPool< T > Class Template 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.7 --><div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li id="current"><a href="classes.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</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="functions.html"><span>Class Members</span></a></li> </ul></div><div class="nav"><a class="el" href="namespace_plugin_thread_pool.html">PluginThreadPool</a>::<a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a></div><h1>PluginThreadPool::ThreadPool< T > Class Template Reference</h1><!-- doxytag: class="PluginThreadPool::ThreadPool" --><code>#include <<a class="el" href="_thread_pool_8h-source.html">ThreadPool.h</a>></code><p><a href="class_plugin_thread_pool_1_1_thread_pool-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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#793ceed68b9730cb5284866553a0fe0b">ThreadPool</a> (int _minthreadcount, int _maxthreadcount, unsigned long maxtimeout)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#eb29e932aca63ee447230c9b7854b8c3">~ThreadPool</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">dtor <a href="#eb29e932aca63ee447230c9b7854b8c3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#72558bda6253316968ced2412643281c">ThreadChecker</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#27605e5cc423913a7a89984194b66f53">HandleRequest</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#8dfcd872c27739892faf35f145eb2ce6">QueueRequest</a> (<a class="el" href="class_plugin_thread_pool_1_1_command.html">Command</a>< T > *cmdPtr)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="class_plugin_thread_pool_1_1_command.html">Command</a>< T > * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#ec7274ccdc608f341ecb7dc5bff3e055">GetRequest</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#25d1455518239dc2c722bd93c9fdb80a">ProcessList</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#725fd7df525c33165c8823a231e83c3f">IncrementThreadCount</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#d5508e9bb5664dceb8ea2928b84e9151">DecrementThreadCount</a> ()</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 UINT </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#a9a2180d79c1881d964a567703b168ff">ThreadCheckerProxy</a> (LPVOID param)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">This is the proxy thread method to 'ThreadChecker' method. <a href="#a9a2180d79c1881d964a567703b168ff"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static UINT </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#f048fb1c01a66c230bfd09485ca47861">ProcessListProxy</a> (LPVOID param)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">This is the proxy thread method that calls the real ProcessList method. <a href="#f048fb1c01a66c230bfd09485ca47861"></a><br></td></tr><tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">ThreadChain</a>< T > * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#5fed07aa59225164a8183ebfad0d2dd0">root</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#1523b636bdfbc15c3c8140bb1d3fd73a">m_nPendingCount</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">std::queue<Command<T>*,std::list<Command<T>*> > m_RequestQueue; <a href="#1523b636bdfbc15c3c8140bb1d3fd73a"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#94e9bae0e656ba3da5056ee3b8709b29">minthreadCount</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#f48df9b0b8b3798a09479be144ff69c8">maxthreadCount</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#1fb2b3be2cc4b88af4609dd6ee836569">m_threadCount</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">HANDLE </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#6a6f0596c370e54b6b30ca3e122d407f">m_pending</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">HANDLE </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#3d17c3505d5cb1da22d4357af2193dfc">freeThreadEvent</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="class_plugin_thread_pool_1_1_c_request_queue.html">CRequestQueue</a>< T > </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#699a14f969eb831eb9302ec343c65c24">m_RequestQueue</a></td></tr><tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#272fbc61d7f5bbfaac21bb6b58b00653">ThreadPool</a> (const <a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a> &)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">so making copy ctor and copy assignment private <a href="#272fbc61d7f5bbfaac21bb6b58b00653"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#1d1e3dff773360670050c11735cf284f">operator=</a> (const <a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a> &)</td></tr><tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CWinThread * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#e0ba67ddcf46ec2ade7b3ee367045d6d">m_winthread</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CRITICAL_SECTION </td><td class="memItemRight" valign="bottom"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html#e89b7ec48e7c5390ca40238c8b5b7e67">critsec</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2><h3>template<typename T><br> class PluginThreadPool::ThreadPool< T ></h3>This class models the <a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a> The class that manages the Threads This creates a chain of <a class="el" href="class_plugin_thread_pool_1_1_thread_chain.html">ThreadChain</a> objects and manages them <p><p>Definition at line <a class="el" href="_thread_pool_8h-source.html#l00041">41</a> of file <a class="el" href="_thread_pool_8h-source.html">ThreadPool.h</a>.<hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="272fbc61d7f5bbfaac21bb6b58b00653"></a><!-- doxytag: member="PluginThreadPool::ThreadPool::ThreadPool" ref="272fbc61d7f5bbfaac21bb6b58b00653" args="(const ThreadPool &)" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">PluginThreadPool::ThreadPool</a>< T >::<a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a> </td> <td>(</td> <td class="paramtype">const <a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a>< T > & </td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline, private]</code></td> </tr> </table></div><div class="memdoc"><p>so making copy ctor and copy assignment private <p>there is no meaning in copying a thread pool, <p>Definition at line <a class="el" href="_thread_pool_8h-source.html#l00047">47</a> of file <a class="el" href="_thread_pool_8h-source.html">ThreadPool.h</a>.</div></div><p><a class="anchor" name="793ceed68b9730cb5284866553a0fe0b"></a><!-- doxytag: member="PluginThreadPool::ThreadPool::ThreadPool" ref="793ceed68b9730cb5284866553a0fe0b" args="(int _minthreadcount, int _maxthreadcount, unsigned long maxtimeout)" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">PluginThreadPool::ThreadPool</a>< T >::<a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a> </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>_minthreadcount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>_maxthreadcount</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned long </td> <td class="paramname"> <em>maxtimeout</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [inline, explicit]</code></td> </tr> </table></div><div class="memdoc"><p><p>Definition at line <a class="el" href="_thread_pool_8h-source.html#l00052">52</a> of file <a class="el" href="_thread_pool_8h-source.html">ThreadPool.h</a>.<p>References <a class="el" href="_thread_pool_8h-source.html#l00235">PluginThreadPool::ThreadPool< T >::critsec</a>, <a class="el" href="_thread_pool_8h-source.html#l00245">PluginThreadPool::ThreadPool< T >::m_pending</a>, <a class="el" href="_thread_pool_8h-source.html#l00234">PluginThreadPool::ThreadPool< T >::m_winthread</a>, <a class="el" href="_thread_pool_8h-source.html#l00242">PluginThreadPool::ThreadPool< T >::minthreadCount</a>, <a class="el" href="_thread_pool_8h-source.html#l00172">PluginThreadPool::ThreadPool< T >::ProcessListProxy()</a>, <a class="el" href="_thread_pool_8h-source.html#l00239">PluginThreadPool::ThreadPool< T >::root</a>, and <a class="el" href="_thread_pool_8h-source.html#l00097">PluginThreadPool::ThreadPool< T >::ThreadCheckerProxy()</a>.</div></div><p><a class="anchor" name="eb29e932aca63ee447230c9b7854b8c3"></a><!-- doxytag: member="PluginThreadPool::ThreadPool::~ThreadPool" ref="eb29e932aca63ee447230c9b7854b8c3" args="()" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">PluginThreadPool::ThreadPool</a>< T >::~<a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">ThreadPool</a> </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>dtor <p><p>Note the ownership of the objects in the queue is not inside this <p>Definition at line <a class="el" href="_thread_pool_8h-source.html#l00089">89</a> of file <a class="el" href="_thread_pool_8h-source.html">ThreadPool.h</a>.<p>References <a class="el" href="_thread_pool_8h-source.html#l00245">PluginThreadPool::ThreadPool< T >::m_pending</a>.</div></div><p><hr><h2>Member Function Documentation</h2><a class="anchor" name="d5508e9bb5664dceb8ea2928b84e9151"></a><!-- doxytag: member="PluginThreadPool::ThreadPool::DecrementThreadCount" ref="d5508e9bb5664dceb8ea2928b84e9151" args="()" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">PluginThreadPool::ThreadPool</a>< T >::DecrementThreadCount </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table></div><div class="memdoc"><p>This method decrements the thread count of the thread pool in a thread safe manner <p>Definition at line <a class="el" href="_thread_pool_8h-source.html#l00226">226</a> of file <a class="el" href="_thread_pool_8h-source.html">ThreadPool.h</a>.<p>References <a class="el" href="_thread_pool_8h-source.html#l00244">PluginThreadPool::ThreadPool< T >::m_threadCount</a>.</div></div><p><a class="anchor" name="ec7274ccdc608f341ecb7dc5bff3e055"></a><!-- doxytag: member="PluginThreadPool::ThreadPool::GetRequest" ref="ec7274ccdc608f341ecb7dc5bff3e055" args="()" --><div class="memitem"><div class="memproto"><div class="memtemplate">template<typename T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_plugin_thread_pool_1_1_command.html">Command</a><T>* <a class="el" href="class_plugin_thread_pool_1_1_thread_pool.html">PluginThreadPool::ThreadPool</a>< T >::GetRequest </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -