CmpiInstance Class Reference

This class represents the instance of a CIM class. More...

#include <CmpiInstance.h>

Inheritance diagram for CmpiInstance:

Inheritance graph
[legend]
Collaboration diagram for CmpiInstance:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CmpiInstance (const CMPIInstance *enc)
 Protected constructor used by MIDrivers to encapsulate CMPIInstance.
CMPIInstancegetEnc () const
 Gets the encapsulated CMPIInstance.
 CmpiInstance ()
 Constructor - Should not be called.
void * makeInstance (CMPIBroker *mb, const CmpiObjectPath &cop)
 Internal make function.
CMPIBoolean doInstanceIsA (CMPIBroker *mb, const char *className)
 CmpiInstance (const CmpiObjectPath &op)
 Constructor - Creates an Instance object with the classname from the input parameter.
CMPIBoolean instanceIsA (const char *className)
 instanceIsA - Tests whether this CIM Instance is of type <className>.
unsigned int getPropertyCount ()
 getPropertyCount - Gets the number of Properties defined for this Instance.
CmpiData getProperty (const char *name)
 getProperty - Gets the CmpiData object representing the value associated with the property name
CmpiData getProperty (const int index, CmpiString *name=NULL)
 getProperty - Gets the CmpiData object defined by the input index parameter.
void setProperty (const char *name, const CmpiData data)
 setProperty - adds/replaces a property value defined by the input parameter to the Instance
CmpiObjectPath getObjectPath ()
 getObjectPath - generates an ObjectPath out of the namespace, classname and key propeties of this Instance

Friends

class CmpiBroker
class CmpiResult
class CmpiInstanceMI
class CmpiMethodMI
class CmpiData

Detailed Description

This class represents the instance of a CIM class.

It is used manipulate instances and their parts.

Definition at line 42 of file CmpiInstance.h.


Constructor & Destructor Documentation

CmpiInstance::CmpiInstance const CMPIInstance enc  )  [inline]
 

Protected constructor used by MIDrivers to encapsulate CMPIInstance.

Definition at line 53 of file CmpiInstance.h.

References CmpiObject::enc.

CmpiInstance::CmpiInstance  )  [inline]
 

Constructor - Should not be called.

Definition at line 64 of file CmpiInstance.h.

CmpiInstance::CmpiInstance const CmpiObjectPath op  )  [inline]
 

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

Parameters:
op defining classname and namespace
Returns:
The new Instance object

Definition at line 77 of file CmpiInstance.h.

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


Member Function Documentation

CMPIBoolean CmpiInstance::doInstanceIsA CMPIBroker mb,
const char *  className
 

Definition at line 730 of file CmpiImpl.cpp.

References cop, and getObjectPath().

Referenced by instanceIsA().

CMPIInstance* CmpiInstance::getEnc  )  const [inline]
 

Gets the encapsulated CMPIInstance.

Definition at line 58 of file CmpiInstance.h.

References CmpiObject::enc.

Referenced by getObjectPath(), getProperty(), getPropertyCount(), makeInstance(), CmpiResult::returnData(), and setProperty().

CmpiObjectPath CmpiInstance::getObjectPath  ) 
 

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

Returns:
the generated ObjectPath.

Definition at line 767 of file CmpiImpl.cpp.

References CMPI_RC_OK, cop, getEnc(), and _CMPIStatus::rc.

Referenced by doInstanceIsA().

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

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

Parameters:
index Index into the Property array.
name Optional output parameter returning the property name.
Returns:
CmpiData value object corresponding to the index.

Definition at line 743 of file CmpiImpl.cpp.

References CMPI_RC_OK, CmpiData::data, _CMPIInstance::ft, getEnc(), _CMPIInstanceFT::getPropertyAt, name, _CMPIStatus::rc, and s.

CmpiData CmpiInstance::getProperty const char *  name  ) 
 

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

Parameters:
name Property name.
Returns:
CmpiData value object associated with the property.

Definition at line 735 of file CmpiImpl.cpp.

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

unsigned int CmpiInstance::getPropertyCount  ) 
 

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

Returns:
Number of Properties of this instance.

Definition at line 753 of file CmpiImpl.cpp.

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

CMPIBoolean CmpiInstance::instanceIsA const char *  className  )  [inline]
 

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

Parameters:
className CIM classname to be tested for.
Returns:
True or False

Definition at line 85 of file CmpiInstance.h.

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

void * CmpiInstance::makeInstance CMPIBroker mb,
const CmpiObjectPath cop
 

Internal make function.

Definition at line 723 of file CmpiImpl.cpp.

References CMPI_RC_OK, cop, _CMPIBroker::eft, getEnc(), inst, _CMPIBrokerEncFT::newInstance, and _CMPIStatus::rc.

Referenced by CmpiInstance().

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

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

Parameters:
name Property name.
data Type and Value to be added.

Definition at line 760 of file CmpiImpl.cpp.

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


Friends And Related Function Documentation

friend class CmpiBroker [friend]
 

Reimplemented from CmpiObject.

Definition at line 43 of file CmpiInstance.h.

friend class CmpiData [friend]
 

Definition at line 47 of file CmpiInstance.h.

friend class CmpiInstanceMI [friend]
 

Definition at line 45 of file CmpiInstance.h.

friend class CmpiMethodMI [friend]
 

Definition at line 46 of file CmpiInstance.h.

friend class CmpiResult [friend]
 

Definition at line 44 of file CmpiInstance.h.


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:12:07 2006 for openwbem by  doxygen 1.4.6