CIMConstMethod Class Reference

#include <CIMMethod.h>

Public Member Functions

 CIMConstMethod ()
 
 CIMConstMethod (const CIMConstMethod &x)
 
 CIMConstMethod (const CIMMethod &x)
 
 CIMConstMethod (const CIMName &name, CIMType type, const CIMName &classOrigin=CIMName(), Boolean propagated=false)
 
 ~CIMConstMethod ()
 
CIMConstMethodoperator= (const CIMConstMethod &x)
 
CIMConstMethodoperator= (const CIMMethod &x)
 
const CIMNamegetName () const
 
CIMType getType () const
 
const CIMNamegetClassOrigin () const
 
Boolean getPropagated () const
 
Uint32 findQualifier (const CIMName &name) const
 
CIMConstQualifier getQualifier (Uint32 index) const
 
Uint32 getQualifierCount () const
 
Uint32 findParameter (const CIMName &name) const
 
CIMConstParameter getParameter (Uint32 index) const
 
Uint32 getParameterCount () const
 
Boolean isUninitialized () const
 
Boolean identical (const CIMConstMethod &x) const
 
CIMMethod clone () const
 

Detailed Description

The CIMConstMethod class provides a const interface to a CIMMethod object. This class is needed because the shared representation model used by CIMMethod does not prevent modification to a const CIMMethod object. Note that the value of a CIMConstMethod object could still be modified by a CIMMethod object that refers to the same data copy.

Constructor & Destructor Documentation

◆ CIMConstMethod() [1/4]

CIMConstMethod::CIMConstMethod ( )

Constructs an uninitialized CIMConstMethod 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.

◆ CIMConstMethod() [2/4]

CIMConstMethod::CIMConstMethod ( const CIMConstMethod x)

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

Example:

    CIMConstMethod cm1(CIMName ("getHostName"), CIMTYPE_STRING);
    CIMConstMethod cm2(m1);
Parameters
xThe CIMConstMethod object from which to construct a new CIMConstMethod object.

◆ CIMConstMethod() [3/4]

CIMConstMethod::CIMConstMethod ( const CIMMethod x)

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

Example:

    CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    CIMConstMethod cm1(m1);
Parameters
xThe CIMMethod object from which to construct a new CIMConstMethod object.

◆ CIMConstMethod() [4/4]

CIMConstMethod::CIMConstMethod ( const CIMName name,
CIMType  type,
const CIMName classOrigin = CIMName(),
Boolean  propagated = false 
)

Constructs a CIMConstMethod object with the specified attributes.

Example:

    CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
Parameters
nameCIMName defining the name for the method.
typeCIMType defining the method return type.
classOrigin(optional) CIMName representing the class origin. Note that this should normally not be used. If not provided set to CIMName() (Null name).
propagatedOptional flag indicating whether the definition of the CIM Method is local to the CIM Class (respectively, Instance) in which it appears, or was propagated without modification from a superclass. Default is false. Note that this attribute is normally not set by CIM Clients but is used internally within the CIM Server.
Exceptions
UninitializedObjectExceptionIf the method name is null.

◆ ~CIMConstMethod()

CIMConstMethod::~CIMConstMethod ( )

Destructs the CIMConstMethod object.

Member Function Documentation

◆ clone()

CIMMethod CIMConstMethod::clone ( ) const

Makes a deep copy of the method. This creates a new copy of all the method attributes including parameters and qualifiers.

Returns
A CIMMethod object with a separate copy of the CIMConstMethod object.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ findParameter()

Uint32 CIMConstMethod::findParameter ( const CIMName name) const

Finds a parameter by name.

Example:

    Uint32 posParameter;
    posParameter = m1.findParameter(CIMName ("ipaddress"));
    if (posParameter != PEG_NOT_FOUND)
        ...
Parameters
nameA CIMName specifying the name of the parameter to be found.
Returns
Index of the parameter if found or PEG_NOT_FOUND if not found.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ findQualifier()

Uint32 CIMConstMethod::findQualifier ( const CIMName name) const

Finds a qualifier by name.

Example:

    CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
    CIMConstMethod m2(m1);
    assert(m2.findQualifier(CIMName ("stuff")) != PEG_NOT_FOUND);
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.

◆ getClassOrigin()

const CIMName& CIMConstMethod::getClassOrigin ( ) const

Gets the class in which this method was defined. This information is normally available with methods that are part of a schema returned from a CIM Server.

Returns
CIMName containing the classOrigin attribute.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getName()

const CIMName& CIMConstMethod::getName ( ) const

Gets the name of the method.

Example:

    CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    assert(m1.getName() == CIMName ("getHostName"));
Returns
CIMName with the name of the method.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getParameter()

CIMConstParameter CIMConstMethod::getParameter ( Uint32  index) const

Gets the parameter at the specified index.

Example:

    CIMConstParameter cp;
    Uint32 parameterIndex = m1.findParameter(CIMName ("ipaddress"));
    if (parameterIndex != PEG_NOT_FOUND)
    {
        cp = m1.getParameter(parameterIndex);
    }
Parameters
indexThe index of the parameter to be retrieved.
Returns
The CIMConstParameter at the specified index.
Exceptions
IndexOutOfBoundsExceptionIf the index is outside the range of parameters available for the CIMMethod.
UninitializedObjectExceptionIf the object is not initialized.

◆ getParameterCount()

Uint32 CIMConstMethod::getParameterCount ( ) const

Gets the number of parameters in the method.

Returns
An integer count of the CIMParameters in the CIMMethod.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getPropagated()

Boolean CIMConstMethod::getPropagated ( ) const

Tests the propagated attribute of the object. The propagated attribute indicates whether this method was propagated from a higher-level class. Normally this attribute is set as part of defining a method in the context of a schema. It is set in methods retrieved from a CIM Server.

Returns
True if method is propagated; otherwise, false.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getQualifier()

CIMConstQualifier CIMConstMethod::getQualifier ( Uint32  index) const

Gets the qualifier at the specified index.

Example:

    CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
    CIMConstMethod m2(m1);
    Uint32 posQualifier = m2.findQualifier(CIMName ("stuff"));
    if (posQualifier != PEG_NOT_FOUND)
    {
        CIMQualifier q = m2.getQualifier(posQualifier);
    }
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 CIMMethod.
UninitializedObjectExceptionIf the object is not initialized.

◆ getQualifierCount()

Uint32 CIMConstMethod::getQualifierCount ( ) const

Gets the number of qualifiers in the method.

Example:

    CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
    m1.addQualifier(CIMQualifier(CIMName ("stuff2"), true));
    CIMConstMethod m2(m1);
    assert(m2.getQualifierCount() == 2);
Returns
An integer count of the CIMQualifiers in the CIMMethod.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ getType()

CIMType CIMConstMethod::getType ( ) const

Gets the method return type.

Example:

    CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    assert(m1.getType() == CIMTYPE_STRING);
Returns
A CIMType containing the method return type.
Exceptions
UninitializedObjectExceptionIf the object is not initialized.

◆ identical()

Boolean CIMConstMethod::identical ( const CIMConstMethod x) const

Compares the method with another method.

Example:

    CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    CIMConstMethod m2(CIMName ("test"), CIMTYPE_STRING);
    assert(!m1.identical(m2));
Parameters
xThe CIMConstMethod to be compared.
Returns
True if this method is identical to the one specified, false otherwise.
Exceptions
UninitializedObjectExceptionIf either of the objects is not initialized.

◆ isUninitialized()

Boolean CIMConstMethod::isUninitialized ( ) const

Determines whether the object has been initialized.

Example:

    CIMConstMethod m1;
    assert(m1.isUninitialized());
Returns
True if the object has not been initialized, false otherwise.

◆ operator=() [1/2]

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

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

Example:

    CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    CIMConstMethod m2;
    m2 = m1;
Parameters
xThe CIMConstMethod object from which to assign this CIMConstMethod object.
Returns
A reference to this CIMConstMethod object.

◆ operator=() [2/2]

CIMConstMethod& CIMConstMethod::operator= ( const CIMMethod x)

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

Example:

    CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
    CIMConstMethod m2;
    m2 = m1;
Parameters
xThe CIMMethod object from which to assign this CIMConstMethod object.
Returns
A reference to this CIMConstMethod object.

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