CMPI 2.1.0 API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Variables
Memory Enhancement Services (Subclause 9.15)

Variables

CMPIGcStat *(* CMPIBrokerMemFT::mark )(const CMPIBroker *mb, CMPIStatus *rc)
 Mark a new object lifecycle level for subsequent newly created CMPI encapsulated data type objects. More...
 
CMPIStatus(* CMPIBrokerMemFT::release )(const CMPIBroker *mb, const CMPIGcStat *gc)
 Release all CMPI encapsulated data type objects created at the specified object lifecycle level, and remove that level. More...
 
void *(* CMPIBrokerMemFT::cmpiMalloc )(const CMPIBroker *mb, size_t size)
 Allocate an uninitalized memory block of the specified size. More...
 
void *(* CMPIBrokerMemFT::cmpiCalloc )(const CMPIBroker *mb, size_t nElems, size_t sizeElem)
 Allocate a memory block of the specified size and initialize it to zero. More...
 
void *(* CMPIBrokerMemFT::cmpiRealloc )(const CMPIBroker *mb, void *ptr, size_t size)
 Change the size of a memory block. More...
 
char *(* CMPIBrokerMemFT::cmpiStrDup )(const CMPIBroker *mb, const char *str)
 Allocate a memory block and initialize it with a string. More...
 
void(* CMPIBrokerMemFT::cmpiFree )(const CMPIBroker *mb, void *ptr)
 Release a memory block. More...
 
void(* CMPIBrokerMemFT::freeInstance )(const CMPIBroker *mb, CMPIInstance *inst)
 Release a CMPIInstance object. More...
 
void(* CMPIBrokerMemFT::freeObjectPath )(const CMPIBroker *mb, CMPIObjectPath *obj)
 Release a CMPIObjectPath object. More...
 
void(* CMPIBrokerMemFT::freeArgs )(const CMPIBroker *mb, CMPIArgs *args)
 Release a CMPIArgs object. More...
 
void(* CMPIBrokerMemFT::freeString )(const CMPIBroker *mb, CMPIString *str)
 Release a CMPIString object. More...
 
void(* CMPIBrokerMemFT::freeArray )(const CMPIBroker *mb, CMPIArray *array)
 Release a CMPIArray object. More...
 
void(* CMPIBrokerMemFT::freeDateTime )(const CMPIBroker *mb, CMPIDateTime *dt)
 Release a CMPIDateTime object. More...
 
void(* CMPIBrokerMemFT::freeSelectExp )(const CMPIBroker *mb, CMPISelectExp *se)
 Release a CMPISelectExp object. More...
 
void(* CMPIBrokerMemFT::freeChars )(const CMPIBroker *mb, char *chars)
 Free the memory of a C-language string. More...
 

Detailed Description

Variable Documentation

CMPIGcStat*(* CMPIBrokerMemFT::mark)(const CMPIBroker *mb, CMPIStatus *rc)

Mark a new object lifecycle level for subsequent newly created CMPI encapsulated data type objects.

CMPIBrokerMemFT.mark() marks a new object lifecycle level for the calling MI. Subsequent newly created CMPI encapsulated data type objects in that MI will be associated with that new object lifecycle level. A subsequent invocation of CMPIBrokerMemFT.release() with the returned CMPIGcStat pointer will release only the objects associated with that object lifecycle level.

The mark() and release() function calls may be stacked.

Stacked object lifecycle levels shall not overlap other than inner levels being completely contained in outer levels.

Parameters
mbPoints to a CMPIBroker structure.
[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 CMPIGcStat structure will be returned, for use with CMPIBrokerMemFT.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 mb handle is invalid
  • CMPI_RC_ERR_FAILED - Other error occurred.
Convenience Function
CMMemMark()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
Bug:
The CMPI Standard has an incorrect statement "Stacked object lifecycle levels shall not overlap.". That is not correct, because nested levels by definition overlap. It should be updated to use the more specific statement from the header file.
CMPIStatus(* CMPIBrokerMemFT::release)(const CMPIBroker *mb, const CMPIGcStat *gc)

Release all CMPI encapsulated data type objects created at the specified object lifecycle level, and remove that level.

CMPIBrokerMemFT.release() releases all CMPI encapsulated data type objects created other than with clone() at the specified object lifecycle level, and removes that object lifecycle level. This indicates to the MB that these objects (including any objects they contain) will no longer be used by the MI. The MB may free (=reclaim) the memory associated with these objects during the call to this function, or later during some garbage collection cycle (see Subclause 4.1.7 of the CMPI Standard).

The mark() and release() function calls may be stacked. See CMPIBrokerMemFT.mark() for details.

Parameters
mbPoints to a CMPIBroker structure.
gcPoints to the CMPIGcStat structure returned from the CMPIBrokerMemFT.mark() function, that identifies the object lifecycle level.
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 mb handle is invalid
  • CMPI_RC_ERR_FAILED - Other error occurred.
Convenience Function
CMMemRelease()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void*(* CMPIBrokerMemFT::cmpiMalloc)(const CMPIBroker *mb, size_t size)

Allocate an uninitalized memory block of the specified size.

CMPIBrokerMemFT.cmpiMalloc() allocates an uninitalized memory block of the specified size. This function behaves consistently with the POSIX malloc() function (see IEEE 1003.1).

The allocated memory block can be explicitly released by the MI using CMPIBrokerMemFT.cmpiFree(), or will be automatically released by the MB after cleanup of the MI (see Subclause 4.1.7 of the CMPI Standard).

Parameters
mbPoints to a CMPIBroker structure.
sizeAmount of memory to allocate, in Bytes.
Returns

If successful, a pointer to the allocated memory block will be returned.

If not successful, NULL will be returned.

Errors
No additional error information is passed back.
Convenience Function
CMMalloc()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void*(* CMPIBrokerMemFT::cmpiCalloc)(const CMPIBroker *mb, size_t nElems, size_t sizeElem)

Allocate a memory block of the specified size and initialize it to zero.

CMPIBrokerMemFT.cmpiCalloc() allocates a memory block of the specified size and initializes it to zero. This function behaves consistently with the POSIX calloc() function (see IEEE 1003.1). The allocated memory block can be explicitly released by the MI using CMPIBrokerMemFT.cmpiFree(), or will be automatically released by the MB after cleanup of the MI (see Subclause 4.1.7 of the CMPI Standard).

Parameters
mbPoints to a CMPIBroker structure.
nElemsNumber of elements to allocate.
sizeElemSize of each element to allocate, in Bytes.
Returns

If successful, a pointer to the allocated and initialized memory block will be returned.

If not successful, NULL will be returned.

Errors
No additional error information is passed back.
Convenience Function
CMCalloc()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void*(* CMPIBrokerMemFT::cmpiRealloc)(const CMPIBroker *mb, void *ptr, size_t size)

Change the size of a memory block.

CMPIBrokerMemFT.cmpiRealloc() changes the size of the memory block pointed to by ptr which shall have been returned by a previous call to CMPIBrokerMemFT.cmpiMalloc() or CMPIBrokerMemFT.cmpiCalloc(). This function behaves consistently with the POSIX realloc() function (see IEEE 1003.1). The allocated memory block can be explicitly released by the MI using CMPIBrokerMemFT.cmpiFree(), or will be automatically released by the MB after cleanup of the MI (see Subclause 4.1.7 of the CMPI Standard).

The function may move the memory block to a new location (whose address is returned by the function). The content of the memory block is preserved up to the lesser of the new and old sizes, even if the block is moved to a new location. If the new size is larger, the value of the newly allocated portion is indeterminate.

Parameters
mbPoints to a CMPIBroker structure.
ptrIf not NULL, points to previosuly allocated memory. Passing a non-NULL pointer to this function which was not allocated explicitly by cmpiMalloc() or cmpiCalloc() is undefined. If ptr is NULL, the function behaves like cmpiMalloc(), assigning a new memory block of size Bytes and returning a pointer to its beginning.
sizeNew size of the memory block, in Bytes. The new size may be larger or smaller than (or equal to) the current size.
Returns

If successful, a pointer to the resized memory block will be returned.

If not successful, NULL will be returned returned and the original memory block pointed to by ptr is not deallocated and is unchanged.

Errors
No additional error information is passed back.
Convenience Function
CMRealloc()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
char*(* CMPIBrokerMemFT::cmpiStrDup)(const CMPIBroker *mb, const char *str)

Allocate a memory block and initialize it with a string.

CMPIBrokerMemFT.cmpiStrDup() allocates a memory block and initializes it by copying a C-language string into it. This function behaves consistently with the POSIX strdup() function (see IEEE 1003.1). The allocated memory block can be explicitly released by the MI using CMPIBrokerMemFT.cmpiFree(), or will be automatically released by the MB after cleanup of the MI (see Subclause 4.1.7 of the CMPI Standard).

Parameters
mbPoints to a CMPIBroker structure.
strC-language string to be duplicated.
Returns

If successful, a pointer to the new memory block (that is, to the new C-language string) will be returned.

If not successful, NULL will be returned returned.

Errors
No additional error information is passed back.
Convenience Function
CMStrDup()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void(* CMPIBrokerMemFT::cmpiFree)(const CMPIBroker *mb, void *ptr)

Release a memory block.

CMPIBrokerMemFT.cmpiFree() releases a memory block. This function behaves consistently with the POSIX free() function (see IEEE 1003.1). This indicates to the MB that the memory block will no longer be used by the MI. The MB may free (=reclaim) the memory block during the call to this function, or later during some garbage collection cycle (see Subclause 4.1.7 of the CMPI Standard). Memory blocks that have not been explicitly released that way, will be automatically released after cleanup of the MI.

Parameters
mbPoints to a CMPIBroker structure.
ptrPoints to the memory block to free. The memory block shall have been allocated via the cmpiMalloc(), cmpiCalloc(), cmpiRealloc(), or cmpiStrDup() functions.
Returns
None.
Errors
This function does not indicate whether it succeeded or failed.
Convenience Function
CMFree()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void(* CMPIBrokerMemFT::freeInstance)(const CMPIBroker *mb, CMPIInstance *inst)

Release a CMPIInstance object.

CMPIBrokerMemFT.freeInstance() 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
mbPoints to a CMPIBroker structure.
instPoints to the CMPIInstance object that is to be released. That object shall have been created using CMPIBrokerEncFT.newInstance().
Returns
None.
Errors
This function does not indicate whether it succeeded or failed.
Convenience Function
CMFreeInstance()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void(* CMPIBrokerMemFT::freeObjectPath)(const CMPIBroker *mb, CMPIObjectPath *obj)

Release a CMPIObjectPath object.

CMPIBrokerMemFT.freeObjectPath() releases a CMPIObjectPath 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
mbPoints to a CMPIBroker structure.
objPoints to the CMPIObjectPath object that is to be released. That object shall have been created using CMPIBrokerEncFT.newObjectPath().
Returns
None.
Errors
This function does not indicate whether it succeeded or failed.
Convenience Function
CMFreeObjectPath()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void(* CMPIBrokerMemFT::freeArgs)(const CMPIBroker *mb, CMPIArgs *args)

Release a CMPIArgs object.

CMPIBrokerMemFT.freeArgs() releases a CMPIArgs 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
mbPoints to a CMPIBroker structure.
argsPoints to the CMPIArgs object that is to be released. That object shall have been created using CMPIBrokerEncFT.newArgs().
Returns
None.
Errors
This function does not indicate whether it succeeded or failed.
Convenience Function
CMFreeArgs()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void(* CMPIBrokerMemFT::freeString)(const CMPIBroker *mb, CMPIString *str)

Release a CMPIString object.

CMPIBrokerMemFT.freeString() releases a CMPIString 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
mbPoints to a CMPIBroker structure.
strPoints to the CMPIString object that is to be released. That object shall have been created using CMPIBrokerEncFT.newString() or CMPIBrokerEncFT.newStringCP().
Returns
None.
Errors
This function does not indicate whether it succeeded or failed.
Convenience Function
CMFreeString()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void(* CMPIBrokerMemFT::freeArray)(const CMPIBroker *mb, CMPIArray *array)

Release a CMPIArray object.

CMPIBrokerMemFT.freeArray() 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
mbPoints to a CMPIBroker structure.
arrayPoints to the CMPIArray object that is to be released. That object shall have been created using CMPIBrokerEncFT.newArray().
Returns
None.
Errors
This function does not indicate whether it succeeded or failed.
Convenience Function
CMFreeArray()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
void(* CMPIBrokerMemFT::freeDateTime)(const CMPIBroker *mb, CMPIDateTime *dt)

Release a CMPIDateTime object.

CMPIBrokerMemFT.freeDateTime() releases a CMPIDateTime 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
mbPoints to a CMPIBroker structure.
dtPoints to the CMPIDateTime object that is to be released. That object shall have been created using CMPIBrokerEncFT.newDateTime(), CMPIBrokerEncFT.newDateTimeFromBinary(), or CMPIBrokerEncFT.newDateTimeFromChars().
Returns
None.
Errors
This function does not indicate whether it succeeded or failed.
Convenience Function
CMFreeDateTime()
Capabilities:
Part of the Memory Enhancement Services capability.
Addition:
Added in CMPI 2.0.
Bug:
The CMPI Standard only allows CMPIBrokerEncFT.newDateTime() as a creating function. This is incomplete, and CMPIBrokerEncFT.newDateTimeFromBinary() and CMPIBrokerEncFT.newDateTimeFromChars() are additional functions that may have created the object.
void(* CMPIBrokerMemFT::freeSelectExp)(const CMPIBroker *mb, CMPISelectExp *se)

Release a CMPISelectExp object.

CMPIBrokerMemFT.freeSelectExp() releases a CMPISelectExp 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
mbPoints to a CMPIBroker structure.
sePoints to the CMPISelectExp object that is to be released. That object shall have been created using CMPIBrokerEncFT.newSelectExp().
Returns
None.
Errors
This function does not indicate whether it succeeded or failed.
Convenience Function
CMFreeSelectExp()
Capabilities:
Part of the Memory Enhancement Services capability. This function can be implemented only if the Query Normalization capability is supported as well.
Addition:
Added in CMPI 2.0.
Todo:
TBD KS: Note that there appears to be no OpenPegasus use of any of these free functions.
void(* CMPIBrokerMemFT::freeChars)(const CMPIBroker *mb, char *chars)

Free the memory of a C-language string.

CMPIBrokerMemFT.freeChars() releases a C-language string. This indicates to the MB that the string will no longer be used by the MI. The MB may free (=reclaim) the memory associated with the string during the call to this function, or later during some garbage collection cycle (see Subclause 4.1.7 of the CMPI Standard).

Parameters
mbPoints to a CMPIBroker structure.
charsPoints to the C-language string to be released. This C-language string shall have been created using CMPIStringFT.newCharsCP().
Returns
None.
Convenience Function
CMFreeChars()
Capabilities:
Part of the Memory Enhancement Services capability. This function can be implemented only if the Query Normalization capability is supported as well.
Addition:
Added in CMPI 2.1.
Bug:
The CMPI Standard misses to document the additional precondition of supporting the Codepage Conversion capability, for implementing this function. That should be added.