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

Function table of CMPIArray 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 )(CMPIArray *ar)
 Release a CMPIArray object. More...
 
CMPIArray *(* clone )(const CMPIArray *ar, CMPIStatus *rc)
 Create an independent copy of a CMPIArray object. More...
 
CMPICount(* getSize )(const CMPIArray *ar, CMPIStatus *rc)
 Get the number of array elements in a CMPIArray object. More...
 
CMPIType(* getSimpleType )(const CMPIArray *ar, CMPIStatus *rc)
 Get the type of the array elements in a CMPIArray object. More...
 
CMPIData(* getElementAt )(const CMPIArray *ar, CMPICount index, CMPIStatus *rc)
 Get the value of an array element in a CMPIArray object by index. More...
 
CMPIStatus(* setElementAt )(const CMPIArray *ar, CMPICount index, const CMPIValue *value, CMPIType type)
 Set the value of an existing array element in a CMPIArray object by index. More...
 

Detailed Description

Function table of CMPIArray encapsulated data type object.

Field Documentation

CMPIVersion CMPIArrayFT::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(* CMPIArrayFT::release)(CMPIArray *ar)

Release a CMPIArray object.

CMPIArrayFT.release() releases a CMPIArray 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
arPoints to the CMPIArray object that is to be released. That object shall have been created using CMPIArrayFT.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 ar handle is invalid.
Convenience Function
CMRelease()
CMPIArray*(* CMPIArrayFT::clone)(const CMPIArray *ar, CMPIStatus *rc)

Create an independent copy of a CMPIArray object.

CMPIArrayFT.clone() creates an independent copy of a CMPIArray object.

Parameters
arPoints to the CMPIArray 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 CMPIArray object will be returned.

The returned CMPIArray object shall be explicitly released by the MI using CMPIArrayFT.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 ar handle is invalid.
Convenience Function
CMClone()
CMPICount(* CMPIArrayFT::getSize)(const CMPIArray *ar, CMPIStatus *rc)

Get the number of array elements in a CMPIArray object.

CMPIArrayFT.getSize() gets the number of array elements in a CMPIArray object.

Parameters
arPoints to the CMPIArray 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 array elements 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 ar handle is invalid.
Convenience Function
CMGetArrayCount()
CMPIType(* CMPIArrayFT::getSimpleType)(const CMPIArray *ar, CMPIStatus *rc)

Get the type of the array elements in a CMPIArray object.

CMPIArrayFT.getSimpleType() gets the type of the array elements in a CMPIArray object.

Parameters
arPoints to the CMPIArray 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 CMPIType value indicating the type of the CMPIArray elements will be returned. The returned value indicates the type of single array elements; for example, the value returned for a CMPIArray object that contains CMPIString objects, will be CMPI_string, and not CMPI_stringA.

If not successful, CMPI_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 ar handle is invalid.
Convenience Function
CMGetArrayType()
CMPIData(* CMPIArrayFT::getElementAt)(const CMPIArray *ar, CMPICount index, CMPIStatus *rc)

Get the value of an array element in a CMPIArray object by index.

CMPIArrayFT.getElementAt() gets the value of an array element of an array element in a CMPIArray object by index.

Parameters
arPoints to the CMPIArray object for this function.
indexZero-based position of the array element in the CMPIArray. The position shall be equal to or greater than 0 and less than the size of the array.
[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 array element 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 ar handle is invalid.
  • CMPI_RC_ERR_NO_SUCH_PROPERTY - index value out of range.
Convenience Function
CMGetArrayElementAt()
CMPIStatus(* CMPIArrayFT::setElementAt)(const CMPIArray *ar, CMPICount index, const CMPIValue *value, CMPIType type)

Set the value of an existing array element in a CMPIArray object by index.

CMPIArrayFT.setElementAt() sets the value of an existing array element in a CMPIArray object by index.

Parameters
arPoints to the CMPIArray object for this function.
indexZero-based position of the existing element in the CMPIArray object. The position shall be equal to or greater than 0 and less than the size of the array.
valuePoints to a CMPIValue structure containing the non-NULL value to be assigned to the element, or is NULL to specify that the element will be set to NULL.
type

Either the simple base type of the array or CMPI_null.

The use of CMPI_null for type is deprecated. Specify the simple base type of the array instead. (Deprecated)

If the value of type is CMPI_chars, 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.

If not successful, the array element’s state shall be set to CMPI_nullValue, if possible.

This behavior has been deprecated in CMPI 2.1, and callers should now assume that it is undefined whether the array element's state has changed in case of error. (Deprecated)

Errors
The function return status will indicate one of the following CMPIrc codes:
  • CMPI_RC_OK - Function successful.
  • CMPI_RC_ERR_INVALID_HANDLE - The ar handle is invalid.
  • CMPI_RC_ERR_NO_SUCH_PROPERTY - index value out of range.
  • CMPI_RC_ERR_TYPE_MISMATCH - type does not correspond to the simple base type of ar.
  • CMPI_RC_ERR_INVALID_PARAMETER - value is invalid.
Convenience Function
CMSetArrayElementAt()
Change:
In CMPI 2.1, added the return code CMPI_RC_ERR_INVALID_PARAMETER.
Deprecated:

The use of CMPI_null for type is deprecated since CMPI 2.1. Specify the simple base type of the array instead.

The behavior of setting the array element's state to CMPI_nullValue when the function was not successful, is deprecated since CMPI 2.1. Instead, callers should assume that it is undefined whether the array element's state has changed when the function was not successful.


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