CMPI 2.1.0 API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Fields
CMPIInstanceFT Struct Reference

Function table of CMPIInstance encapsulated data type object. More...

#include <cmpift.h>

Data Fields

CMPIVersion ftVersion
 CMPI version supported by the MB for this function table. More...
 
CMPIStatus(* release )(CMPIInstance *inst)
 Release a CMPIInstance object. More...
 
CMPIInstance *(* clone )(const CMPIInstance *inst, CMPIStatus *rc)
 Create an independent copy of a CMPIInstance object. More...
 
CMPIData(* getProperty )(const CMPIInstance *inst, const char *name, CMPIStatus *rc)
 Get a property in a CMPIInstance object by name. More...
 
CMPIData(* getPropertyAt )(const CMPIInstance *inst, CMPICount index, CMPIString **name, CMPIStatus *rc)
 Get a property in a CMPIInstance object by index. More...
 
CMPICount(* getPropertyCount )(const CMPIInstance *inst, CMPIStatus *rc)
 Get the number of properties in a CMPIInstance object. More...
 
CMPIStatus(* setProperty )(const CMPIInstance *inst, const char *name, const CMPIValue *value, CMPIType type)
 Add or replace a property value in a CMPIInstance object by name. More...
 
CMPIObjectPath *(* getObjectPath )(const CMPIInstance *inst, CMPIStatus *rc)
 Get the instance path component of a CMPIInstance object. More...
 
CMPIStatus(* setPropertyFilter )(const CMPIInstance *inst, const char **properties, const char **keyList)
 Attach a property filter to a CMPIInstance object. More...
 
CMPIStatus(* setObjectPath )(const CMPIInstance *inst, const CMPIObjectPath *op)
 Set the instance path component of a CMPIInstance object. More...
 
CMPIStatus(* setPropertyWithOrigin )(const CMPIInstance *inst, const char *name, const CMPIValue *value, const CMPIType type, const char *origin)
 Add or replace a property value and class origin in a CMPIInstance object by name. More...
 

Detailed Description

Function table of CMPIInstance encapsulated data type object.

For functions that are not supported, their function pointers in the CMPIInstanceFT function table shall not be NULL, but shall point to a function that can be called and then indicates back to the caller that it is not supported, as specified in the description of the function.

Field Documentation

CMPIVersion CMPIInstanceFT::ftVersion

CMPI version supported by the MB for this function table.

Any earlier CMPI versions are implicitly also supported.

See CMPIVersion<NNN> for valid CMPI version numbers.

CMPIStatus(* CMPIInstanceFT::release)(CMPIInstance *inst)

Release a CMPIInstance object.

CMPIInstanceFT.release() releases a CMPIInstance object. This indicates to the MB that the object (including any objects it contains) will no longer be used by the MI. The MB may free (=reclaim) the memory associated with the object during the call to this function, or later during some garbage collection cycle (see Subclause 4.1.7 of the CMPI Standard).

Parameters
instPoints to the CMPIInstance object that is to be released. That object shall have been created using CMPIInstanceFT.clone().
Returns
CMPIStatus structure containing the function return status.
Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst handle is invalid.
Convenience Function
CMRelease()
CMPIInstance*(* CMPIInstanceFT::clone)(const CMPIInstance *inst, CMPIStatus *rc)

Create an independent copy of a CMPIInstance object.

CMPIInstanceFT.clone() creates an independent copy of a CMPIInstance object.

Parameters
instPoints to the CMPIInstance object that is to be copied.
[out]rcIf not NULL, points to a CMPIStatus structure that upon return will have been updated with the function return status.
Returns

If successful, a pointer to the copied CMPIInstance object will be returned.

The returned CMPIInstance object shall be explicitly released by the MI using CMPIInstanceFT.release().

If not successful, NULL will be returned.

Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst handle is invalid.
Convenience Function
CMClone()
CMPIData(* CMPIInstanceFT::getProperty)(const CMPIInstance *inst, const char *name, CMPIStatus *rc)

Get a property in a CMPIInstance object by name.

CMPIInstanceFT.getProperty() gets a gets a property in a CMPIInstance object by name.

Parameters
instPoints to the CMPIInstance object for this function.
nameProperty name.
[out]rcIf not NULL, points to a CMPIStatus structure that upon return will have been updated with the function return status.
Returns

If successful, a CMPIData structure containing the specified property will be returned.

If not successful, CMPIData.state will be undefined.

Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst handle is invalid.
  • CMPI_RC_ERR_NO_SUCH_PROPERTY - Property not found.
Convenience Function
CMGetProperty()
CMPIData(* CMPIInstanceFT::getPropertyAt)(const CMPIInstance *inst, CMPICount index, CMPIString **name, CMPIStatus *rc)

Get a property in a CMPIInstance object by index.

CMPIInstanceFT.getPropertyAt() gets a property in a CMPIInstance object by index.

Parameters
instPoints to the CMPIInstance object for this function.
indexZero-based position of the property in the internal data array.
[out]nameIf not NULL, points to a CMPIString pointer that upon success is updated to point to a CMPIString object containing the property name. The returned CMPIString object shall not be explicitly released by the MI, because it may be an internal object of the CMPIString object which will be released along with that object, or a new object created by the MB which will be released automatically by the MB (see Subclause 4.1.7 of the CMPI Standard).
[out]rcIf not NULL, points to a CMPIStatus structure that upon return will have been updated with the function return status.
Returns

If successful, a CMPIData structure containing the specified property.

If not successful, CMPIData.state will be undefined.

Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst handle is invalid.
  • CMPI_RC_ERR_NO_SUCH_PROPERTY - Property not found.
Convenience Function
CMGetPropertyAt()
CMPICount(* CMPIInstanceFT::getPropertyCount)(const CMPIInstance *inst, CMPIStatus *rc)

Get the number of properties in a CMPIInstance object.

CMPIInstanceFT.getPropertyCount() gets the number of properties in a CMPIInstance object.

Parameters
instPoints to the CMPIInstance object for this function.
[out]rcIf not NULL, points to a CMPIStatus structure that upon return will have been updated with the function return status.
Returns

If successful, a CMPICount value indicating the number of properties in the instance will be returned.

If not successful, 0 will be returned.

Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst handle is invalid.
Convenience Function
CMGetPropertyCount()
CMPIStatus(* CMPIInstanceFT::setProperty)(const CMPIInstance *inst, const char *name, const CMPIValue *value, CMPIType type)

Add or replace a property value in a CMPIInstance object by name.

CMPIInstanceFT.setProperty() adds or replaces a property value in a CMPIInstance object by name.

If the property is a key property, the function may or may not in addition add or update the key binding in the object path of the instance. In order for MIs not to be dependent on this behavior, MIs should set key property values in instances and key binding values in object paths separately. Key binding values can be set during CMPIBrokerEncFT.newInstance() and by using CMPIInstanceFT.setObjectPath(). The MI shall specify consistent values for key bindings and key properties.

Parameters
instPoints to the CMPIInstance object for this function.
nameProperty name.
valuePoints to a CMPIValue structure containing the non-NULL value to be assigned to the property, or NULL to specify that NULL is to be assigned.
type

CMPIType value specifying the type of the value to be assigned to the property.

All types of CIM values are supported.

If the value of type is CMPI_chars or CMPI_charsA, the C-language string to which the chars member of value points is copied by this function and the original string memory may be freed by the MI right after this function returns.

Returns
CMPIStatus structure containing the function return status.
Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The ctx handle is invalid.
  • CMPI_RC_ERR_TYPE_MISMATCH - type does not correspond to the class-defined type.
  • CMPI_RC_ERR_INVALID_PARAMETER - name is not a valid property name.
Convenience Function
CMSetProperty()
Change:
In CMPI 2.1, added the return code CMPI_RC_ERR_INVALID_PARAMETER.
CMPIObjectPath*(* CMPIInstanceFT::getObjectPath)(const CMPIInstance *inst, CMPIStatus *rc)

Get the instance path component of a CMPIInstance object.

CMPIInstanceFT.getObjectPath() generates a CMPIObjectPath object from the namespace, class name, and key properties of a CMPIInstance object.

Parameters
instPoints to the CMPIInstance object for this function.
[out]rcIf not NULL, points to a CMPIStatus structure that upon return will have been updated with the function return status.
Returns

If successful, a pointer to a CMPIObjectPath object representing the instance path of the CMPIInstance will be returned.

The returned CMPIObjectPath object shall not be explicitly released by the MI, because it may be an internal object of the CMPIInstance object which will be released along with that object, or a new object created by the MB which will be released automatically by the MB (see Subclause 4.1.7 of the CMPI Standard).

If not successful, NULL will be returned.

Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst handle is invalid.
Convenience Function
CMGetObjectPath()
CMPIStatus(* CMPIInstanceFT::setPropertyFilter)(const CMPIInstance *inst, const char **properties, const char **keyList)

Attach a property filter to a CMPIInstance object.

CMPIInstanceFT.setPropertyFilter() attaches a property filter to a CMPIInstance object, replacing any previous property filter settings for this object.

By calling this function, the MI delegates property list filtering to the MB for this CMPIInstance object, for all of its properties including those that had already been set before the call to setPropertyFilter().

Parameters
instPoints to the CMPIInstance object for this function.
properties

The properties that will be accepted by subsequent setProperty() function calls. The properties argument is an array of pointers to strings, terminated by a NULL pointer. A NULL value effectively means that all properties will be accepted. A pointer to an empty array means that no properties will be accepted.

The list of properties specified in the properties argument shall match the list of properties specified in the call to the MI function that calls CMPIInstanceFT.setPropertyFilter().

Parameters
keyListThis argument shall be ignored by the MB; it is here to maintain binary compatibility with previous specifications. MIs conforming to CMPI 2.0 or later shall set the key names and values via the CMPIInstanceMI.setObjectPath() function.
Returns
CMPIStatus structure containing the function return status.
Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst handle is invalid.
  • CMPI_RC_ERR_NOT_SUPPORTED - Function is not supported by the MB.
  • CMPI_RC_ERR_INVALID_PARAMETER - Invalid arguments.
Convenience Function
CMSetPropertyFilter()
Capabilities:
Part of the Property Filtering capability.
Bug:
The CMPI Standard states in the description of the CMPI_RC_ERR_INVALID_PARAMETER return code: "The keyList argument is missing", and the change history states that that return code should not be returned by the MB because the keyList argument is now ignored. That is incorrect, because that return code can also be used to indicate issues in the properties argument. The description of that return code in the document should to be updated to match the description in the header file: "Invalid arguments.".
CMPIStatus(* CMPIInstanceFT::setObjectPath)(const CMPIInstance *inst, const CMPIObjectPath *op)

Set the instance path component of a CMPIInstance object.

CMPIInstanceFT.setObjectPath() sets the instance path component of a CMPIInstance object.

The function may or may not in addition update the key property values in the instance to the values of the key bindings in the object path. In order for MIs not to be dependent on this behavior, MIs should set key property values in instances and key binding values in object paths separately. Property values can be set by using CMPIInstanceFT.setProperty() or CMPIInstanceFT.setPropertyWithOrigin(). The MI shall specify consistent values for key bindings and key properties.

Parameters
instPoints to the CMPIInstance object for this function.
opPoints to a CMPIObjectPath object. All components of the object path of the instance will be set/replaced from the object path in this argument. The object path in this argument shall specify a non-NULL namespace, a non-NULL creation class name, as well as all keys for the instance. The object path may specify a non-NULL host for the instance (this is used for instances returned by cross-host associations).
Returns
CMPIStatus structure containing the function return status.
Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst or op handle is invalid.
  • CMPI_RC_ERR_INVALID_PARAMETER - Object path components specified in op are invalid.
Convenience Function
CMSetObjectPath()
Change:
In CMPI 2.1, added the return code CMPI_RC_ERR_INVALID_PARAMETER.
CMPIStatus(* CMPIInstanceFT::setPropertyWithOrigin)(const CMPIInstance *inst, const char *name, const CMPIValue *value, const CMPIType type, const char *origin)

Add or replace a property value and class origin in a CMPIInstance object by name.

CMPIInstanceFT.setPropertyWithOrigin() adds or replaces a property value and class origin in a CMPIInstance object by name.

If the property is a key property, the function may or may not in addition add or update the key binding in the object path of the instance. In order for MIs not to be dependent on this behavior, MIs should set key property values in instances and key binding values in object paths separately. Key binding values can be set during CMPIBrokerEncFT.newInstance() and by using CMPIInstanceFT.setObjectPath(). The MI shall specify consistent values for key bindings and key properties.

Parameters
instPoints to the CMPIInstance object for this function.
nameProperty name.
valuePoints to a CMPIValue structure containing non-NULL value to be assigned to the property, or is NULL to specify that NULL is to be assigned.
type

The type of the value to be assigned to the property.

All types of CIM values are supported.

If the value of type is CMPI_chars or CMPI_charsA, the C-language string to which the chars member of value points is copied by this function and the original string memory may be freed by the MI right after this function returns.

Parameters
origin

The name of the class in which this property was originally defined. If NULL, then no origin is attached to the property.

The MB shall conform to the requirements of the client protocol regarding class origin information.

Returns
CMPIStatus structure containing the function return status.
Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The inst handle is invalid.
  • CMPI_RC_ERR_TYPE_MISMATCH - type does not correspond to class-defined type.
Convenience Function
CMSetPropertyWithOrigin()
Addition:
Added in CMPI 2.0.

The documentation for this struct was generated from the following file: