#include <CIMMethod.h>
List of all members.
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::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::CIMConstMethod |
( |
const CIMMethod & |
x |
) |
|
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:
-
| 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. |
- Exceptions:
-
CIMConstMethod::~CIMConstMethod |
( |
|
) |
|
Member Function Documentation
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:
-
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:
-
| name | A 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:
-
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:
-
| name | A 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:
-
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:
-
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:
-
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:
-
| index | The index of the parameter to be retrieved. |
- Returns:
- The CIMConstParameter at the specified index.
- Exceptions:
-
Uint32 CIMConstMethod::getParameterCount |
( |
|
) |
const |
Gets the number of parameters in the method.
- Returns:
- An integer count of the CIMParameters in the CIMMethod.
- Exceptions:
-
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:
-
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:
-
| index | The index of the qualifier to be retrieved. |
- Returns:
- The CIMConstQualifier at the specified index.
- Exceptions:
-
Uint32 CIMConstMethod::getQualifierCount |
( |
|
) |
const |
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:
-
Compares the method with another method.
Example:
CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
CIMConstMethod m2(CIMName ("test"), CIMTYPE_STRING);
assert(!m1.identical(m2));
- Parameters:
-
- Returns:
- True if this method is identical to the one specified, false otherwise.
- Exceptions:
-
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.
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:
-
- Returns:
- A reference to this CIMConstMethod object.
The documentation for this class was generated from the following file:
- /home/builduser/trunk/pkgs/tog-pegasus/BUILD/pegasus/src/Pegasus/Common/CIMMethod.h