📄 pfactory_8h-source.html
字号:
<!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>pfactory.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> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>pfactory.h</h1><a href="pfactory_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * factory.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Abstract Factory Classes</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (C) 2004 Post Increment</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Post Increment</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Contributor(s): ______________________________________.</span>00025 <span class="comment"> *</span>00026 <span class="comment"> * $Log: pfactory.h,v $</span>00027 <span class="comment"> * Revision 1.19 2004/08/16 06:40:59 csoutheren</span>00028 <span class="comment"> * Added adapters template to make device plugins available via the abstract factory interface</span>00029 <span class="comment"> *</span>00030 <span class="comment"> * Revision 1.18 2004/07/12 09:17:20 csoutheren</span>00031 <span class="comment"> * Fixed warnings and errors under Linux</span>00032 <span class="comment"> *</span>00033 <span class="comment"> * Revision 1.17 2004/07/06 10:12:52 csoutheren</span>00034 <span class="comment"> * Added static integer o factory template to assist in ensuring factories are instantiated</span>00035 <span class="comment"> *</span>00036 <span class="comment"> * Revision 1.16 2004/07/06 04:26:44 csoutheren</span>00037 <span class="comment"> * Fixed problem when using factory maps with non-standard keys</span>00038 <span class="comment"> *</span>00039 <span class="comment"> * Revision 1.15 2004/07/02 03:14:47 csoutheren</span>00040 <span class="comment"> * Made factories non-singleton, by default</span>00041 <span class="comment"> * Added more docs</span>00042 <span class="comment"> *</span>00043 <span class="comment"> * Revision 1.14 2004/07/01 11:41:28 csoutheren</span>00044 <span class="comment"> * Fixed compile and run problems on Linux</span>00045 <span class="comment"> *</span>00046 <span class="comment"> * Revision 1.13 2004/07/01 04:33:57 csoutheren</span>00047 <span class="comment"> * Updated documentation on PFactory classes</span>00048 <span class="comment"> *</span>00049 <span class="comment"> * Revision 1.12 2004/06/30 12:17:04 rjongbloed</span>00050 <span class="comment"> * Rewrite of plug in system to use single global variable for all factories to avoid all sorts</span>00051 <span class="comment"> * of issues with startup orders and Windows DLL multiple instances.</span>00052 <span class="comment"> *</span>00053 <span class="comment"> * Revision 1.11 2004/06/17 06:35:12 csoutheren</span>00054 <span class="comment"> * Use attribute (( constructor )) to guarantee that factories are</span>00055 <span class="comment"> * instantiated when loaded from a shared library</span>00056 <span class="comment"> *</span>00057 <span class="comment"> * Revision 1.10 2004/06/03 13:30:57 csoutheren</span>00058 <span class="comment"> * Renamed INSTANTIATE_FACTORY to avoid potential namespace collisions</span>00059 <span class="comment"> * Added documentaton on new PINSTANTIATE_FACTORY macro</span>00060 <span class="comment"> * Added generic form of PINSTANTIATE_FACTORY</span>00061 <span class="comment"> *</span>00062 <span class="comment"> * Revision 1.9 2004/06/03 12:47:58 csoutheren</span>00063 <span class="comment"> * Decomposed PFactory declarations to hopefully avoid problems with Windows DLLs</span>00064 <span class="comment"> *</span>00065 <span class="comment"> * Revision 1.8 2004/06/01 05:44:12 csoutheren</span>00066 <span class="comment"> * Added typedefs to allow access to types</span>00067 <span class="comment"> * Changed singleton class to use new so as to allow full cleanup</span>00068 <span class="comment"> *</span>00069 <span class="comment"> * Revision 1.7 2004/05/23 12:33:56 rjongbloed</span>00070 <span class="comment"> * Made some subtle changes to the way the static variables are instantiated in</span>00071 <span class="comment"> * the factoris to fix problems with DLL's under windows. May not be final solution.</span>00072 <span class="comment"> *</span>00073 <span class="comment"> * Revision 1.6 2004/05/19 06:48:39 csoutheren</span>00074 <span class="comment"> * Added new functions to allow handling of singletons without concrete classes</span>00075 <span class="comment"> *</span>00076 <span class="comment"> * Revision 1.5 2004/05/18 06:01:06 csoutheren</span>00077 <span class="comment"> * Deferred plugin loading until after main has executed by using abstract factory classes</span>00078 <span class="comment"> *</span>00079 <span class="comment"> * Revision 1.4 2004/05/18 02:32:08 csoutheren</span>00080 <span class="comment"> * Fixed linking problems with PGenericFactory classes</span>00081 <span class="comment"> *</span>00082 <span class="comment"> * Revision 1.3 2004/05/13 15:10:51 csoutheren</span>00083 <span class="comment"> * Removed warnings under Windows</span>00084 <span class="comment"> *</span>00085 <span class="comment"> * Revision 1.2 2004/05/13 14:59:00 csoutheren</span>00086 <span class="comment"> * Removed warning under gcc</span>00087 <span class="comment"> *</span>00088 <span class="comment"> * Revision 1.1 2004/05/13 14:53:35 csoutheren</span>00089 <span class="comment"> * Add "abstract factory" template classes</span>00090 <span class="comment"> *</span>00091 <span class="comment"> */</span>00092 00093 <span class="preprocessor">#ifndef _PFACTORY_H</span>00094 <span class="preprocessor"></span><span class="preprocessor">#define _PFACTORY_H</span>00095 <span class="preprocessor"></span>00096 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00097 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00098 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00099 <span class="preprocessor"></span>00100 <span class="preprocessor">#include <ptlib.h></span>00101 <span class="preprocessor">#include <string></span>00102 <span class="preprocessor">#include <map></span>00103 <span class="preprocessor">#include <vector></span>00104 00105 <span class="preprocessor">#ifdef _WIN32</span>00106 <span class="preprocessor"></span><span class="preprocessor">#pragma warning(disable:4786)</span>00107 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00108 <span class="preprocessor"></span><a name="l00167"></a><a class="code" href="classPFactoryBase.html">00167</a> <span class="keyword">class </span><a class="code" href="classPFactoryBase.html">PFactoryBase</a>00168 {00169 <span class="keyword">protected</span>:<a name="l00170"></a><a class="code" href="classPFactoryBase.html#b0">00170</a> <a class="code" href="classPFactoryBase.html#b0">PFactoryBase</a>()00171 { }00172 <span class="keyword">public</span>:<a name="l00173"></a><a class="code" href="classPFactoryBase.html#a0">00173</a> <span class="keyword">virtual</span> <a class="code" href="classPFactoryBase.html#a0">~PFactoryBase</a>()00174 { }00175 <a name="l00176"></a><a class="code" href="classPFactoryBase_1_1FactoryMap.html">00176</a> <span class="keyword">class </span><a class="code" href="classPFactoryBase_1_1FactoryMap.html">FactoryMap</a> : <span class="keyword">public</span> std::map<std::string, PFactoryBase *>00177 {00178 <span class="keyword">public</span>:<a name="l00179"></a><a class="code" href="classPFactoryBase_1_1FactoryMap.html#a0">00179</a> <a class="code" href="classPFactoryBase_1_1FactoryMap.html#a0">FactoryMap</a>() { }00180 <a class="code" href="classPFactoryBase_1_1FactoryMap.html#a1">~FactoryMap</a>();00181 };00182
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -