cmpi
CmpiInstance Class Reference

#include <cmpi/CmpiInstance.h>

Inheritance diagram for CmpiInstance:
CmpiObject

Public Member Functions

 CmpiInstance (const CmpiObjectPath &op)
 
CmpiBoolean instanceIsA (const char *className)
 
unsigned int getPropertyCount ()
 
CmpiData getProperty (const char *name) const
 
CmpiData getProperty (const int index, CmpiString *name=NULL)
 
void setProperty (const char *name, const CmpiData data)
 
void setPropertyFilter (const char **properties, const char **keys)
 
CmpiObjectPath getObjectPath () const
 
- Public Member Functions inherited from CmpiObject
CmpiBoolean isNull () const
 
CmpiString toString ()
 
CmpiBoolean isA (const char *typeName) const
 

Protected Member Functions

 CmpiInstance (const CMPIInstance *enc)
 
CMPIInstancegetEnc () const
 
- Protected Member Functions inherited from CmpiObject
 CmpiObject ()
 
 CmpiObject (const void *enc)
 
CmpiString doToString (CMPIBroker *mb)
 
CmpiBoolean doIsA (CMPIBroker *mb, const char *typeName) const
 

Private Member Functions

 CmpiInstance ()
 
void * makeInstance (CMPIBroker *mb, const CmpiObjectPath &cop)
 
CmpiBoolean doInstanceIsA (CMPIBroker *mb, const char *className)
 

Friends

class CmpiBroker
 
class CmpiResult
 
class CmpiInstanceMI
 
class CmpiMethodMI
 
class CmpiData
 

Additional Inherited Members

- Protected Attributes inherited from CmpiObject
void * enc
 

Detailed Description

This class represents the instance of a CIM class. It is used manipulate instances and their parts.

Constructor & Destructor Documentation

◆ CmpiInstance() [1/3]

CmpiInstance::CmpiInstance ( const CMPIInstance * enc)
protected

Protected constructor used by MIDrivers to encapsulate CMPIInstance.

References CmpiObject::enc.

◆ CmpiInstance() [2/3]

CmpiInstance::CmpiInstance ( )
private

Constructor - Should not be called

◆ CmpiInstance() [3/3]

CmpiInstance::CmpiInstance ( const CmpiObjectPath & op)

Constructor - Creates an Instance object with the classname from the input parameter.

Parameters
opdefining classname and namespace
Returns
The new Instance object

References CmpiObject::CmpiObjectPath, CmpiObject::enc, CmpiProviderBase::getBroker(), and makeInstance().

Member Function Documentation

◆ doInstanceIsA()

CmpiBoolean CmpiInstance::doInstanceIsA ( CMPIBroker * mb,
const char * className )
private

◆ getEnc()

◆ getObjectPath()

CmpiObjectPath CmpiInstance::getObjectPath ( ) const

getObjectPath - generates an ObjectPath out of the namespace, classname and key propeties of this Instance

Returns
the generated ObjectPath.

References CMPI_RC_OK, CmpiObject::CmpiObjectPath, getEnc(), and _CMPIStatus::rc.

Referenced by CmpiData, and doInstanceIsA().

◆ getProperty() [1/2]

CmpiData CmpiInstance::getProperty ( const char * name) const

getProperty - Gets the CmpiData object representing the value associated with the property name

Parameters
nameProperty name.
Returns
CmpiData value object associated with the property.

References CmpiData::_data, CMPI_RC_ERR_NOT_FOUND, CMPI_RC_OK, CmpiData, _CMPIInstance::ft, getEnc(), _CMPIInstanceFT::getProperty, _CMPIStatus::msg, and _CMPIStatus::rc.

Referenced by CmpiData.

◆ getProperty() [2/2]

CmpiData CmpiInstance::getProperty ( const int index,
CmpiString * name = NULL )

getProperty - Gets the CmpiData object defined by the input index parameter.

Parameters
indexIndex into the Property array.
nameOptional output parameter returning the property name.
Returns
CmpiData value object corresponding to the index.

References CmpiData::_data, CmpiString::charPtr(), CMPI_RC_ERR_NOT_FOUND, CMPI_RC_OK, CmpiData, _CMPIInstance::ft, getEnc(), _CMPIInstanceFT::getPropertyAt, _CMPIStatus::msg, and _CMPIStatus::rc.

◆ getPropertyCount()

unsigned int CmpiInstance::getPropertyCount ( )

getPropertyCount - Gets the number of Properties defined for this Instance.

Returns
Number of Properties of this instance.

References CMPI_RC_OK, _CMPIInstance::ft, getEnc(), _CMPIInstanceFT::getPropertyCount, and _CMPIStatus::rc.

Referenced by CmpiData.

◆ instanceIsA()

CmpiBoolean CmpiInstance::instanceIsA ( const char * className)

instanceIsA - Tests whether this CIM Instance is of type <className>.

Parameters
classNameCIM classname to be tested for.
Returns
True or False

References CmpiBoolean, doInstanceIsA(), and CmpiProviderBase::getBroker().

Referenced by CmpiData.

◆ makeInstance()

void * CmpiInstance::makeInstance ( CMPIBroker * mb,
const CmpiObjectPath & cop )
private

◆ setProperty()

void CmpiInstance::setProperty ( const char * name,
const CmpiData data )

setProperty - adds/replaces a property value defined by the input parameter to the Instance

Parameters
nameProperty name.
dataType and Value to be added.

References CmpiData::_data, _CMPIValue::chars, CMPI_chars, CMPI_RC_OK, CmpiData, _CMPIInstance::ft, getEnc(), _CMPIStatus::rc, _CMPIInstanceFT::setProperty, _CMPIData::type, and _CMPIData::value.

Referenced by CmpiData.

◆ setPropertyFilter()

void CmpiInstance::setPropertyFilter ( const char ** properties,
const char ** keys )

setPropertyFilter - specifies the list of properties that is accepted for setProperty operestions.

Parameters
propertiesList of properties
keysList of key properties (required)

References _nullkeys, CMPI_RC_OK, _CMPIInstance::ft, getEnc(), _CMPIStatus::rc, and _CMPIInstanceFT::setPropertyFilter.

Referenced by CmpiData.

Friends And Related Symbol Documentation

◆ CmpiBroker

friend class CmpiBroker
friend

References CmpiBroker.

Referenced by CmpiBroker.

◆ CmpiData

◆ CmpiInstanceMI

friend class CmpiInstanceMI
friend

References CmpiInstanceMI.

Referenced by CmpiInstanceMI.

◆ CmpiMethodMI

friend class CmpiMethodMI
friend

References CmpiMethodMI.

Referenced by CmpiMethodMI.

◆ CmpiResult

friend class CmpiResult
friend

References CmpiResult.

Referenced by CmpiResult.


The documentation for this class was generated from the following files: