FDO API Reference | Feature Data Objects |
00001 #ifndef _FDOCONNECTIONMANAGER_H_ 00002 #define _FDOCONNECTIONMANAGER_H_ 00003 /*************************************************************************** 00004 00005 // 00006 // Copyright (C) 2004-2006 Autodesk, Inc. 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of version 2.1 of the GNU Lesser 00010 // General Public License as published by the Free Software Foundation. 00011 // 00012 // This library is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with this library; if not, write to the Free Software 00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 // 00021 00022 00023 ***************************************************************************/ 00024 #ifdef _WIN32 00025 #pragma once 00026 #endif 00027 00028 #include <map> 00029 #include <Fdo/IConnectionManager.h> 00030 00031 #ifdef _WIN32 00032 typedef std::map <std::wstring, HMODULE> FdoModuleMap; 00033 #else 00034 typedef std::map <std::wstring, void *> FdoModuleMap; 00035 #endif 00036 00037 /// \brief 00038 /// 00039 /// The IConnectionManager interface supports dynamic creation of connection objects 00040 /// given a provider name. Derives from IConnectionManager interface. 00041 /// \remarks 00042 /// 00043 /// In order for dynamic creation to work, each dynamic link library, shared library, 00044 /// or assembly that implements a provider must supply a well-defined entry point function that 00045 /// takes as input a provider name and returns an FdoIConnection instance. The definition of the 00046 /// entry point function is language- and platform-dependent. For this release of FDO, the 00047 /// windows libraries supporting FDO providers will be expected to support the following well-known 00048 /// entry point function, which will create and return an unitialized connection object: 00049 /// IConnection * CreateConnection(); 00050 class FdoConnectionManager : public IConnectionManager 00051 { 00052 /// \brief 00053 /// Instances of interface FdoFeatureAccessManager are responsible for the 00054 /// lifespan of FdoConnectionManager 00055 /// 00056 friend class FdoFeatureAccessManager; 00057 00058 protected: 00059 /// \cond DOXYGEN-IGNORE 00060 /// Constructs a default instance of a FdoProviderRegistry object. 00061 FdoConnectionManager(); 00062 00063 /// Default destructor for FdoProviderRegistry object. 00064 virtual ~FdoConnectionManager(); 00065 00066 virtual void Dispose(); 00067 /// \endcond 00068 00069 public: 00070 /// \brief 00071 /// Creates an unitialized connection object given the provider name 00072 /// 00073 /// \param providerName 00074 /// The unique name of the feature provider. This name should be of the form 00075 /// [Company].[Provider].[Version]. 00076 /// 00077 /// \return 00078 /// Returns an instance of an FdoIConnection object. 00079 /// Throws an instance of FdoClientServicesException * if an error occurs. 00080 /// 00081 FDO_API virtual FdoIConnection* CreateConnection(const wchar_t* providerName); 00082 00083 /// \brief 00084 /// Frees a connection library reference given the provider name 00085 /// 00086 /// \param providerName 00087 /// The unique name of the feature provider. This name should be of the form 00088 /// [Company].[Provider].[Version]. 00089 /// 00090 /// \return 00091 /// Returns nothing. Throws an instance of FdoClientServicesException * if an error occurs. 00092 /// 00093 FDO_API virtual void FreeLibrary(const wchar_t* providerName); 00094 00095 private: 00096 /// Provider library reference map 00097 FdoModuleMap m_moduleMap; 00098 }; 00099 #endif 00100 00101
Comments or suggestions? Send us feedback. |