⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cimobjectpath.h

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 H
📖 第 1 页 / 共 2 页
字号:
    Array<CIMKeyBinding> keyBindings;    keyBindings.append(CIMKeyBinding("first", "Patrick", CIMKeyBinding::STRING));    keyBindings.append(CIMKeyBinding("last", "Rafter", CIMKeyBinding::STRING));    </pre>    Notice that the keys in the object name may appear in any order.    That is the following object names refer to the same object:    <pre>    TennisPlayer.first="Patrick",last="Rafter"    TennisPlayer.last="Rafter",first="Patrick"    </pre>    And since CIM is not case sensitive, the following refer to the same    object:    <pre>    TennisPlayer.first="Patrick",last="Rafter"    tennisplayer.FIRST="Patrick",Last="Rafter"    </pre>    Therefore, the CIMObjectPaths::operator==() would return true for the last    two examples.    The CIM standard leaves it an open question whether model paths may have    spaces around delimiters (like '.', '=', and ','). We assume they cannot.    So the following is an invalid model path:    <pre>    TennisPlayer . first = "Patrick", last="Rafter"    </pre>    We require that the '.', '=', and ',' have no spaces around them.    For reasons of efficiency, the key bindings are internally sorted    during initialization. This allows the key bindings to be compared    more easily. This means that when the string is converted back to    string (by calling toString()) that the keys may have been rearranged.    There are two forms an object name can take:    <pre>    &lt;namespace-path&gt;:&lt;model-path&gt;    &lt;model-path&gt;    </pre>    In other words, the namespace-path is optional. Here is an example of    each:    <pre>    //atp:9999/root/cimv25:TennisPlayer.first="Patrick",last="Rafter"    TennisPlayer.first="Patrick",last="Rafter"    </pre>    If it begins with "//" then we assume the namespace-path is present and    process it that way.    It should also be noted that an object name may refer to an instance or    a class. Here is an example of each:    <pre>    TennisPlayer.first="Patrick",last="Rafter"    TennisPlayer    </pre>    In the second case--when it refers to a class--the key bindings are    omitted.*/class PEGASUS_COMMON_LINKAGE CIMObjectPath{public:    /**        Constructs a CIMObjectPath object with null values.    */    CIMObjectPath();    /**        Constructs a CIMObjectPath object from the value of a specified        CIMObjectPath object.        @param x The CIMObjectPath object from which to construct a new            CIMObjectPath object.    */    CIMObjectPath(const CIMObjectPath& x);    /**        Constructs a CIMObjectPath from a CIM object name in String form.        <p><b>Example:</b>        <pre>            CIMObjectPath r1 = "MyClass.z=true,y=1234,x=\"Hello World\"";        </pre>        @param objectName A String representation of the object name.        @exception MalformedObjectNameException If the String does not contain            a properly formed object name.    */    CIMObjectPath(const String& objectName);    /**        Constructs a CIMObjectPath object with the specified attributes.        @param host A String containing the host name (e.g., "nemesis:5988").            An empty String indicates that the object path does not contain            a host name attribute.        @param nameSpace A CIMNamespaceName specifying the namespace name.            A null name indicates that the object path does not contain            a namespace attribute.        @param nameSpace A CIMName specifying the class name.        @param keyBindings An Array of CIMKeyBinding objects specifying the            key bindings.        @exception MalformedObjectNameException If the host name String            contains an improperly formed host name.    */    CIMObjectPath(        const String& host,        const CIMNamespaceName& nameSpace,        const CIMName& className,        const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>());    /**        Destructs the CIMObjectPath object.    */    ~CIMObjectPath();    /**        Assigns the value of the specified CIMObjectPath object to this object.        @param x The CIMObjectPath object from which to assign this            CIMObjectPath object.        @return A reference to this CIMObjectPath object.    */    CIMObjectPath& operator=(const CIMObjectPath& x);    /**        Resets the attributes of the object path to null values.        The result is equivalent to using the default constructor.    */    void clear();    /**        Sets the CIMObjectPath with the specified attributes.        @param host A String containing the host name (e.g., "nemesis:5988").            An empty String indicates that the object path does not contain            a host name attribute.        @param nameSpace A CIMNamespaceName specifying the namespace name.            A null name indicates that the object path does not contain            a namespace attribute.        @param nameSpace A CIMName specifying the class name.        @param keyBindings An Array of CIMKeyBinding objects specifying the            key bindings.        @exception MalformedObjectNameException If the host name String            contains an improperly formed host name.    */    void set(        const String& host,        const CIMNamespaceName& nameSpace,        const CIMName& className,        const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>());    /**        Sets the CIMObjectPath from a CIM object name in String form.        @param objectName A String representation of the object name.        @exception MalformedObjectNameException If the String does not contain            a properly formed object name.    */    void set(const String& objectName);    /**        Sets the CIMObjectPath from a CIM object name in String form.        @param objectName A String representation of the object name.        @exception MalformedObjectNameException If the String does not contain            a properly formed object name.    */    CIMObjectPath& operator=(const String& objectName);    /**        Gets the host name for the object path.        @return A String containing the host name.    */    const String& getHost() const;    /**        Sets the host name for the object path.        <p><b>Example:</b>        <pre>        CIMObjectPath r1;        r1.setHost("fred:5988");        </pre>        @param host A String containing the host name.        @exception MalformedObjectNameException If the host name String            contains an improperly formed host name.    */    void setHost(const String& host);    /**        Gets the namespace name for the object path.        @return A CIMNamespaceName containing the namespace name.    */    const CIMNamespaceName& getNameSpace() const;    /**        Sets the namespace name for the object path.        @param nameSpace A CIMNamespaceName containing the namespace name.    */    void setNameSpace(const CIMNamespaceName& nameSpace);    /**        Gets the class name for the object path.        @return A CIMName containing the class name.    */    const CIMName& getClassName() const;    /**        Sets the class name for the object path.        @param className A CIMName containing the class name.    */    void setClassName(const CIMName& className);    /**        Gets the key bindings for the object path.        @return An Array of CIMKeyBinding objects containing the key bindings.    */    const Array<CIMKeyBinding>& getKeyBindings() const;    /**        Sets the key bindings for the object path.        @param keyBindings An Array of CIMKeyBinding objects containing the            key bindings.    */    void setKeyBindings(const Array<CIMKeyBinding>& keyBindings);    /**        Generates a String form of the object path.        The format is:        <pre>            "//" + hostname + "/" + namespace + ":" + classname +"." +            (keyname) + "=" (keyvalue) +"," ...        </pre>        Special characters are escaped in the resulting String.        @return A String form of the object path.        @exception UninitializedObjectException If the class name attribute            of the object path is null.    */    String toString() const;    /**        Compares the CIMObjectPath with a specified CIMObjectPath.        Comparisons of CIM names are case-insensitive, per the CIM        specification.        @param x The CIMObjectPath to be compared.        @return True if this object is identical to the one specified,            false otherwise.    */    Boolean identical(const CIMObjectPath& x) const;    /**        Generates a hash code for the object path.  Identical references        generate the same hash code (despite insignificant differences such as        the case of names and the order of the key bindings).    */    Uint32 makeHashCode() const;private:    /**        Generates a canonical String form of the object path (in which key        bindings are sorted and classnames and keynames are converted to        lower case).        @return A canonical String form of the object path.        @exception UninitializedObjectException If the class name attribute            of the object path is null.    */    String _toStringCanonical() const;    CIMObjectPathRep* _rep;};/**    Compares two object paths for equality.    @param x The first CIMObjectPath to be compared.    @param y The second CIMObjectPath to be compared.    @return True if the object paths are identical, false otherwise.*/PEGASUS_COMMON_LINKAGE Boolean operator==(    const CIMObjectPath& x,    const CIMObjectPath& y);/**    Compares two object paths for inequality.    @param x The first CIMObjectPath to be compared.    @param y The second CIMObjectPath to be compared.    @return False if the object paths are identical, true otherwise.*/PEGASUS_COMMON_LINKAGE Boolean operator!=(    const CIMObjectPath& x,    const CIMObjectPath& y);#define PEGASUS_ARRAY_T CIMObjectPath# include <Pegasus/Common/ArrayInter.h>#undef PEGASUS_ARRAY_TPEGASUS_NAMESPACE_END#endif /* Pegasus_ObjectPath_h */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -