00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _hyp_com_factorieslibrary_h_
00032 #define _hyp_com_factorieslibrary_h_
00033
00034 #ifndef hypfem_INSIDE_INTERN
00035 #error Inclusion not allowed (include hyp.fem.intern.h instead)
00036 #endif
00037
00038
00048 class CFactoriesLibrary :
00049 #ifdef hypfem_IDENTIFY_CONSTRUCTION_ON
00050 protected CIDClass,
00051 #endif
00052 public IFactoriesLibrary,
00053 public hyp_ker::CUnknown
00054 {
00055 public:
00057 CFactoriesLibrary(hyp_ker::IUnknown*);
00058 virtual ~CFactoriesLibrary();
00059 hyp_DECLARE_IUNKNOWN
00060 virtual hyp_ker::com_result NondelegatingQueryInterface(const hyp_ker::hypIID& ,void** );
00061 static hyp_ker::com_result CreateInstance(hyp_ker::IUnknown* ,hyp_ker::CUnknown** );
00063
00067 virtual void CreateInstance(const hyp_ker::hypCLSID&,hyp_ker::IUnknown*,
00068 t_ulong,const hyp_ker::hypIID&,void**);
00069 virtual void CreateInstance(const char*,hyp_ker::IUnknown*,
00070 t_ulong,const hyp_ker::hypIID&,void**);
00072
00073
00074 private:
00075 struct SFactoryData
00076 {
00077 std::string m_ProgID;
00078 hyp_ker::hypCLSID m_CLSID;
00079 hyp_ker::IClassFactory* m_pFactory;
00080
00081 SFactoryData(const std::string& prog_id,
00082 const hyp_ker::hypCLSID& CLSID,
00083 hyp_ker::IClassFactory* pFactory) :
00084 m_ProgID(prog_id),
00085 m_CLSID(CLSID),
00086 m_pFactory(pFactory) { }
00087 };
00088
00089 typedef std::vector<SFactoryData> t_Cont;
00090 typedef t_Cont::iterator t_ContIterator;
00091
00092 static t_Cont m_Cache;
00093
00094 SFactoryData* GetData(const std::string&);
00095 SFactoryData* GetData(const hyp_ker::hypCLSID&);
00096
00097 };
00098 #endif