version 1.18, 2002/05/03 05:16:16
|
version 1.44.18.2, 2006/03/07 18:45:46
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
|
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) |
|
// |
|
// Modified By: |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_Object_h | #ifndef Pegasus_Object_h |
#define Pegasus_Object_h | #define Pegasus_Object_h |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
|
#include <Pegasus/Common/Linkage.h> |
#include <Pegasus/Common/String.h> | #include <Pegasus/Common/String.h> |
|
#include <Pegasus/Common/CIMName.h> |
#include <Pegasus/Common/Array.h> | #include <Pegasus/Common/Array.h> |
#include <Pegasus/Common/CIMProperty.h> | #include <Pegasus/Common/CIMProperty.h> |
#include <Pegasus/Common/CIMQualifier.h> | #include <Pegasus/Common/CIMQualifier.h> |
|
|
class CIMConstClass; | class CIMConstClass; |
class CIMInstance; | class CIMInstance; |
class CIMConstInstance; | class CIMConstInstance; |
|
class CIMProperty; |
|
class CIMConstProperty; |
|
class CIMQualifier; |
|
class CIMConstQualifier; |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
|
|
// | // |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
| |
/** This class either refers to a CIMInstance or a CIMClass. |
/** |
|
The CIMObject class represents the DMTF standard CIM object definition, |
|
which may represent a CIMClass or a CIMInstance. |
| |
The CIMObjectRep data member points to either a CIMInstanceRep or |
<p>The CIMObject class uses a shared representation model, such that |
CIMClassRep. |
multiple CIMObject objects may refer to the same data copy. Assignment |
|
and copy operators create new references to the same data, not distinct |
|
copies. An update to a CIMObject object affects all the CIMObject |
|
objects that refer to the same data copy. The data remains valid until |
|
all the CIMObject objects that refer to it are destructed. A separate |
|
copy of the data may be created using the clone method. |
*/ | */ |
class PEGASUS_COMMON_LINKAGE CIMObject | class PEGASUS_COMMON_LINKAGE CIMObject |
{ | { |
public: | public: |
| |
/** Constructor. |
/** |
|
Constructs an uninitialized CIMObject 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. |
*/ | */ |
CIMObject(); | CIMObject(); |
| |
/** Copy constructor. |
/** |
|
Constructs a CIMObject object from the value of a specified |
|
CIMObject object, so that both objects refer to the same data copy. |
|
@param x The CIMObject object from which to construct a new |
|
CIMObject object. |
*/ | */ |
CIMObject(const CIMObject& x); | CIMObject(const CIMObject& x); |
| |
/** Construction from CIMClass. |
/** |
|
Constructs a CIMObject object from the value of a specified |
|
CIMClass object, so that both objects refer to the same data copy. |
|
@param x The CIMClass object from which to construct the |
|
CIMObject object. |
*/ | */ |
CIMObject(const CIMClass& x); | CIMObject(const CIMClass& x); |
| |
/** Construction from CIMInstance. |
/** |
|
Constructs a CIMObject object from the value of a specified |
|
CIMInstance object, so that both objects refer to the same data copy. |
|
@param x The CIMInstance object from which to construct the |
|
CIMObject object. |
*/ | */ |
CIMObject(const CIMInstance& x); | CIMObject(const CIMInstance& x); |
| |
/** Assignment operator. |
/** |
|
Assigns the value of the specified CIMObject object to this object, |
|
so that both objects refer to the same data copy. |
|
@param x The CIMObject object from which to assign this CIMObject |
|
object. |
|
@return A reference to this CIMObject object. |
*/ | */ |
CIMObject& operator=(const CIMObject& x); | CIMObject& operator=(const CIMObject& x); |
| |
/** Assignment operator. |
/** |
|
Destructs the CIMObject object. |
|
*/ |
|
~CIMObject(); |
|
|
|
/** |
|
Gets the class name of the object. |
|
@return A CIMName containing the class name. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
CIMObject& operator=(const CIMClass& x); |
const CIMName& getClassName() const; |
| |
/** Assignment operator. |
/** |
|
Gets the object path for the object. |
|
@return A CIMObjectPath containing the object path. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
CIMObject& operator=(const CIMInstance& x); |
const CIMObjectPath& getPath() const; |
| |
/** Destructor. |
/** |
|
Sets the object path for the object. |
|
@param path A CIMObjectPath containing the object path. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
~CIMObject(); |
void setPath (const CIMObjectPath & path); |
| |
/** Accessor for ClassName component of the object. |
/** |
@return - Returns the ClassName of the object in |
Adds a qualifier to the object. |
a String parameter. |
@param qualifier The CIMQualifier to be added. |
<pre> |
@return A reference to this CIMObject object. |
String className; |
@exception AlreadyExistsException If a qualifier with the |
CIMClass myclass("myclass", "superclass"); |
same name already exists in the CIMObject. |
className = myclass.getClassName; |
@exception UninitializedObjectException If the object is not |
</pre> |
initialized. |
*/ |
|
const String& getClassName() const; |
|
|
|
/** equalClassName Compares ClassName with a String. This test performs |
|
a comparison of the classname component of the object |
|
with a String. Note that this function was included specifically |
|
because the equality compare is not just a straight comparison |
|
because classnames are case independent. |
|
@param classname String containing the name for comparison |
|
@return True if it is the same class name (equalNoCase compare passes) |
|
or false if not. |
|
*/ |
|
const Boolean equalClassName(const String& classname) const; |
|
|
|
const CIMReference& getPath() const; |
|
|
|
/** addQualifier - Adds the CIMQualifier object to the instance. |
|
Thows an exception of the CIMQualifier already exists in the instance |
|
@param CIMQualifier object to add to instance |
|
@return ATTN: |
|
@exception Throws AlreadyExists. |
|
*/ | */ |
CIMObject& addQualifier(const CIMQualifier& qualifier); | CIMObject& addQualifier(const CIMQualifier& qualifier); |
| |
/** findQualifier - Searches the instance for the qualifier object |
/** |
defined by the input parameter. |
Finds a qualifier by name. |
@param String defining the qualifier object to be found. |
@param name A CIMName specifying the name of the qualifier to be found. |
@return - Position of the qualifier to be used in subsequent |
@return Index of the qualifier if found or PEG_NOT_FOUND if not found. |
operations or PEG_NOT_FOUND if the qualifier is not found. |
@exception UninitializedObjectException If the object is not |
*/ |
initialized. |
Uint32 findQualifier(const String& name) const; |
*/ |
|
Uint32 findQualifier(const CIMName& name) const; |
/** existsQualifier - Searches the instance for the qualifier object |
|
defined by the input parameter. |
/** |
@param String defining the qualifier object to be found. |
Gets the qualifier at the specified index. |
@return - Returns True if the qualifier object exists or false |
@param index The index of the qualifier to be retrieved. |
if the qualifier is not found. |
@return The CIMQualifier at the specified index. |
*/ |
@exception IndexOutOfBoundsException If the index is outside |
Boolean existsQualifier(const String& name) const; |
the range of qualifiers available for the CIMObject. |
|
@exception UninitializedObjectException If the object is not |
/** getQualifier - Retrieves the qualifier object defined by the |
initialized. |
index input parameter. @ index for the qualifier object. |
*/ |
The index to qualifier objects is zero-origin and continuous |
CIMQualifier getQualifier(Uint32 index); |
so that incrementing loops can be used to get all qualifier |
|
objects in a CIMInstnace. |
/** |
@return: Returns qualifier object defined by index. |
Gets the qualifier at the specified index. |
@exception Throws the OutOfBounds exception if the index |
@param index The index of the qualifier to be retrieved. |
is out of bounds |
@return The CIMConstQualifier at the specified index. |
*/ |
@exception IndexOutOfBoundsException If the index is outside |
CIMQualifier getQualifier(Uint32 pos); |
the range of qualifiers available for the CIMObject. |
|
@exception UninitializedObjectException If the object is not |
/** getQualifier - Retrieves the qualifier object defined by the |
initialized. |
index input parameter. @ index for the qualifier object. |
*/ |
The index to qualifier objects is zero-origin and continuous |
CIMConstQualifier getQualifier(Uint32 index) const; |
so that incrementing loops can be used to get all qualifier |
|
objects in a CIMInstnace. |
/** |
@return: Returns qualifier object defined by index. |
Removes a qualifier from the object. |
@exception Throws the OutOfBounds exception if the index |
@param index The index of the qualifier to remove. |
is out of bounds |
@exception IndexOutOfBoundsException If the index is |
ATTN: What is effect of out of range index??? |
outside the range of qualifiers available for the CIMObject. |
ATTN: Is the above statement correct??? |
@exception UninitializedObjectException If the object is not |
*/ |
initialized. |
CIMConstQualifier getQualifier(Uint32 pos) const; |
*/ |
|
void removeQualifier(Uint32 index); |
void removeQualifier(Uint32 pos); |
|
|
/** |
/** getQualifierCount - Gets the number of CIMQualifier objects |
Gets the number of qualifiers in the object. |
defined for this CIMObject. |
@return An integer count of the qualifiers in the CIMObject. |
@return Count of the number of CIMQualifier objects in the |
@exception UninitializedObjectException If the object is not |
CIMObject. |
initialized. |
@exception Throws the OutOfBounds exception if the index |
|
is out of bounds |
|
*/ | */ |
Uint32 getQualifierCount() const; | Uint32 getQualifierCount() const; |
| |
/** addProperty - Adds a property object defined by the input |
/** |
parameter to the CIMObject |
Adds a property to the object. |
@param Property Object to be added. See the CIM Property |
@param x The CIMProperty to be added. |
class for definition of the property object |
@return A reference to this CIMObject object. |
@return ATTN: |
@exception AlreadyExistsException If a property with the |
@exception Throws the exception AlreadyExists if the property |
same name already exists in the CIMObject. |
already exists. |
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
CIMObject& addProperty(const CIMProperty& x); | CIMObject& addProperty(const CIMProperty& x); |
| |
/** findProperty - Searches the CIMProperty objects installed in the |
/** |
CIMObject for property objects with the name defined by the |
Finds a property by name. |
input. |
@param name A CIMName specifying the name of the property to be found. |
@param String with the name of the property object to be found |
@return Index of the property if found or PEG_NOT_FOUND if not found. |
@return Position in the CIM object to the property object if found or |
@exception UninitializedObjectException If the object is not |
PEG_NOT_FOUND if no property object found with the name defined by the |
initialized. |
input. |
*/ |
*/ |
Uint32 findProperty(const CIMName& name) const; |
Uint32 findProperty(const String& name) const; |
|
|
|
/** existsProperty - Determines if a property object with the |
|
name defined by the input parameter exists in the class. |
|
@parm String parameter with the property name. |
|
@return True if the property object exists. |
|
*/ |
|
Boolean existsProperty(const String& name) const; |
|
|
|
/** getProperty - Gets the CIMProperty object in the CIMObject defined |
|
by the input index parameter. |
|
@param Index to the property object in the CIMObject. |
|
The index to qualifier objects is zero-origin and continuous |
|
so that incrementing loops can be used to get all qualifier |
|
objects in a CIMObject. |
|
@return CIMProperty object corresponding to the index. |
|
@exception Throws the OutOfBounds exception if the index |
|
is out of bounds |
|
|
|
ATTN: What is the effect of out of range? |
|
*/ |
|
CIMProperty getProperty(Uint32 pos); |
|
|
|
/** getProperty - Gets the CIMproperty object in the CIMObject defined |
|
by the input index parameter. |
|
@param Index to the property object in the CIMObject. |
|
The index to qualifier objects is zero-origin and continuous |
|
so that incrementing loops can be used to get all qualifier |
|
objects in a CIMInstnace. |
|
@return CIMProperty object corresponding to the index. |
|
@exception Throws the OutOfBounds exception if the index |
|
is out of bounds |
|
|
|
ATTN: What is the effect of out of range? |
|
*/ |
|
CIMConstProperty getProperty(Uint32 pos) const; |
|
|
|
/** removeProperty - Removes the property represented |
|
by the position input parameter from the instance. |
|
@param pos Index to the property to be removed from the |
|
instance. Normally this is obtained by getProperty(); |
|
@exception Throws OutofBounds if index is not a property object |
|
*/ |
|
void removeProperty(Uint32 pos); |
|
|
|
/** getPropertyCount - Gets the number of CIMProperty |
|
objects defined for this CIMObject. |
|
@return Count of the number of CIMProperty objects in the |
|
CIMObject. Zero indicates that no CIMProperty objects |
|
are contained in the CIMObject |
|
@exception Throws the OutOfBounds exception if the index |
|
is out of bounds |
|
| |
|
/** |
|
Gets the property at the specified index. |
|
@param index The index of the property to be retrieved. |
|
@return The CIMProperty at the specified index. |
|
@exception IndexOutOfBoundsException If the index is outside |
|
the range of properties available for the CIMObject. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
|
*/ |
|
CIMProperty getProperty(Uint32 index); |
|
|
|
/** |
|
Gets the property at the specified index. |
|
@param index The index of the property to be retrieved. |
|
@return The CIMConstProperty at the specified index. |
|
@exception IndexOutOfBoundsException If the index is outside |
|
the range of properties available for the CIMObject. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
|
*/ |
|
CIMConstProperty getProperty(Uint32 index) const; |
|
|
|
/** |
|
Removes a property from the object. |
|
@param index The index of the property to remove. |
|
@exception IndexOutOfBoundsException If the index is |
|
outside the range of properties available for the CIMObject. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
|
*/ |
|
void removeProperty(Uint32 index); |
|
|
|
/** |
|
Gets the number of properties in the object. |
|
@return An integer count of the properties in the CIMObject. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
Uint32 getPropertyCount() const; | Uint32 getPropertyCount() const; |
| |
/** Clones the given object. |
/** |
|
Makes a deep copy of the object. This creates a new copy of all |
|
the object attributes including qualifiers and properties. |
|
@return A new copy of the CIMObject object. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
CIMObject clone() const; | CIMObject clone() const; |
| |
/** Returns true if the two classes are structurally identical. |
/** |
|
Compares the CIMObject with a specified CIMConstObject. |
|
@param x The CIMConstObject to be compared. |
|
@return True if this object is identical to the one specified, |
|
false otherwise. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
Boolean identical(const CIMConstObject& x) const; | Boolean identical(const CIMConstObject& x) const; |
| |
#ifdef PEGASUS_INTERNALONLY |
/** |
/** operator int() - ATTN: */ |
Determines whether the object has been initialized. |
operator int() const; |
@return True if the object has not been initialized, false otherwise. |
|
*/ |
|
Boolean isUninitialized() const; |
| |
/** Convert object to XML format. |
/** |
|
Generates a human-readable String representing the value of the |
|
CIMObject. The String may be in MOF format, but the format is not |
|
guaranteed and may change without notice. |
|
@return A human-readable String representing the CIMObject value. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
void toXml(Array<Sint8>& out) const; |
String toString() const; |
#endif |
|
|
/** |
|
Indicates whether the object represents a CIMClass. |
|
@return True if the object represents a CIMClass; false otherwise. |
|
*/ |
|
Boolean isClass() const; |
|
|
|
/** |
|
Indicates whether the object represents a CIMInstance. |
|
@return True if the object represents a CIMInstance; false otherwise. |
|
*/ |
|
Boolean isInstance() const; |
| |
private: | private: |
| |
CIMObjectRep* _rep; | CIMObjectRep* _rep; |
| |
#ifdef PEGASUS_INTERNALONLY |
|
CIMObject(CIMObjectRep* rep); | CIMObject(CIMObjectRep* rep); |
| |
void _checkRep() const; | void _checkRep() const; |
|
|
friend class CIMConstClass; | friend class CIMConstClass; |
friend class CIMInstance; | friend class CIMInstance; |
friend class CIMConstInstance; | friend class CIMConstInstance; |
#endif |
|
}; | }; |
| |
|
#define PEGASUS_ARRAY_T CIMObject |
|
# include <Pegasus/Common/ArrayInter.h> |
|
#undef PEGASUS_ARRAY_T |
|
|
|
|
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
// CIMConstObject | // CIMConstObject |
// | // |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
| |
|
/** |
|
The CIMConstObject class provides a const interface to a CIMObject |
|
object. This class is needed because the shared representation model |
|
used by CIMObject does not prevent modification to a const CIMObject |
|
object. Note that the value of a CIMConstObject object could still be |
|
modified by a CIMObject object that refers to the same data copy. |
|
*/ |
class PEGASUS_COMMON_LINKAGE CIMConstObject | class PEGASUS_COMMON_LINKAGE CIMConstObject |
{ | { |
public: | public: |
| |
|
/** |
|
Constructs an uninitialized CIMConstObject 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. |
|
*/ |
CIMConstObject(); | CIMConstObject(); |
| |
|
/** |
|
Constructs a CIMConstObject object from the value of a specified |
|
CIMConstObject object, so that both objects refer to the same data |
|
copy. |
|
@param x The CIMConstObject object from which to construct a new |
|
CIMConstObject object. |
|
*/ |
CIMConstObject(const CIMConstObject& x); | CIMConstObject(const CIMConstObject& x); |
| |
|
/** |
|
Constructs a CIMConstObject object from the value of a specified |
|
CIMObject object, so that both objects refer to the same data copy. |
|
@param x The CIMObject object from which to construct a new |
|
CIMConstObject object. |
|
*/ |
CIMConstObject(const CIMObject& x); | CIMConstObject(const CIMObject& x); |
| |
/** Construction from CIMClass. |
/** |
|
Constructs a CIMConstObject object from the value of a specified |
|
CIMClass object, so that both objects refer to the same data copy. |
|
@param x The CIMClass object from which to construct the |
|
CIMConstObject object. |
*/ | */ |
CIMConstObject(const CIMClass& x); | CIMConstObject(const CIMClass& x); |
| |
/** Construction from CIMInstance. |
/** |
|
Constructs a CIMConstObject object from the value of a specified |
|
CIMInstance object, so that both objects refer to the same data copy. |
|
@param x The CIMInstance object from which to construct the |
|
CIMConstObject object. |
*/ | */ |
CIMConstObject(const CIMInstance& x); | CIMConstObject(const CIMInstance& x); |
| |
/** Construction from CIMClass. |
/** |
|
Constructs a CIMConstObject object from the value of a specified |
|
CIMConstClass object, so that both objects refer to the same data copy. |
|
@param x The CIMConstClass object from which to construct the |
|
CIMConstObject object. |
*/ | */ |
CIMConstObject(const CIMConstClass& x); | CIMConstObject(const CIMConstClass& x); |
| |
/** Construction from CIMInstance. |
/** |
|
Constructs a CIMConstObject object from the value of a specified |
|
CIMConstInstance object, so that both objects refer to the same data |
|
copy. |
|
@param x The CIMConstInstance object from which to construct the |
|
CIMConstObject object. |
*/ | */ |
CIMConstObject(const CIMConstInstance& x); | CIMConstObject(const CIMConstInstance& x); |
| |
|
/** |
|
Assigns the value of the specified CIMConstObject object to this |
|
object, so that both objects refer to the same data copy. |
|
@param x The CIMConstObject object from which to assign this |
|
CIMConstObject object. |
|
@return A reference to this CIMConstObject object. |
|
*/ |
CIMConstObject& operator=(const CIMConstObject& x); | CIMConstObject& operator=(const CIMConstObject& x); |
| |
CIMConstObject& operator=(const CIMObject& x); |
/** |
|
Destructs the CIMConstObject object. |
CIMConstObject& operator=(const CIMClass& x); |
*/ |
|
|
CIMConstObject& operator=(const CIMConstClass& x); |
|
|
|
CIMConstObject& operator=(const CIMInstance& x); |
|
|
|
CIMConstObject& operator=(const CIMConstInstance& x); |
|
|
|
~CIMConstObject(); | ~CIMConstObject(); |
| |
const String& getClassName() const; |
/** |
|
Gets the class name of the object. |
const CIMReference& getPath() const; |
@return A CIMName containing the class name. |
|
@exception UninitializedObjectException If the object is not |
Uint32 findQualifier(const String& name) const; |
initialized. |
|
*/ |
CIMConstQualifier getQualifier(Uint32 pos) const; |
const CIMName& getClassName() const; |
|
|
Uint32 getQualifierCount() const; |
|
|
|
Uint32 findProperty(const String& name) const; |
|
|
|
CIMConstProperty getProperty(Uint32 pos) const; |
|
|
|
Uint32 getPropertyCount() const; |
|
|
|
CIMObject clone() const; |
|
|
|
Boolean identical(const CIMConstObject& x) const; |
|
|
|
#ifdef PEGASUS_INTERNALONLY |
|
operator int() const; |
|
|
|
void toXml(Array<Sint8>& out) const; |
|
|
|
void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const; |
|
#endif |
|
|
|
private: |
|
|
|
CIMObjectRep* _rep; |
|
|
|
#ifdef PEGASUS_INTERNALONLY |
|
void _checkRep() const; |
|
| |
friend class CIMObject; |
/** |
friend class CIMClass; |
Gets the object path for the object. |
friend class CIMConstClass; |
@return A CIMObjectPath containing the object path. |
friend class CIMInstance; |
@exception UninitializedObjectException If the object is not |
friend class CIMConstInstance; |
initialized. |
#endif |
*/ |
}; |
const CIMObjectPath& getPath() const; |
| |
/** The CIMObjectWithPath encapsulates a CIMReference and CIMObject. |
/** |
Accessors are provided for getting the two parts. Constructors are |
Finds a qualifier by name. |
provided for initializing it from a CIMObject. |
@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. |
*/ | */ |
class PEGASUS_COMMON_LINKAGE CIMObjectWithPath |
Uint32 findQualifier(const CIMName& name) const; |
{ |
|
public: |
|
| |
/** Constructor |
/** |
|
Gets the qualifier at the specified index. |
|
@param index The index of the qualifier to be retrieved. |
|
@return The CIMConstQualifier at the specified index. |
|
@exception IndexOutOfBoundsException If the index is outside |
|
the range of qualifiers available for the CIMConstObject. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
CIMObjectWithPath(); |
CIMConstQualifier getQualifier(Uint32 index) const; |
| |
/** constructor |
/** |
|
Gets the number of qualifiers in the object. |
|
@return An integer count of the qualifiers in the CIMConstObject. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
CIMObjectWithPath(const CIMReference& reference, const CIMObject& object); |
Uint32 getQualifierCount() const; |
| |
/** Constructor - Constructs a CIMObjectWithPath Object from |
/** |
another CimObjectWithPath |
Finds a property by name. |
@param - ATTN |
@param name A CIMName specifying the name of the property to be found. |
|
@return Index of the property if found or PEG_NOT_FOUND if not found. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
CIMObjectWithPath(const CIMObjectWithPath& x); |
Uint32 findProperty(const CIMName& name) const; |
| |
~CIMObjectWithPath(); |
/** |
|
Gets the property at the specified index. |
|
@param index The index of the property to be retrieved. |
|
@return The CIMConstProperty at the specified index. |
|
@exception IndexOutOfBoundsException If the index is outside |
|
the range of properties available for the CIMConstObject. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
|
*/ |
|
CIMConstProperty getProperty(Uint32 index) const; |
| |
CIMObjectWithPath& operator=(const CIMObjectWithPath& x); |
/** |
|
Gets the number of properties in the object. |
|
@return An integer count of the properties in the CIMConstObject. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
|
*/ |
|
Uint32 getPropertyCount() const; |
| |
/** set - |
/** |
|
Makes a deep copy of the object. This creates a new copy of all |
|
the object attributes including qualifiers and properties. |
|
@return A CIMObject object with a separate copy of the |
|
CIMConstObject object. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
void set(const CIMReference& reference, const CIMObject& object); |
CIMObject clone() const; |
| |
/** | /** |
|
Compares the CIMConstObject with a specified CIMConstObject. |
|
@param x The CIMConstObject to be compared. |
|
@return True if this object is identical to the one specified, |
|
false otherwise. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
const CIMReference& getReference() const; |
Boolean identical(const CIMConstObject& x) const; |
| |
/** | /** |
|
Determines whether the object has been initialized. |
|
@return True if the object has not been initialized, false otherwise. |
*/ | */ |
const CIMObject& getObject() const; |
Boolean isUninitialized() const; |
| |
/** | /** |
|
Generates a human-readable String representing the value of the |
|
CIMObject. The String may be in MOF format, but the format is not |
|
guaranteed and may change without notice. |
|
@return A human-readable String representing the CIMObject value. |
|
@exception UninitializedObjectException If the object is not |
|
initialized. |
*/ | */ |
CIMReference& getReference(); |
String toString () const; |
| |
/** | /** |
|
Indicates whether the object represents a CIMConstClass. |
|
@return True if the object represents a CIMConstClass; false otherwise. |
*/ | */ |
CIMObject& getObject(); |
Boolean isClass() const; |
| |
#ifdef PEGASUS_INTERNALONLY |
|
/** | /** |
|
Indicates whether the object represents a CIMConstInstance. |
|
@return True if the object represents a CIMConstInstance; false |
|
otherwise. |
*/ | */ |
void toXml(Array<Sint8>& out) const; |
Boolean isInstance() const; |
#endif |
|
| |
private: | private: |
| |
CIMReference _reference; |
CIMObjectRep* _rep; |
CIMObject _object; |
|
|
void _checkRep() const; |
|
|
|
friend class CIMObject; |
|
friend class CIMClass; |
|
friend class CIMConstClass; |
|
friend class CIMInstance; |
|
friend class CIMConstInstance; |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |