CMPI 2.1.0 API
|
CMPI_EXTERN_C CMPI<mitype>MI* Generic_Create<mitype>MI( const CMPIBroker* mb, const CMPIContext* ctx, const char* miName, CMPIStatus* rc);
_Generic_Create_<mitype>MI() is a generic factory function for an MI and is responsible for intializing the MI of type <mitype>\ with the name passed in miName
.
<mitype> can be one of:
While this function executes, the MB will not call any other MI functions for this MI. This function will be called once for a specific MI, even if that MI services more than one namespace.
This function shall be declared with the CMPI_EXTERN_C modifier or an equivalent modifier; the name of this function shall be exported from the MI load library.
mb | Points to a CMPIBroker structure. This structure can be used throughout the life of this MI function group to invoke MB services. | |
ctx | Points to a CMPIContext object containing the context data for the invocation. This CMPIContext object contains the CMPIInitNameSpace entry indicating the namespace for which this MI is to be initialized. If this MI services more than one namespace, the CMPIInitNameSpace entry indicates one of those namespaces. | |
miName | Name of the MI to be initialized. | |
[out] | rc | Points to a CMPIStatus structure that upon return shall have been updated with the function return status. |
If successful, a pointer to a valid CMPI<mitype>MI structure (CMPIInstanceMI, CMPIAssociationMI, CMPIPropertyMI, CMPIMethodMI, CMPIIndicationMI) for the MI identified by <mitype> and miName
shall be returned, and the MB will consider this MI to be initialized (that is, functioning).
If not successful, NULL shall be returned, and the MI identified by <mitype> and miName
is considered uninitialized (that is, malfunctioning) and will not be used by the MB. Specifically, the cleanup function for this MI (e.g. CMPIInstanceMIFT.cleanup()) will not be invoked by the MB in that case.
CMPI_RC_OK
- Function successful. CMPI_RC_ERR_NOT_FOUND
- MI name not found. CMPI_RC_ERR_NOT_SUPPORTED
- MI type not supported for this MI name. CMPI_RC_ERR_ACCESS_DENIED
- Not authorized. CMPI_RC_ERR_FAILED
- Other error occurred.