version 1.37, 2003/10/22 14:26:02
|
version 1.38, 2003/10/30 14:43:48
|
|
|
class CIMConstMethod; | class CIMConstMethod; |
class CIMMethodRep; | class CIMMethodRep; |
| |
/** The CIMMethod class is used to represent CIM methods in Pegasus. |
/** The CIMMethod class is used to represent CIM methods in Pegasus. A CIMMethod |
|
consists of the following entities |
|
<ul> |
|
<li>Name of the method, a CIMName |
|
<li>CIMType of the method, a CIMType |
|
<li>Optional Qualifiers for the method |
|
<li>Optional Parameters for the method |
|
</ul> |
|
In addition, internally, there are the following additional attributes |
|
that are part of a CIMMethod. |
|
<ul> |
|
<li>propagated - attributed defining whether this CIMMethod is |
|
propagated from a superclass. Note that this is normally set |
|
as part of resolving objects when they are placed in a repository |
|
and is NOT automatically set when creating a local object. It |
|
can only logically be set in context of the superclass of which |
|
this CIMMethod is defined. |
|
<li>ClassOrigin - attribute defining the superclass in which this |
|
CIMMethod was originally defined. This is normally se as part |
|
of resolving Class and instances. It is available from objects |
|
retrieved from the repository. |
|
</ul> |
|
CIMMethod is a shared class and uses a representation object and reference |
|
counting to control the lifecycle of the objects. |
|
@see CIMConstMethod |
*/ | */ |
class PEGASUS_COMMON_LINKAGE CIMMethod | class PEGASUS_COMMON_LINKAGE CIMMethod |
{ | { |
public: | public: |
| |
/** Creates a new CIMMethod object. */ |
/** Creates a new default CIMMethod object. The object created is |
|
empty. Other methods such as setName() or assign must be |
|
used to provide attributes for the object |
|
@see CIMConstMethod() |
|
*/ |
CIMMethod(); | CIMMethod(); |
| |
/** Creates a new CIMMethod object from another method instance. |
/** Creates a new CIMMethod object from another method instance. This method |
@param x - CIMMethod instance from which to create CIMMethod object. |
assigns the new object to the representation in the parameter and increments the |
|
representation count. It does NOT create a new independent object. |
|
@param x - CIMMethod object from which to create CIMMethod object. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); |
|
const CIMMethod cm1(m1); |
|
</pre> |
*/ | */ |
CIMMethod(const CIMMethod& x); | CIMMethod(const CIMMethod& x); |
| |
/** Creates a CIMMethod with the specified name, type, and classOrigin. |
/** Creates a CIMMethod object with the specified name and other input parameters. |
@param name - CIMName representing the name for the method. |
@param name CIMName defining the name for the method. |
@param type - CIMType representing data type of method to create. |
@param type CIMType defining data type of method to create. See |
@param classOrigin - CIMName representing the class origin. |
|
@param propagated - Flag indicating whether the definition of the |
@param classOrigin (optional) CIMName representing the class origin. Note |
|
that this should normally not be used. If not provided set to |
|
CIMName() (Null name). |
|
@param propagated Optional flag indicating whether the definition of the |
CIM Method is local to the CIM Class (respectively, Instance) in which | CIM Method is local to the CIM Class (respectively, Instance) in which |
it appears, or was propagated without modification from the underlying | it appears, or was propagated without modification from the underlying |
Subclass (respectively, Class). |
Subclass (respectively, Class). Default is false. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING) |
|
</pre> |
*/ | */ |
CIMMethod( | CIMMethod( |
const CIMName& name, | const CIMName& name, |
|
|
const CIMName& classOrigin = CIMName(), | const CIMName& classOrigin = CIMName(), |
Boolean propagated = false); | Boolean propagated = false); |
| |
/** Desctructor. */ |
/** Destructor for the CIMMethod. Since this is a shared class, the destructor |
|
is automatically executed when the representation reference count becomes |
|
zero |
|
*/ |
~CIMMethod(); | ~CIMMethod(); |
| |
/** Assignment operator */ |
/** Assignment operator. Assigns one CIM method to another. This method performs |
|
the assignment by incrementing the reference count for the representation of |
|
the CIMMethod, not by creating a deep copy of the object |
|
*/ |
CIMMethod& operator=(const CIMMethod& x); | CIMMethod& operator=(const CIMMethod& x); |
| |
/** Gets the name of the method. | /** Gets the name of the method. |
@return CIMName with the name of the method. | @return CIMName with the name of the method. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING) |
|
assert(m1.getName() == CIMName ("getHostName")); |
|
</pre> |
*/ | */ |
const CIMName& getName() const; | const CIMName& getName() const; |
| |
/** Sets the method name. | /** Sets the method name. |
@param name - CIMName with method name. |
@param name - CIMName for the method name. Replaces any |
|
previously defined name for this method object. |
|
<pre> |
|
CIMMethod m2(CIMName ("test"), CIMTYPE_STRING); |
|
m2.setName(CIMName ("getVersion")); |
|
</pre> |
*/ | */ |
void setName(const CIMName& name); | void setName(const CIMName& name); |
| |
/** Gets the method type. | /** Gets the method type. |
@return The CIMType containing the method type for this method. | @return The CIMType containing the method type for this method. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING) |
|
assert(m1.getType() == CIMTYPE_STRING); |
|
</pre> |
*/ | */ |
CIMType getType() const; | CIMType getType() const; |
| |
/** Sets the method type to the specified CIM method type | /** Sets the method type to the specified CIM method type |
as defined in CIMType. | as defined in CIMType. |
|
@param type CIMType to be set into the method object. |
|
<pre> |
|
CIMMethod m1(); |
|
m1.setName(CIMName ("getVersion")); |
|
assert(m1.setType(CIMTYPE_STRING)); |
|
</pre> |
*/ | */ |
void setType(CIMType type); | void setType(CIMType type); |
| |
/** Gets the class in which this method was defined. |
/** Gets the class in which this method was defined. This information |
|
is available after the class containing the method has been |
|
resolved and is part of the class repository. |
@return CIMName containing the classOrigin field. | @return CIMName containing the classOrigin field. |
*/ | */ |
const CIMName& getClassOrigin() const; | const CIMName& getClassOrigin() const; |
| |
/** Sets the ClassOrigin attribute with the classname defined on | /** Sets the ClassOrigin attribute with the classname defined on |
the input parameter. |
the input parameter. Normally this function is used internally |
|
as part of resolving the objects containing methods (classes |
|
and instances). |
@param classOrigin - CIMName parameter defining the name | @param classOrigin - CIMName parameter defining the name |
of the class origin. | of the class origin. |
*/ | */ |
void setClassOrigin(const CIMName& classOrigin); | void setClassOrigin(const CIMName& classOrigin); |
| |
/** Tests the propagated qualifier. |
/** Tests the propagated qualifier. The propagated attribute |
|
indicates if this method was propagated from a higher level |
|
class. Normally this attribute is set as part of putting |
|
classes into the repository (resolving the class). It is |
|
available on methods in classes read from the repository and |
|
on instances that are read from the instance repository. |
@return true if method is propagated, false otherwise. | @return true if method is propagated, false otherwise. |
*/ | */ |
Boolean getPropagated() const; | Boolean getPropagated() const; |
| |
/** Sets the Propagaged Qualifier |
/** Sets the Propagaged Qualifier. Normally this is used by the functions |
@param propagated - Flag indicating propagation. |
that resolve classes and instances as part of the installation into |
|
a repository. |
|
@param propagated Flag indicating propagation. True means that |
|
the method was propagated from a superclass. |
*/ | */ |
void setPropagated(Boolean propagated); | void setPropagated(Boolean propagated); |
| |
|
|
to be added. | to be added. |
@return the CIMMethod object after adding the specified qualifier. | @return the CIMMethod object after adding the specified qualifier. |
@exception AlreadyExistsException if the qualifier already exists. | @exception AlreadyExistsException if the qualifier already exists. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); |
|
m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); |
|
</pre> |
*/ | */ |
CIMMethod& addQualifier(const CIMQualifier& x); | CIMMethod& addQualifier(const CIMQualifier& x); |
| |
|
|
@param name - CIMName of the qualifier to be found. | @param name - CIMName of the qualifier to be found. |
@return Index of the qualifier found or PEG_NOT_FOUND | @return Index of the qualifier found or PEG_NOT_FOUND |
if not found. | if not found. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); |
|
m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); |
|
assert(m1.findQualifier(CIMName ("stuff")) != PEG_NOT_FOUND); |
|
</pre> |
*/ | */ |
Uint32 findQualifier(const CIMName& name) const; | Uint32 findQualifier(const CIMName& name) const; |
| |
|
|
@return CIMQualifier object representing the qualifier found. | @return CIMQualifier object representing the qualifier found. |
@exception IndexOutOfBoundsException exception if the index is | @exception IndexOutOfBoundsException exception if the index is |
outside the range of parameters available from the CIMMethod. | outside the range of parameters available from the CIMMethod. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); |
|
m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); |
|
Uint32 posQualifier; |
|
posQualifier = m1.findQualifier(CIMName ("stuff")); |
|
CIMQualifier q = m1.getQualifier(posQualifier); |
|
</pre> |
*/ | */ |
CIMQualifier getQualifier(Uint32 index); | CIMQualifier getQualifier(Uint32 index); |
| |
|
|
@return CIMConstQualifier object representing the qualifier found. | @return CIMConstQualifier object representing the qualifier found. |
@exception IndexOutOfBoundsException exception if the index is | @exception IndexOutOfBoundsException exception if the index is |
outside the range of parameters available from the CIMMethod. | outside the range of parameters available from the CIMMethod. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); |
|
m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); |
|
|
|
Uint32 posQualifier; |
|
posQualifier = m1.findQualifier(CIMName ("stuff")); |
|
CIMQualifier q = m1.getQualifier(posQualifier); |
|
</pre> |
*/ | */ |
CIMConstQualifier getQualifier(Uint32 index) const; | CIMConstQualifier getQualifier(Uint32 index) const; |
| |
|
|
| |
/** Returns the number of Qualifiers attached to this CIMMethod object. | /** Returns the number of Qualifiers attached to this CIMMethod object. |
@return the number of qualifiers in the CIM Method. | @return the number of qualifiers in the CIM Method. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); |
|
m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); |
|
m1.addQualifier(CIMQualifier(CIMName ("stuff2"), true)); |
|
assert(m1.getQualifierCount() == 2); |
|
</pre> |
*/ | */ |
Uint32 getQualifierCount() const; | Uint32 getQualifierCount() const; |
| |
/** Adds the parameter defined by the input to the CIMMethod. | /** Adds the parameter defined by the input to the CIMMethod. |
@param x - CIMParameter to be added to the CIM Method. | @param x - CIMParameter to be added to the CIM Method. |
@return CIMMethod object after the specified parameter is added. | @return CIMMethod object after the specified parameter is added. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); |
|
m1.addParameter(CIMParameter(CIMName ("ipaddress"), CIMTYPE_STRING)); |
|
</pre> |
*/ | */ |
CIMMethod& addParameter(const CIMParameter& x); | CIMMethod& addParameter(const CIMParameter& x); |
| |
|
|
@param name - Name of parameter to be found. | @param name - Name of parameter to be found. |
@return Index of the parameter object found or PEG_NOT_FOUND | @return Index of the parameter object found or PEG_NOT_FOUND |
if the property is not found. | if the property is not found. |
|
<pre> |
|
Uint32 posParameter; |
|
posParameter = m1.findParameter(CIMName ("ipaddress")); |
|
if (posParameter != PEG_NOT_FOUND) |
|
... |
|
</pre> |
*/ | */ |
Uint32 findParameter(const CIMName& name) const; | Uint32 findParameter(const CIMName& name) const; |
| |
|
|
@param index - Index for the parameter to be returned. | @param index - Index for the parameter to be returned. |
@return CIMParameter object requested. | @return CIMParameter object requested. |
@exception IndexOutOfBoundsException if the index is outside | @exception IndexOutOfBoundsException if the index is outside |
the range of available parameters |
the range of available parameters. |
|
<pre> |
|
CIMParameter cp = m1.getParameter(m1.findParameter(CIMName ("ipaddress"))); |
|
</pre> |
*/ | */ |
CIMParameter getParameter(Uint32 index); | CIMParameter getParameter(Uint32 index); |
| |
|
|
| |
/** Determines if the object has not been initialized. | /** Determines if the object has not been initialized. |
@return true if the object has not been initialized, | @return true if the object has not been initialized, |
false otherwise |
false otherwise false. |
*/ | */ |
Boolean isUninitialized() const; | Boolean isUninitialized() const; |
| |
/** Compares with another CIMConstMethod. | /** Compares with another CIMConstMethod. |
@param x - CIMConstMethod object for the method to be compared. | @param x - CIMConstMethod object for the method to be compared. |
@return true if this method is identical to the one specified. | @return true if this method is identical to the one specified. |
|
<pre> |
|
CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); |
|
CIMMethod m2(CIMName ("test"), CIMTYPE_STRING); |
|
assert(!m1.identical(m2)); |
|
</pre> |
*/ | */ |
Boolean identical(const CIMConstMethod& x) const; | Boolean identical(const CIMConstMethod& x) const; |
| |
|
|
friend class MofWriter; | friend class MofWriter; |
}; | }; |
| |
/// |
/** 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 usable in a const object including |
|
constructors, (i.e. getter methods) and the destructor. |
|
The const form of the object is used TBD |
|
ATTN: Complete the explanation of why. |
|
@see CIMMethod |
|
*/ |
class PEGASUS_COMMON_LINKAGE CIMConstMethod | class PEGASUS_COMMON_LINKAGE CIMConstMethod |
{ | { |
public: | public: |
| |
/// |
/** Creates a new default CIMConstMethod object. |
|
@see CIMMethod() |
|
*/ |
CIMConstMethod(); | CIMConstMethod(); |
| |
/// |
/// @see CIMMethod() |
CIMConstMethod(const CIMConstMethod& x); | CIMConstMethod(const CIMConstMethod& x); |
| |
/// |
/** Creates a new CIMConstMethod object from an |
|
existing CIMMethod object. Creates a pointer |
|
to the existing representation. |
|
@return CIMConstMethod object reference. |
|
@see CIMMethod() |
|
*/ |
CIMConstMethod(const CIMMethod& x); | CIMConstMethod(const CIMMethod& x); |
| |
/// | /// |
|
|
const CIMName& classOrigin = CIMName(), | const CIMName& classOrigin = CIMName(), |
Boolean propagated = false); | Boolean propagated = false); |
| |
/// |
/// destructor. |
~CIMConstMethod(); | ~CIMConstMethod(); |
| |
/// |
/// assignment operator. |
CIMConstMethod& operator=(const CIMConstMethod& x); | CIMConstMethod& operator=(const CIMConstMethod& x); |
| |
/// |
/// assignment operator. |
CIMConstMethod& operator=(const CIMMethod& x); | CIMConstMethod& operator=(const CIMMethod& x); |
| |
/// |
/** gets CIMMethod name. Operation is the same as |
|
CIMMethod getName(). |
|
@see CIMMethod |
|
|
|
*/ |
const CIMName& getName() const; | const CIMName& getName() const; |
| |
/// |
/** gets CIMMethod CIMType. Functions the same as |
|
CIMMethod getType(); |
|
@see CIMMethod |
|
|
|
*/ |
CIMType getType() const; | CIMType getType() const; |
| |
/// |
/** gets ClassOrigin attribute. Functions the same |
|
as CIMMethod getClassOrigin() |
|
@see CIMMethod |
|
|
|
*/ |
const CIMName& getClassOrigin() const; | const CIMName& getClassOrigin() const; |
| |
/// |
/** gets Propagated attribute. Functions the same |
|
as CIMMethod getPropagated() |
|
@see CIMMethod |
|
*/ |
Boolean getPropagated() const; | Boolean getPropagated() const; |
| |
/// |
/** finds qualifier based on name. Functions the |
|
same as the CIMMethod findQualifier() method. |
|
|
|
@see CIMMethod |
|
*/ |
Uint32 findQualifier(const CIMName& name) const; | Uint32 findQualifier(const CIMName& name) const; |
| |
/// |
/** gets qualifier based on index. Functions the |
|
same as the CIMMethod getQualifier() method. |
|
@see CIMMethod |
|
*/ |
CIMConstQualifier getQualifier(Uint32 index) const; | CIMConstQualifier getQualifier(Uint32 index) const; |
| |
/// |
/** gets qualifier count based on name. Functions the |
|
same as the CIMMethod getQualifierCount() method. |
|
@see CIMMethod |
|
*/ |
Uint32 getQualifierCount() const; | Uint32 getQualifierCount() const; |
| |
/// |
/** finds method parameter based on name. Functions the |
|
same as the CIMMethod findParameter() method. |
|
@see CIMMethod |
|
*/ |
Uint32 findParameter(const CIMName& name) const; | Uint32 findParameter(const CIMName& name) const; |
| |
/// |
/** gets method parameter based on index. Functions the |
|
same as the CIMMethod getParameter() method. |
|
@see CIMMethod |
|
*/ |
CIMConstParameter getParameter(Uint32 index) const; | CIMConstParameter getParameter(Uint32 index) const; |
| |
/// |
/** finds method parameter count based on name. Functions the |
|
same as the CIMMethod getParameterCount() method. |
|
@see CIMMethod |
|
*/ |
Uint32 getParameterCount() const; | Uint32 getParameterCount() const; |
| |
/// |
/** Determines if CIMMethod is unitinitialized. Functions the |
|
same as corresponding funtion in CIMMethod class. |
|
@see CIMMethod |
|
*/ |
Boolean isUninitialized() const; | Boolean isUninitialized() const; |
| |
/// |
/** Determines if CIMMethod is identical to object define in parameter. |
|
Functions the same as corresponding funtion in CIMMethod class. |
|
@see CIMMethod |
|
*/ |
Boolean identical(const CIMConstMethod& x) const; | Boolean identical(const CIMConstMethod& x) const; |
| |
/// |
/** clones a CIMMethod object by making a deep copy. Functions the |
|
same as corresponding funtion in CIMMethod class. |
|
@see CIMMethod |
|
*/ |
CIMMethod clone() const; | CIMMethod clone() const; |
| |
private: | private: |