Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

hyp.com.factorieslibrary.h

00001 /*
00002 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
00003  Ephydryne Components.
00004  Ephydryne is a part of the Hyperion Project.
00005 ----------------------------------------------------------
00006  Copyright (c) 2001 Pierre Rebours.
00007 
00008  This library is free software; you can redistribute it and/or
00009  modify it under the terms of the GNU Lesser General Public
00010  License as published by the Free Software Foundation; either
00011  version 2.1 of the License, or (at your option) any later version.
00012 
00013  This library is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  
00017  See hyp.license.txt file for more information about the license.
00018  
00019  Web: http://lagrandeporte.multimania.com/hyperion
00020  Email: pierre_rebours@yahoo.com
00021 ----------------------------------------------------------
00022  CVS
00023  $Log$
00024  
00025  Creation 15/03/01 Pierre Rebours
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         //FIXTODO : why a static member?
00092         static t_Cont m_Cache;
00093 
00094         SFactoryData* GetData(const std::string&);
00095         SFactoryData* GetData(const hyp_ker::hypCLSID&);
00096 
00097 };
00098 #endif

Top of Page
written by Pierre Rebours © 2000-2001. Terms of Use.