OW_CppProviderBaseIFC.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2001-2004 Vintela, Inc. All rights reserved.
00003 *
00004 * Redistribution and use in source and binary forms, with or without
00005 * modification, are permitted provided that the following conditions are met:
00006 *
00007 *  - Redistributions of source code must retain the above copyright notice,
00008 *    this list of conditions and the following disclaimer.
00009 *
00010 *  - Redistributions in binary form must reproduce the above copyright notice,
00011 *    this list of conditions and the following disclaimer in the documentation
00012 *    and/or other materials provided with the distribution.
00013 *
00014 *  - Neither the name of Vintela, Inc. nor the names of its
00015 *    contributors may be used to endorse or promote products derived from this
00016 *    software without specific prior written permission.
00017 *
00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00019 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS
00022 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00023 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00024 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00028 * POSSIBILITY OF SUCH DAMAGE.
00029 *******************************************************************************/
00030 
00035 #ifndef OW_CPP_PROVIDERBASEIFC_HPP_
00036 #define OW_CPP_PROVIDERBASEIFC_HPP_
00037 #include "OW_config.h"
00038 #include "OW_CIMFwd.hpp"
00039 #include "OW_ProviderEnvironmentIFC.hpp"
00040 #include "OW_ProviderRegistrationEnvironmentIFC.hpp"
00041 #include "OW_SharedLibraryReference.hpp"
00042 #include "OW_DateTime.hpp"
00043 #include "OW_IntrusiveReference.hpp"
00044 #include "OW_IntrusiveCountableBase.hpp"
00045 
00046 namespace OW_NAMESPACE
00047 {
00048 
00049 class CppInstanceProviderIFC;
00050 class CppSecondaryInstanceProviderIFC;
00051 class CppMethodProviderIFC;
00052 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00053 class CppAssociatorProviderIFC;
00054 #endif
00055 class CppIndicationExportProviderIFC;
00056 class CppPolledProviderIFC;
00057 class CppIndicationProviderIFC;
00073 class OW_CPPPROVIFC_API CppProviderBaseIFC : public virtual IntrusiveCountableBase
00074 {
00075 public:
00076 
00077    CppProviderBaseIFC();
00078 
00079    CppProviderBaseIFC(const CppProviderBaseIFC& arg);
00080 
00081    virtual ~CppProviderBaseIFC();
00093    virtual void initialize(const ProviderEnvironmentIFCRef& env);
00094 
00100    virtual void shuttingDown(const ProviderEnvironmentIFCRef& env);
00101 
00108    virtual CppInstanceProviderIFC* getInstanceProvider();
00109    virtual CppSecondaryInstanceProviderIFC* getSecondaryInstanceProvider();
00110    virtual CppMethodProviderIFC* getMethodProvider();
00111 #ifndef OW_DISABLE_ASSOCIATION_TRAVERSAL
00112    virtual CppAssociatorProviderIFC* getAssociatorProvider();
00113 #endif
00114    virtual CppIndicationExportProviderIFC* getIndicationExportProvider();
00115    virtual CppPolledProviderIFC* getPolledProvider();
00116    virtual CppIndicationProviderIFC* getIndicationProvider();
00117    DateTime getLastAccessTime() const;
00118    void updateAccessTime();
00119    
00120    virtual bool canUnload();
00121 
00122    bool getPersist() const;
00123    void setPersist(bool persist=true);
00124 
00125 private:
00126    DateTime m_dt;
00127    bool m_persist;
00128 };
00129 
00130 typedef SharedLibraryReference< IntrusiveReference<CppProviderBaseIFC> > CppProviderBaseIFCRef;
00131 
00132 } // end namespace OW_NAMESPACE
00133 
00134 
00135 // This is here to prevent existing code from breaking.  New code should use OW_PROVIDERFACTORY.
00136 // deprecated in 3.0.0
00137 #define OW_NOIDPROVIDERFACTORY(prov) OW_PROVIDERFACTORY(prov, NO_ID)
00138 
00139 #if !defined(OW_STATIC_SERVICES)
00140 // This macro is deprecated in 3.2.0, use OW_PROVIDERFACTORY instead.
00141 #define OW_PROVIDERFACTORY_NOID(prov, name) OW_PROVIDERFACTORY(prov, NO_ID)
00142 #define OW_PROVIDERFACTORY(prov, name) \
00143 extern "C" OW_EXPORT const char* \
00144 getOWVersion() \
00145 { \
00146    return OW_VERSION; \
00147 } \
00148 extern "C" OW_EXPORT OW_NAMESPACE::CppProviderBaseIFC* \
00149 createProvider##name() \
00150 { \
00151    return new prov; \
00152 }
00153 #else
00154 // This macro is deprecated in 3.2.0, use OW_PROVIDERFACTORY instead.
00155 #define OW_PROVIDERFACTORY_NOID(prov, name) OW_PROVIDERFACTORY(prov, NO_ID##name)
00156 #define OW_PROVIDERFACTORY(prov, name) \
00157 extern "C" OW_NAMESPACE::CppProviderBaseIFC* \
00158 createProvider##name() \
00159 { \
00160    return new prov; \
00161 }
00162 #endif /* !defined(OW_STATIC_SERVICES) */
00163 
00164 #endif

Generated on Thu Feb 9 08:47:57 2006 for openwbem by  doxygen 1.4.6