CIMParameter Class Reference

#include <CIMParameter.h>

Public Member Functions

 CIMParameter ()
 
 CIMParameter (const CIMParameter &x)
 
 CIMParameter (const CIMName &name, CIMType type, Boolean isArray=false, Uint32 arraySize=0, const CIMName &referenceClassName=CIMName())
 
 ~CIMParameter ()
 
CIMParameteroperator= (const CIMParameter &x)
 
const CIMNamegetName () const
 
void setName (const CIMName &name)
 
Boolean isArray () const
 
Uint32 getArraySize () const
 
const CIMNamegetReferenceClassName () const
 
CIMType getType () const
 
CIMParameteraddQualifier (const CIMQualifier &x)
 
Uint32 findQualifier (const CIMName &name) const
 
CIMQualifier getQualifier (Uint32 index)
 
void removeQualifier (Uint32 index)
 
CIMConstQualifier getQualifier (Uint32 index) const
 
Uint32 getQualifierCount () const
 
Boolean isUninitialized () const
 
Boolean identical (const CIMConstParameter &x) const
 
CIMParameter clone () const
 

Detailed Description

The CIMParameter class represents the DMTF standard CIM parameter definition. A CIMParameter is generally defined in the context of a CIMMethod. A CIM Parameter consists of:

  • A CIMName containing the name of the parameter
  • A CIMType defining the parameter type
  • A Boolean indicating whether it is an Array parameter
  • A Uint32 indicating the size of the Array, if the parameter is an Array parameter
  • A CIMName containing the reference class name for this parameter, if the parameter is of reference type
  • Zero or more CIMQualifier objects

The CIMParameter class uses a shared representation model, such that multiple CIMParameter objects may refer to the same data copy. Assignment and copy operators create new references to the same data, not distinct copies. An update to a CIMParameter object affects all the CIMParameter objects that refer to the same data copy. The data remains valid until all the CIMParameter objects that refer to it are destructed. A separate copy of the data may be created using the clone method.

Constructor & Destructor Documentation

◆ CIMParameter() [1/3]

CIMParameter::CIMParameter ( )

Constructs an uninitialized CIMParameter object. A method invocation on an uninitialized object will result in the throwing of an UninitializedObjectException. An uninitialized object may be converted into an initialized object only by using the assignment operator with an initialized object.

◆ CIMParameter() [2/3]

CIMParameter::CIMParameter ( const CIMParameter x)

Constructs a CIMParameter object from the value of a specified CIMParameter object, so that both objects refer to the same data copy.

Parameters
xThe CIMParameter object from which to construct a new CIMParameter object.

◆ CIMParameter() [3/3]

CIMParameter::CIMParameter ( const CIMName name,
CIMType  type,
Boolean  isArray = false,
Uint32  arraySize = 0,
const CIMName referenceClassName = CIMName() 
)

Constructs a CIMParameter object with the specified attributes.

Parameters
nameA CIMName specifying the name of the parameter.
typeA CIMType defining the parameter type.
isArrayA Boolean indicating whether it is an Array parameter.
arraySizeA Uint32 indicating the size of the Array, if the parameter is an Array parameter. The default value of zero indicates a variable size array.
referenceClassNameA CIMName containing the reference class name for this parameter, if the parameter is of reference type.
Exceptions
TypeMismatchExceptionIf the parameter is of reference type and referenceClassName is null or if the parameter is not of reference type and referenceClassName is not null.
TypeMismatchExceptionIf isArray is true and arraySize is not zero.
UninitializedObjectExceptionIf the parameter name is null.

◆ ~CIMParameter()

CIMParameter::~CIMParameter ( )

Destructs the CIMParameter object.

Member Function Documentation

◆ addQualifier()

CIMParameter& CIMParameter::addQualifier ( const CIMQualifier x)

Adds a qualifier to the parameter.

Parameters
xThe CIMQualifier to be added.
Returns
A reference to this CIMParameter object.
Exceptions
AlreadyExistsExceptionIf a qualifier with the same name already exists in the CIMParameter.
UninitializedObjectExceptionIf the object is not initialized.

◆ clone()

CIMParameter CIMParameter::clone ( ) const

Makes a deep copy of the parameter. This creates a new copy of all the parameter attributes including qualifiers.

Returns
A new copy of the CIMParameter object.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ findQualifier()

Uint32 CIMParameter::findQualifier ( const CIMName name) const

Finds a qualifier by name.

Parameters
nameA CIMName specifying the name of the qualifier to be found.
Returns
Index of the qualifier if found or PEG_NOT_FOUND if not found.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getArraySize()

Uint32 CIMParameter::getArraySize ( ) const

Gets the array size for the parameter.

Returns
Uint32 array size.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getName()

const CIMName& CIMParameter::getName ( ) const

Gets the parameter name.

Returns
A CIMName containing the name of the parameter.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getQualifier() [1/2]

CIMQualifier CIMParameter::getQualifier ( Uint32  index)

Gets the qualifier at the specified index.

Parameters
indexThe index of the qualifier to be retrieved.
Returns
The CIMQualifier at the specified index.
Exceptions
IndexOutOfBoundsExceptionIf the index is outside the range of qualifiers available for the CIMParameter.
UninitializedObjectExceptionIf the object is not initialized.

◆ getQualifier() [2/2]

CIMConstQualifier CIMParameter::getQualifier ( Uint32  index) const

Gets the qualifier at the specified index.

Parameters
indexThe index of the qualifier to be retrieved.
Returns
The CIMConstQualifier at the specified index.
Exceptions
IndexOutOfBoundsExceptionIf the index is outside the range of qualifiers available for the CIMParameter.
UninitializedObjectExceptionIf the object is not initialized.

◆ getQualifierCount()

Uint32 CIMParameter::getQualifierCount ( ) const

Gets the number of qualifiers in the parameter.

     // loop to access all qualifiers in a CIMparameter
     CIMParameter parm;
     ....               // build the parameter
     for (Uint32 i = 0 ; i < parm.getQualifierCount() ; i++)
         ....
Returns
An integer count of the CIMQualifiers in the CIMParameter.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getReferenceClassName()

const CIMName& CIMParameter::getReferenceClassName ( ) const

Gets the reference class name for the parameter.

Returns
A CIMName containing the reference class name for the parameter if the parameter is of reference type, a null CIMName otherwise.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getType()

CIMType CIMParameter::getType ( ) const

Gets the parameter type.

Returns
A CIMType indicating the type of this parameter.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ identical()

Boolean CIMParameter::identical ( const CIMConstParameter x) const

Compares the parameter with another parameter.

Parameters
xThe CIMConstParameter to be compared.
Returns
True if this parameter is identical to the one specified, false otherwise.
Exceptions
UninitializedObjectExceptionIf either of the objects is not initialized.

◆ isArray()

Boolean CIMParameter::isArray ( ) const

Checks whether the parameter is an Array parameter.

Returns
True if the parameter is an Array parameter, false otherwise.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ isUninitialized()

Boolean CIMParameter::isUninitialized ( ) const

Determines whether the object has been initialized.

Returns
True if the object has not been initialized, false otherwise.

◆ operator=()

CIMParameter& CIMParameter::operator= ( const CIMParameter x)

Assigns the value of the specified CIMParameter object to this object, so that both objects refer to the same data copy.

Parameters
xThe CIMParameter object from which to assign this CIMParameter object.
Returns
A reference to this CIMParameter object.

◆ removeQualifier()

void CIMParameter::removeQualifier ( Uint32  index)

Removes a qualifier from the parameter.

Parameters
indexIndex of the qualifier to be removed.
Exceptions
IndexOutOfBoundsExceptionIf the index is outside the range of qualifiers available for the CIMParameter.
UninitializedObjectExceptionIf the object is not initialized.

◆ setName()

void CIMParameter::setName ( const CIMName name)

Sets the parameter name.

Parameters
nameA CIMName indicating the new name for the parameter.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.
ExceptionIf the object is already contained by CIMMethod

The documentation for this class was generated from the following file:
  • /home/loongson/rpmbuild/BUILD/pegasus/src/Pegasus/Common/CIMParameter.h