CmpiBaseMI.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * CmpiBaseMI.h
00004  *
00005  * (C) Copyright IBM Corp. 2003
00006  *
00007  * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE
00008  * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
00009  * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
00010  *
00011  * You can obtain a current copy of the Common Public License from
00012  * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html
00013  *
00014  * Author:        Adrian Schuur <schuur@de.ibm.com>
00015  * Contributors:
00016  *
00017  * Description: CMPI C++ instance provider wrapper
00018  *
00019  */
00020 
00021 #ifndef _CmpiBaseMI_h_
00022 #define _CmpiBaseMI_h_
00023 
00024 #include "OW_config.h"
00025 
00026 #include <iostream>
00027 
00028 #include "cmpidt.h"
00029 #include "cmpift.h"
00030 #include "cmpimacs.h"
00031 
00032 #include "CmpiProviderBase.h"
00033 
00034 extern "C" CMPIInstanceMIFT CMPICppInstMIFT;
00035 extern "C" CMPIMethodMIFT CMPICppMethMIFT;
00036 class CmpiContext;
00037 class CmpiBroker;
00038 class CmpiStatus;
00039 
00040 class CmpiBaseMI {
00041   protected:
00042    CMPIBroker *broker;
00043   public:
00044    virtual ~CmpiBaseMI() {}
00045    inline CmpiBaseMI(CMPIBroker *mbp, const CmpiContext& ctx) {
00046       broker=mbp;
00047    }
00048 
00049   static CMPIStatus doDriveBaseCleanup
00050       (void* mi, CMPIContext* eCtx);
00051   inline static CMPIStatus driveBaseCleanup
00052       (CMPIInstanceMI* mi, CMPIContext* eCtx) {
00053          if (CmpiProviderBase::testAndSetOneTime(1))
00054        return doDriveBaseCleanup(mi,eCtx);
00055     CMReturn(CMPI_RC_OK);
00056    }
00057 
00058    virtual CmpiStatus initialize(const CmpiContext& ctx);
00059    virtual CmpiStatus cleanup(CmpiContext& ctx);
00060 };
00061 
00062 #endif

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