⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plugin_8h-source.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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>plugin.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>plugin.h</h1><a href="plugin_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * plugin.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Plugin Class Declarations</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Contributor(s): Snark at GnomeMeeting</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * $Log: plugin.h,v $</span>00011 <span class="comment"> * Revision 1.11  2004/08/16 11:57:47  csoutheren</span>00012 <span class="comment"> * More changes for VS.net</span>00013 <span class="comment"> *</span>00014 <span class="comment"> * Revision 1.10  2004/08/16 10:55:09  csoutheren</span>00015 <span class="comment"> * Fixed problems compiling under Linux</span>00016 <span class="comment"> *</span>00017 <span class="comment"> * Revision 1.9  2004/08/16 06:40:59  csoutheren</span>00018 <span class="comment"> * Added adapters template to make device plugins available via the abstract factory interface</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * Revision 1.8  2004/06/21 10:40:02  csoutheren</span>00021 <span class="comment"> * Fixed problem with dynamic plugins</span>00022 <span class="comment"> *</span>00023 <span class="comment"> * Revision 1.7  2004/06/21 00:57:40  csoutheren</span>00024 <span class="comment"> * Changed service plugin static registration to use attribute (( constructor ))</span>00025 <span class="comment"> *</span>00026 <span class="comment"> * Revision 1.6  2003/12/19 00:34:27  csoutheren</span>00027 <span class="comment"> * Ensured that older compilers do not get confused about functions wth empty</span>00028 <span class="comment"> * parameter lists. Thanks to Kilian Krause</span>00029 <span class="comment"> *</span>00030 <span class="comment"> * Revision 1.5  2003/11/19 09:29:19  csoutheren</span>00031 <span class="comment"> * Added super hack to avoid problems with multiple plugins in a single file</span>00032 <span class="comment"> *</span>00033 <span class="comment"> * Revision 1.4  2003/11/12 10:24:35  csoutheren</span>00034 <span class="comment"> * Changes to allow operation of static plugins under Windows</span>00035 <span class="comment"> *</span>00036 <span class="comment"> * Revision 1.3  2003/11/12 06:58:21  csoutheren</span>00037 <span class="comment"> * Changes to help in making static plugins autoregister under Windows</span>00038 <span class="comment"> *</span>00039 <span class="comment"> * Revision 1.2  2003/11/12 03:26:17  csoutheren</span>00040 <span class="comment"> * Initial version of plugin code from Snark of GnomeMeeting with changes</span>00041 <span class="comment"> *    by Craig Southeren os Post Increment</span>00042 <span class="comment"> *</span>00043 <span class="comment"> *</span>00044 <span class="comment"> */</span>00045 00046 <span class="preprocessor">#ifndef _PLUGIN_H</span>00047 <span class="preprocessor"></span><span class="preprocessor">#define _PLUGIN_H</span>00048 <span class="preprocessor"></span>00050 <span class="comment">//</span>00051 <span class="comment">//  these templates implement an adapter to make the old style device plugins appear in the new factory system</span>00052 <span class="comment">//</span>00053 00054 <span class="preprocessor">#include &lt;<a class="code" href="pfactory_8h.html">ptlib/pfactory.h</a>&gt;</span>00055 00056 <span class="keyword">template</span> &lt;<span class="keyword">class</span> _Abstract_T, <span class="keyword">typename</span> _Key_T = PString&gt;<a name="l00057"></a><a class="code" href="classPDevicePluginFactory.html">00057</a> <span class="keyword">class </span><a class="code" href="classPDevicePluginFactory.html">PDevicePluginFactory</a> : <span class="keyword">public</span> <a class="code" href="classPFactory.html">PFactory</a>&lt;_Abstract_T, _Key_T&gt;00058 {00059   <span class="keyword">public</span>:<a name="l00060"></a><a class="code" href="classPDevicePluginFactory_1_1Worker.html">00060</a>     <span class="keyword">class </span><a class="code" href="classPDevicePluginFactory_1_1Worker.html">Worker</a> : <span class="keyword">public</span> <a class="code" href="classPFactory.html">PFactory</a>&lt;_Abstract_T, _Key_T&gt;::WorkerBase 00061     {00062       <span class="keyword">public</span>:<a name="l00063"></a><a class="code" href="classPDevicePluginFactory_1_1Worker.html#a0">00063</a>         <a class="code" href="classPDevicePluginFactory_1_1Worker.html#a0">Worker</a>(<span class="keyword">const</span> _Key_T &amp; key, <span class="keywordtype">bool</span> singleton = <span class="keyword">false</span>)00064           : <a class="code" href="classPFactory.html">PFactory</a>&lt;_Abstract_T, _Key_T&gt;::<a class="code" href="classPFactory_1_1WorkerBase.html#b0">WorkerBase</a>(singleton)00065         {00066           <a class="code" href="classPFactory.html#d0">PFactory&lt;_Abstract_T, _Key_T&gt;::Register</a>(key, <span class="keyword">this</span>);00067         }00068 00069       <span class="keyword">protected</span>:00070         <span class="keyword">virtual</span> _Abstract_T * <a class="code" href="classPDevicePluginFactory_1_1Worker.html#b0">Create</a>(<span class="keyword">const</span> _Key_T &amp; key) <span class="keyword">const</span>;00071     };00072 };00073 <a name="l00074"></a><a class="code" href="classPDevicePluginAdapterBase.html">00074</a> <span class="keyword">class </span><a class="code" href="classPDevicePluginAdapterBase.html">PDevicePluginAdapterBase</a>00075 {00076   <span class="keyword">public</span>:<a name="l00077"></a><a class="code" href="classPDevicePluginAdapterBase.html#a0">00077</a>     <a class="code" href="classPDevicePluginAdapterBase.html#a0">PDevicePluginAdapterBase</a>()00078     { }<a name="l00079"></a><a class="code" href="classPDevicePluginAdapterBase.html#a1">00079</a>     <span class="keyword">virtual</span> <a class="code" href="classPDevicePluginAdapterBase.html#a1">~PDevicePluginAdapterBase</a>()00080     { }00081     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPDevicePluginAdapterBase.html#a2">CreateFactory</a>(<span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; device) = 0;00082 };00083 00084 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> DeviceBase&gt;<a name="l00085"></a><a class="code" href="classPDevicePluginAdapter.html">00085</a> <span class="keyword">class </span><a class="code" href="classPDevicePluginAdapter.html">PDevicePluginAdapter</a> : <span class="keyword">public</span> <a class="code" href="classPDevicePluginAdapterBase.html">PDevicePluginAdapterBase</a>00086 {00087   <span class="keyword">public</span>:<a name="l00088"></a><a class="code" href="classPDevicePluginAdapter.html#s0">00088</a>     <span class="keyword">typedef</span> <a class="code" href="classPDevicePluginFactory.html">PDevicePluginFactory&lt;DeviceBase&gt;</a> <a class="code" href="classPDevicePluginFactory.html">Factory_T</a>;<a name="l00089"></a><a class="code" href="classPDevicePluginAdapter.html#s1">00089</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> Factory_T::Worker <a class="code" href="classPDevicePluginAdapter.html#s1">Worker_T</a>;<a name="l00090"></a><a class="code" href="classPDevicePluginAdapter.html#a0">00090</a>     <span class="keywordtype">void</span> <a class="code" href="classPDevicePluginAdapter.html#a0">CreateFactory</a>(<span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> &amp; device)00091     { <span class="keyword">new</span> <a class="code" href="classPDevicePluginAdapter.html#s1">Worker_T</a>(device, TRUE); }00092 };00093 <a name="l00094"></a><a class="code" href="plugin_8h.html#a0">00094</a> <span class="preprocessor">#define PWLIB_PLUGIN_API_VERSION 0</span>00095 <span class="preprocessor"></span>00097 <span class="comment">//</span>00098 <span class="comment">//  Ancestor Service descriptor for plugins</span>00099 <span class="comment">//</span>00100 <a name="l00101"></a><a class="code" href="classPPluginServiceDescriptor.html">00101</a> <span class="keyword">class </span><a class="code" href="classPPluginServiceDescriptor.html">PPluginServiceDescriptor</a> 00102 {00103   <span class="keyword">public</span>:<a name="l00104"></a><a class="code" href="classPPluginServiceDescriptor.html#a0">00104</a>     <a class="code" href="classPPluginServiceDescriptor.html#a0">PPluginServiceDescriptor</a>(<span class="keywordtype">unsigned</span> (*_GetPluginAPIVersion)())00105       : <a class="code" href="classPPluginServiceDescriptor.html#m0">GetPluginAPIVersion</a>(_GetPluginAPIVersion)00106     { }00107 00108     unsigned (*<a class="code" href="classPPluginServiceDescriptor.html#m0">GetPluginAPIVersion</a>)();00109 };00110 00111 00113 <span class="comment">//</span>00114 <span class="comment">// Define a service provided by a plugin, which consists of the following:</span>00115 <span class="comment">//</span>00116 <span class="comment">//    serviceType - the base class name of the service which is used to identify</span>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -