📄 cimmethod.h
字号:
m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); assert(m1.findQualifier(CIMName ("stuff")) != PEG_NOT_FOUND); </pre> @param name A CIMName specifying the name of the qualifier to be found. @return Index of the qualifier if found or PEG_NOT_FOUND if not found. @exception UninitializedObjectException If the object is not initialized. */ Uint32 findQualifier(const CIMName& name) const; /** Gets the qualifier at the specified index. <p><b>Example:</b> <pre> CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); Uint32 posQualifier = m1.findQualifier(CIMName ("stuff")); if (posQualifier != PEG_NOT_FOUND) { CIMQualifier q = m1.getQualifier(posQualifier); } </pre> @param index The index of the qualifier to be retrieved. @return The CIMQualifier object at the specified index. @exception IndexOutOfBoundsException If the index is outside the range of qualifiers available for the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ CIMQualifier getQualifier(Uint32 index); /** Gets the qualifier at the specified index. <p><b>Example:</b> <pre> CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); const CIMMethod m2 = m1; Uint32 posQualifier = m2.findQualifier(CIMName ("stuff")); if (posQualifier != PEG_NOT_FOUND) { CIMConstQualifier q = m2.getQualifier(posQualifier); } </pre> @param index The index of the qualifier to be retrieved. @return The CIMConstQualifier object at the specified index. @exception IndexOutOfBoundsException If the index is outside the range of qualifiers available for the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ CIMConstQualifier getQualifier(Uint32 index) const; /** Removes a qualifier from the method. <p><b>Example:</b> <pre> // remove all qualifiers from a class Uint32 count = 0; while((count = cimClass.getQualifierCount()) > 0) cimClass.removeQualifier(count - 1); </pre> @param index The index of the qualifier to remove. @exception IndexOutOfBoundsException If the index is outside the range of qualifiers available for the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ void removeQualifier(Uint32 index); /** Gets the number of qualifiers in the method. <p><b>Example:</b> <pre> CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); m1.addQualifier(CIMQualifier(CIMName ("stuff"), true)); m1.addQualifier(CIMQualifier(CIMName ("stuff2"), true)); assert(m1.getQualifierCount() == 2); </pre> @return An integer count of the qualifiers in the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ Uint32 getQualifierCount() const; /** Adds a parameter to the method. <p><b>Example:</b> <pre> CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); m1.addParameter(CIMParameter(CIMName("ipaddress"), CIMTYPE_STRING)); </pre> @param x The CIMParameter to be added. @return A reference to this CIMMethod object. @exception AlreadyExistsException If a parameter with the same name already exists in the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ CIMMethod& addParameter(const CIMParameter& x); /** Finds a parameter by name. <p><b>Example:</b> <pre> Uint32 posParameter; posParameter = m1.findParameter(CIMName ("ipaddress")); if (posParameter != PEG_NOT_FOUND) ... </pre> @param name A CIMName specifying the name of the parameter to be found. @return Index of the parameter if found or PEG_NOT_FOUND if not found. @exception UninitializedObjectException If the object is not initialized. */ Uint32 findParameter(const CIMName& name) const; /** Gets the parameter at the specified index. <p><b>Example:</b> <pre> CIMParameter cp; Uint32 parameterIndex = m1.findParameter(CIMName ("ipaddress")); if (parameterIndex != PEG_NOT_FOUND) { cp = m1.getParameter(parameterIndex); } </pre> @param index The index of the parameter to be retrieved. @return The CIMParameter at the specified index. @exception IndexOutOfBoundsException If the index is outside the range of parameters available for the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ CIMParameter getParameter(Uint32 index); /** Gets the parameter at the specified index. <p><b>Example:</b> <pre> CIMConstParameter cp; Uint32 parameterIndex = m1.findParameter(CIMName ("ipaddress")); if (parameterIndex != PEG_NOT_FOUND) { cp = m1.getParameter(parameterIndex); } </pre> @param index The index of the parameter to be retrieved. @return The CIMConstParameter at the specified index. @exception IndexOutOfBoundsException If the index is outside the range of parameters available for the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ CIMConstParameter getParameter(Uint32 index) const; /** Removes a parameter from the method. @param index Index of the parameter to be removed. @exception IndexOutOfBoundsException If the index is outside the range of parameters available from the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ void removeParameter (Uint32 index); /** Gets the number of parameters in the method. @return An integer count of the CIMParameters in the CIMMethod. @exception UninitializedObjectException If the object is not initialized. */ Uint32 getParameterCount() const; /** Determines whether the object has been initialized. <p><b>Example:</b> <pre> CIMMethod m1; assert(m1.isUninitialized()); </pre> @return True if the object has not been initialized, false otherwise. */ Boolean isUninitialized() const; /** Compares the method with another method. <p><b>Example:</b> <pre> CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING); CIMConstMethod m2(CIMName ("test"), CIMTYPE_STRING); assert(!m1.identical(m2)); </pre> @param x The CIMConstMethod to be compared. @return True if this method is identical to the one specified, false otherwise. @exception UninitializedObjectException If either of the objects is not initialized. */ Boolean identical(const CIMConstMethod& x) const; /** Makes a deep copy of the method. This creates a new copy of all the method attributes including parameters and qualifiers. @return A new copy of the CIMMethod object. @exception UninitializedObjectException If the object is not initialized. */ CIMMethod clone() const;private: CIMMethod(CIMMethodRep* rep); /** This method is not implemented. It is defined to explicitly disallow construction of a CIMMethod from a CIMConstMethod. Because the CIMMethod class uses a shared representation model, allowing this construction would effectively allow modification of CIMConstMethod objects. */ PEGASUS_EXPLICIT CIMMethod(const CIMConstMethod& x); void _checkRep() const; CIMMethodRep* _rep; friend class CIMConstMethod; friend class Resolver; friend class XmlWriter; friend class MofWriter; friend class BinaryStreamer;};/** 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.*/class PEGASUS_COMMON_LINKAGE CIMConstMethod{public: /** 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(); /** Constructs a CIMConstMethod object from the value of a specified CIMConstMethod object, so that both objects refer to the same data copy. <p><b>Example:</b> <pre> CIMConstMethod cm1(CIMName ("getHostName"), CIMTYPE_STRING); CIMConstMethod cm2(m1); </pre> @param x The CIMConstMethod object from which to construct a new CIMConstMethod object. */ CIMConstMethod(const CIMConstMethod& x); /** Constructs a CIMConstMethod object from the value of a specified CIMMethod object, so that both objects refer to the same data copy. <p><b>Example:</b> <pre> CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -