oaCommonPlugInMgr.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaCommonPlugInMgr.h
00004 //
00005 // This file contains the definition of the oaPlugInMgr class. This class is 
00006 // used to obtain component and factory objects.  Only a single plugin manager
00007 // should exist, so the constructor is private; users should get the plugin
00008 // manager using the static method getPlugInManager(), and call release() on
00009 // that manager when finished with it.
00010 //
00011 // *****************************************************************************
00012 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00013 // Integration Initiative, this material may not be copied, modified,
00014 // re-published, uploaded, executed, or distributed in any way, in any medium,
00015 // in whole or in part, without prior written permission from Cadence.
00016 //
00017 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00018 //                           All Rights Reserved.
00019 //
00020 //  $Author: icftcm $
00021 //  $Revision: #1 $
00022 //  $Date: 2010/08/09 $
00023 //  $State: Exp $
00024 // *****************************************************************************
00025 // *****************************************************************************
00026 
00027 
00028 
00029 #if !defined(oaCommonPlugInMgr_P)
00030 #define oaCommonPlugInMgr_P
00031 
00032 
00033 
00034 // *****************************************************************************
00035 // Nested includes
00036 // *****************************************************************************
00037 #include "oaCommonIBase.h"
00038 #include <string>
00039 
00040 
00041 
00042 #if defined(OA_WINDOWS)
00043 #define oacPlugInPathSeparator ";"
00044 #else
00045 #define oacPlugInPathSeparator ":"
00046 #endif
00047 
00048 
00049 
00050 // *****************************************************************************
00051 // Declare and define types in the oaCommon namespace
00052 // *****************************************************************************
00053 BEGIN_OA_COMMON_NAMESPACE
00054 
00055 
00056 
00057 // *****************************************************************************
00058 // Forward declarations
00059 // *****************************************************************************
00060 class PlugInTable;
00061 class IFactory;
00062 class IBase;
00063 class PlugInLib;
00064 
00065 // *****************************************************************************
00066 // oaPlugInMgr
00067 // *****************************************************************************
00068 class OA_COMMON_DLL_PVT oaPlugInMgr {
00069 public:
00070                             ~oaPlugInMgr();
00071 
00072     static oaPlugInMgr      *getPlugInMgr();
00073     static void             registerFactory(const char  *classID,
00074                                             IFactory    *factory);
00075     static void             revokeFactory(const char *classID);
00076 
00077 
00078     void                    createInstance(const char   *classID,
00079                                            IBase        *reserved,
00080                                            const Guid   &interfaceID,
00081                                            void         **ptr);
00082     void                    getClassFactory(const char  *classID,
00083                                             const Guid  &interfaceID,
00084                                             void        **ptr);
00085 
00086     const char              *getPlugInSearchPath() const;
00087 
00088     static const char       *getPlugInDir();
00089     static const char       *getPlugInExt();
00090 
00091 private:
00092                             oaPlugInMgr();
00093 
00094     void                    checkCompatibility(IBase        *plugIn,
00095                                                const char   *classID) const;
00096 
00097     PlugInTable             *table;
00098 
00099     static std::string      plugInDir;
00100 
00101     static const char*const plugInExt;
00102 };
00103 
00104 
00105 
00106 END_OA_COMMON_NAMESPACE
00107 
00108 #endif

Return to top of page