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
00035 #ifndef OW_CPPPROVIDERIFC_HPP_
00036 #define OW_CPPPROVIDERIFC_HPP_
00037 #include "OW_config.h"
00038 #include "OW_ProviderIFCBaseIFC.hpp"
00039 #include "OW_Map.hpp"
00040 #include "OW_SharedLibrary.hpp"
00041 #include "OW_CppProviderBaseIFC.hpp"
00042 #include "OW_MutexLock.hpp"
00043
00044
00045
00046
00047 namespace OW_NAMESPACE
00048 {
00049
00054 class OW_CPPPROVIFC_API CppProviderIFC : public ProviderIFCBaseIFC
00055 {
00056 public:
00057 static const char* const CREATIONFUNC;
00058 CppProviderIFC();
00059 ~CppProviderIFC();
00060
00061
00062 static CppProviderBaseIFCRef loadProvider(const String& libName, LoggerRef logger);
00063
00064 protected:
00065 virtual const char* getName() const { return "c++"; }
00070 virtual void doInit(const ProviderEnvironmentIFCRef& env,
00071 InstanceProviderInfoArray& i,
00072 SecondaryInstanceProviderInfoArray& si,
00073 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00074 AssociatorProviderInfoArray& a,
00075 #endif
00076 MethodProviderInfoArray& m,
00077 IndicationProviderInfoArray& ind);
00078 virtual InstanceProviderIFCRef doGetInstanceProvider(
00079 const ProviderEnvironmentIFCRef& env,
00080 const char* provIdString);
00081 virtual SecondaryInstanceProviderIFCRef doGetSecondaryInstanceProvider(
00082 const ProviderEnvironmentIFCRef& env,
00083 const char* provIdString);
00084 virtual MethodProviderIFCRef doGetMethodProvider(
00085 const ProviderEnvironmentIFCRef& env,
00086 const char* provIdString);
00087 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00088 virtual AssociatorProviderIFCRef doGetAssociatorProvider(
00089 const ProviderEnvironmentIFCRef& env,
00090 const char* provIdString);
00091 #endif
00092 virtual IndicationProviderIFCRef doGetIndicationProvider(
00093 const ProviderEnvironmentIFCRef& env,
00094 const char* provIdString);
00095 virtual IndicationExportProviderIFCRefArray doGetIndicationExportProviders(
00096 const ProviderEnvironmentIFCRef& env
00097 );
00098 virtual PolledProviderIFCRefArray doGetPolledProviders(
00099 const ProviderEnvironmentIFCRef& env
00100 );
00101 virtual void doUnloadProviders(const ProviderEnvironmentIFCRef& env);
00102 virtual void doShuttingDown(const ProviderEnvironmentIFCRef& env);
00103 private:
00104
00105
00106
00107 class CppProviderInitializationHelper;
00108 typedef IntrusiveReference<CppProviderInitializationHelper> CppProviderInitializationHelperRef;
00109
00110 typedef Map<String, CppProviderInitializationHelperRef> ProviderMap;
00111 typedef Map<String, IndicationProviderIFCRef> IndicationProviderMap;
00112 typedef Array<CppProviderBaseIFCRef> LoadedProviderArray;
00113 enum StoreProviderFlag
00114 {
00115 dontStoreProvider,
00116 storeProvider
00117 };
00118 enum InitializeProviderFlag
00119 {
00120 dontInitializeProvider,
00121 initializeProvider
00122 };
00123
00124
00125 CppProviderBaseIFCRef getProvider(const ProviderEnvironmentIFCRef& env,
00126 const char* provIdString, StoreProviderFlag = storeProvider,
00127 InitializeProviderFlag = initializeProvider);
00128 void loadProviders(const ProviderEnvironmentIFCRef& env,
00129 InstanceProviderInfoArray& i,
00130 SecondaryInstanceProviderInfoArray& si,
00131 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00132 AssociatorProviderInfoArray& a,
00133 #endif
00134 MethodProviderInfoArray& m,
00135 IndicationProviderInfoArray& ind);
00136 ProviderMap m_provs;
00137 IndicationProviderMap m_indicationProviders;
00138 Mutex m_guard;
00139 LoadedProviderArray m_noUnloadProviders;
00140 bool m_loadDone;
00141 };
00142 typedef SharedLibraryReference< IntrusiveReference<CppProviderIFC> > CppProviderIFCRef;
00143
00144 }
00145
00146 #endif