In file ../../src/Pegasus/Common/CIMMethod.h:

class PEGASUS_COMMON_LINKAGE CIMConstMethod

The CIMConstMethod class is used to represent CIM methods in the same manner as the CIMMethod class except that the const attribute is applied to the objects created.

Documentation

The CIMConstMethod class is used to represent CIM methods in the same manner as the CIMMethod class except that the const attribute is applied to the objects created. This class includes equivalents to the methods from CIMMethod that are available in a const object, including constructors, accessor methods, and the destructor.

Because the CIMMethod class uses a shared representation model, allowing the construction of a 'CIMMethod' from a 'const CIMMethod' would effectively allow modification of a 'const CIMMethod'. The CIMConstMethod class is used to represent constant CIMMethod objects. Since a CIMConstMethod cannot be converted to a CIMMethod, its value remains constant.


Inheritance:


Public Methods

[more] CIMConstMethod ()
Creates a new uninitialized CIMConstMethod object.
[more] CIMConstMethod (const CIMConstMethod& x)
Creates a new CIMConstMethod object from another CIMConstMethod object.
[more] CIMConstMethod (const CIMMethod& x)
Creates a new CIMConstMethod object from a CIMMethod object.
[more] CIMConstMethod ( const CIMName& name, CIMType type, const CIMName& classOrigin = CIMName(), Boolean propagated = false)
Creates a CIMConstMethod object with the specified attributes.
[more] ~CIMConstMethod ()
Destructor for the CIMConstMethod.
[more]CIMConstMethod& operator= (const CIMConstMethod& x)
The assignment operator assigns one CIMConstMethod to another.
[more]CIMConstMethod& operator= (const CIMMethod& x)
The assignment operator assigns a CIMMethod object to a CIMConstMethod.
[more]const CIMName& getName () const
Gets the name of the method.
[more]CIMType getType () const
Gets the method return type.
[more]const CIMName& getClassOrigin () const
Gets the class in which this method was defined.
[more]Boolean getPropagated () const
Tests the propagated attribute of the object.
[more]Uint32 findQualifier (const CIMName& name) const
Searches for a qualifier with the specified input name.
[more]CIMConstQualifier getQualifier (Uint32 index) const
Gets the CIMQualifier defined by the input parameter.
[more]Uint32 getQualifierCount () const
Returns the number of Qualifiers attached to this CIMConstMethod object.
[more]Uint32 findParameter (const CIMName& name) const
Finds the parameter with the specified name.
[more]CIMConstParameter getParameter (Uint32 index) const
Gets the parameter defined by the specified index.
[more]Uint32 getParameterCount () const
Gets the count of Parameters defined in the CIMMethod.
[more]Boolean isUninitialized () const
Determines if the object has not been initialized.
[more]Boolean identical (const CIMConstMethod& x) const
Compares with a CIMConstMethod.
[more]CIMMethod clone () const
Makes a clone (deep copy) of this CIMConstMethod.

o CIMConstMethod()
Creates a new uninitialized CIMConstMethod object. The only thing that can be done with this object is to copy another object into it. Other methods, such as getName, will fail with an UninitializedObjectException. The object has an uninitialized state, which can be tested with the isUninitialized method.
See Also:
isUninitialized()
UninitializedObjectException

o CIMConstMethod(const CIMConstMethod& x)
Creates a new CIMConstMethod object from another CIMConstMethod object. The new CIMConstMethod object references the same copy of data as the specified object; no copy is made.
Parameters:
x - CIMConstMethod object from which to create the new CIMConstMethod object.

Example:

CIMConstMethod cm1(CIMName ("getHostName"), CIMTYPE_STRING);
CIMConstMethod cm2(m1);
Classes

o CIMConstMethod(const CIMMethod& x)
Creates a new CIMConstMethod object from a CIMMethod object. The new CIMConstMethod object references the same copy of data as the specified object; no copy is made.
Parameters:
x - CIMMethod object from which to create the new CIMConstMethod object.

Example:

CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
CIMConstMethod cm1(m1);
Classes

o CIMConstMethod( const CIMName& name, CIMType type, const CIMName& classOrigin = CIMName(), Boolean propagated = false)
Creates a CIMConstMethod object with the specified attributes.
Parameters:
name - CIMName defining the name for the method.
type - CIMType 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).
propagated - Optional 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.

Example:

CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);

o ~CIMConstMethod()
Destructor for the CIMConstMethod. The shared data copy remains valid until all referring objects are destructed. Classes

oCIMConstMethod& operator=(const CIMConstMethod& x)
The assignment operator assigns one CIMConstMethod to another. After the assignment, both CIMConstMethod objects refer to the same data copy; a distinct copy is not created.
Parameters:
x - CIMConstMethod object from which to assign this CIMConstMethod object.

Example:

CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
CIMConstMethod m2;
m2 = m1;

oCIMConstMethod& operator=(const CIMMethod& x)
The assignment operator assigns a CIMMethod object to a CIMConstMethod. After the assignment, both objects refer to the same data copy; a distinct copy is not created.
Parameters:
x - CIMConstMethod object from which to assign this CIMConstMethod object.

Example:

CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
CIMConstMethod m2;
m2 = m1;

oconst CIMName& getName() const
Gets the name of the method.
Returns:
CIMName with the name of the method.

Example:

CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
assert(m1.getName() == CIMName ("getHostName"));

oCIMType getType() const
Gets the method return type.
Throws:
UninitializedObjectException Thrown if the object is not initialized.

Example:

CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
assert(m1.getType() == CIMTYPE_STRING);

Returns:
A CIMType containing the method return type.

oconst CIMName& 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.

oBoolean 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.

oUint32 findQualifier(const CIMName& name) const
Searches for a qualifier with the specified input name.
Throws:
UninitializedObjectException Thrown if the object is not initialized.

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:
name - CIMName of the qualifier to be found.
Returns:
Zero origin index of the qualifier found or PEG_NOT_FOUND if not found.

oCIMConstQualifier getQualifier(Uint32 index) const
Gets the CIMQualifier defined by the input parameter.
Throws:
IndexOutOfBoundsException Thrown if the index is outside the range of parameters available from the CIMMethod.

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:
index - Zero origin index of the qualifier requested.
Returns:
CIMQualifier object representing the qualifier found.

oUint32 getQualifierCount() const
Returns the number of Qualifiers attached to this CIMConstMethod object.
Returns:
The number of qualifiers attached to the CIM 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);

oUint32 findParameter(const CIMName& name) const
Finds the parameter with the specified name.
Parameters:
name - CIMName of parameter to be found.
Returns:
Index of the parameter object found or PEG_NOT_FOUND if the property is not found.

Example:

Uint32 posParameter;
posParameter = m1.findParameter(CIMName ("ipaddress"));
if (posParameter != PEG_NOT_FOUND)
...

oCIMConstParameter getParameter(Uint32 index) const
Gets the parameter defined by the specified index.
Throws:
IndexOutOfBoundsException Thrown if the index is outside the range of available parameters.

Example:

CIMConstParameter cp;
Uint32 parameterIndex = m1.findParameter(CIMName ("ipaddress"));
if (parameterIndex != PEG_NOT_FOUND)
{
cp = m1.getParameter(parameterIndex);
}

Parameters:
index - Index for the parameter to be returned.
Returns:
CIMConstParameter object requested.

oUint32 getParameterCount() const
Gets the count of Parameters defined in the CIMMethod.
Returns:
Count of the number of parameters attached to the CIMMethod.

oBoolean isUninitialized() const
Determines if the object has not been initialized.
Returns:
True if the object has not been initialized; otherwise, false.

Example:

CIMConstMethod m1;
assert(m1.isUninitialized());

oBoolean identical(const CIMConstMethod& x) const
Compares with a CIMConstMethod.
Parameters:
x - CIMConstMethod object for the method to be compared.
Returns:
True if this method is identical to the one specified; otherwise, false.

Example:

CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
CIMConstMethod m2(CIMName ("test"), CIMTYPE_STRING);
assert(!m1.identical(m2));

oCIMMethod clone() const
Makes a clone (deep copy) of this CIMConstMethod. This creates a new copy of all of the components of the method including parameters and qualifiers.
Returns:
Independent copy of the CIMConstMethod object. Note that the copy is a non-constant CIMMethod.


This class has no child classes.
Friends:
class CIMMethod
class CIMMethodRep
class XmlWriter
class MofWriter
See Also:
CIMMethod()

Alphabetic index HTML hierarchy of classes or Java