(file) Return to CIMObject.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/CIMObject.h between version 1.25 and 1.41

version 1.25, 2002/05/24 01:36:59 version 1.41, 2004/08/25 00:14:24
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2003////////////////////////////////////////////////////////////////////////
 // //
 // 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.
 // //
 // 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
Line 20 
Line 23 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //              Carol Ann Krug Graves, Hewlett-Packard Company  
 //                  (carolann_graves@hp.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #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>
Line 52 
Line 51 
 // //
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
  
 /** This class either refers to a CIMInstance or a CIMClass.  /** The CIMObject class is the superclass for the CIMInstance and
       CIMClass classes.
  
     The CIMObjectRep data member points to either a CIMInstanceRep or     The CIMObjectRep data member points to either a CIMInstanceRep or
     CIMClassRep.     CIMClassRep.
Line 61 
Line 61 
 { {
 public: public:
  
     /** Constructor.      /** Creates CIMObject instance with null values (default constructor).
     */     */
     CIMObject();     CIMObject();
  
     /** Copy constructor.      /** Creates a new CIMObject instance (copy constructor).
       @param x Specifies the name of the CIMObject instance to create.
     */     */
     CIMObject(const CIMObject& x);     CIMObject(const CIMObject& x);
  
     /** Construction from CIMClass.      /** Construction of a CIMObject instance based on the CIMClass object.
     */     */
     CIMObject(const CIMClass& x);     CIMObject(const CIMClass& x);
  
     /** Construction from CIMInstance.      /** Construction of a CIMObject instance based on the CIMInstance object.
     */     */
     CIMObject(const CIMInstance& x);     CIMObject(const CIMInstance& x);
  
     /** Assignment operator.      /** Assign the values of the CIMObject instance to CIMObject.
       @param x Specifies the name of the CIMObject instance.
     */     */
     CIMObject& operator=(const CIMObject& x);     CIMObject& operator=(const CIMObject& x);
  
     /** Assignment operator.      /** Destroys CIMObject.
     */  
     CIMObject& operator=(const CIMClass& x);  
   
     /** Assignment operator.  
     */  
     CIMObject& operator=(const CIMInstance& x);  
   
     /** Destructor.  
     */     */
     ~CIMObject();     ~CIMObject();
  
     /** Accessor for ClassName component of the object.      /** Gets the ClassName of the object.
         @return - Returns the ClassName of the object in          @return ClassName of the object in a CIMName parameter. For example,
         a String parameter.  
         <pre>         <pre>
             String className;              CIMName className;
             CIMClass myclass("myclass", "superclass");             CIMClass myclass("myclass", "superclass");
             className = myclass.getClassName;             className = myclass.getClassName;
         </pre>         </pre>
     */     */
     const String& getClassName() const;      const CIMName& getClassName() const;
  
       /** REVIEWERS: Insert description here.
       */
     const CIMObjectPath& getPath() const;     const CIMObjectPath& getPath() const;
  
     /**      /** Sets the object path for the object.
       Sets the object path for the object          @param  path Specifies the CIMObjectPath that contains the object path.
       @param  path  CIMObjectPath containing the object path  
      */      */
     void setPath (const CIMObjectPath & path);     void setPath (const CIMObjectPath & path);
  
     /** addQualifier - Adds the CIMQualifier object to the instance.      /** Adds the CIMQualifier object to the instance.
         Thows an exception of the CIMQualifier already exists in the instance          @param qualifier CIMQualifier object to add to instance.
         @param CIMQualifier object to add to instance          @return The resulting CIMObject.
         @return ATTN:          @exception AlreadyExistsException True if the CIMQualifier already
         @exception Throws AlreadyExists.          exists in the instance; otherwise, false.
     */     */
     CIMObject& addQualifier(const CIMQualifier& qualifier);     CIMObject& addQualifier(const CIMQualifier& qualifier);
  
     /** findQualifier - Searches the instance for the qualifier object      /** Searches the instance for the qualifier object
         defined by the input parameter.         defined by the input parameter.
         @param String defining the qualifier object to be found.          @param name CIMName that defines the qualifier object to be found.
         @return - Position of the qualifier to be used in subsequent          @return  Position of the qualifier to use in subsequent
         operations or PEG_NOT_FOUND if the qualifier is not found.         operations or PEG_NOT_FOUND if the qualifier is not found.
     */     */
     Uint32 findQualifier(const String& name) const;      Uint32 findQualifier(const CIMName& name) const;
  
     /** existsQualifier - Searches the instance for the qualifier object      /** Retrieves the qualifier object defined by the input parameter.
         defined by the input parameter.          @param  index Specifies the index for the qualifier object. The index to
         @param String defining the qualifier object to be found.          qualifier objects is zero-origin and continuous so that
         @return - Returns True if  the qualifier object exists or false          incrementing loops can be used to get all qualifier
         if the qualifier is not found.          objects in a CIMInstance.
           @return CIMQualifier object defined by the index.
           @exception IndexOutOfBoundsException True if the index
           is out of bounds; otherwise, false.
       */
       CIMQualifier getQualifier(Uint32 index);
   
       /** Retrieves the qualifier object defined by the input parameter.
           @param index Specifies the index for the qualifier object. The index to
           qualifier objects is zero-origin and continuous so that
           incrementing loops can be used to get all qualifier
           objects in a CIMInstance.
           @return CIMConstQualifier object defined by the index.
           @exception IndexOutOfBoundsException True if the index
           is out of bounds; otherwise, false.
     */     */
     Boolean existsQualifier(const String& name) const;      CIMConstQualifier getQualifier(Uint32 index) const;
  
     /** getQualifier - Retrieves the qualifier object defined by the      /** REVIEWERS: Insert description here.
         index input parameter.  @ index for the qualifier object.  
         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: Returns qualifier object defined by index.  
         @exception Throws the OutOfBounds exception if the index  
         is out of bounds  
     */     */
     CIMQualifier getQualifier(Uint32 pos);      void removeQualifier(Uint32 index);
  
     /** getQualifier - Retrieves the qualifier object defined by the      /** Gets the number of CIMQualifier objects defined for
         index input parameter.  @ index for the qualifier object.          this 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: Returns qualifier object defined by index.  
         @exception Throws the OutOfBounds exception if the index  
         is out of bounds  
         ATTN: What is effect of out of range index???  
         ATTN: Is the above statement correct???  
     */  
     CIMConstQualifier getQualifier(Uint32 pos) const;  
   
     void removeQualifier(Uint32 pos);  
   
     /** getQualifierCount - Gets the number of CIMQualifier objects  
         defined for this CIMObject.  
         @return Count of the number of CIMQualifier objects in the         @return Count of the number of CIMQualifier objects in the
         CIMObject.         CIMObject.
         @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      /** Adds a property object defined by the input parameter to
         parameter to the CIMObject          the CIMObject.
         @param Property Object to be added.  See the CIM Property          @param x Property Object to be added. See the CIM Property
         class for definition of the property object          class for definition of the property object.
         @return ATTN:          @return The resulting CIMObject.
         @exception Throws the exception AlreadyExists if the property          @exception AlreadyExistsException True if the property already exists
         already exists.          otherwise, false.
     */     */
     CIMObject& addProperty(const CIMProperty& x);     CIMObject& addProperty(const CIMProperty& x);
  
     /** findProperty - Searches the CIMProperty objects installed in the      /** Searches the CIMProperty objects in the
         CIMObject for property objects with the name defined by the          CIMObject for a property object with the name defined by the
         input.          input parameter.
         @param String with the name of the property object to be found          @param name CIMName with the name of the property object to be found.
         @return Position in the CIM object to the property object if found or          @return Position in the CIM object of the property object if found or
         PEG_NOT_FOUND if no property object found with the name defined by the         PEG_NOT_FOUND if no property object found with the name defined by the
         input.          input parameter.
     */     */
     Uint32 findProperty(const String& name) const;      Uint32 findProperty(const CIMName& name) const;
  
     /** existsProperty - Determines if a property object with the      /** Gets the CIMProperty object in the CIMObject defined
         name defined by the input parameter exists in the class.          by the input parameter.
         @parm String parameter with the property name.          @param index Specifies the index to the property object in the CIMObject.
         @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         The index to qualifier objects is zero-origin and continuous
         so that incrementing loops can be used to get all qualifier         so that incrementing loops can be used to get all qualifier
         objects in a CIMObject.         objects in a CIMObject.
         @return CIMProperty object corresponding to the index.         @return CIMProperty object corresponding to the index.
         @exception Throws the OutOfBounds exception if the index          @exception IndexOutOfBoundsException True if the index
         is out of bounds          is out of bounds; otherwise, false.
   
         ATTN: What is the effect of out of range?  
     */     */
     CIMProperty getProperty(Uint32 pos);      CIMProperty getProperty(Uint32 index);
  
     /** getProperty - Gets the CIMproperty object in the CIMObject defined      /** Gets the CIMproperty object in the CIMObject defined
         by the input index parameter.          by the input parameter.
         @param Index to the property object in the CIMObject.          @param index Specifies the 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.         @return CIMProperty object corresponding to the index.
         @exception Throws the OutOfBounds exception if the index          @exception IndexOutOfBoundsException True if the index is outside the
         is out of bounds          range of properties in this object; otherwise, false.
   
         ATTN: What is the effect of out of range?  
     */     */
     CIMConstProperty getProperty(Uint32 pos) const;      CIMConstProperty getProperty(Uint32 index) const;
  
     /** removeProperty - Removes the property represented      /** Remove the specified property from the instance.
         by the position input parameter from the instance.          @param index Specifies the index to the property to be removed from the
         @param pos Index to the property to be removed from the          instance.  Normally this is obtained by findProperty();
         instance.  Normally this is obtained by getProperty();          @exception IndexOutOfBoundsException True if the index is outside the
         @exception Throws OutofBounds if index is not a property object          range of properties in this object; otherwise, false.
     */     */
     void removeProperty(Uint32 pos);      void removeProperty(Uint32 index);
  
     /** getPropertyCount - Gets the number of CIMProperty      /** Gets the number of CIMProperty objects defined for this CIMObject.
         objects defined for this CIMObject.  
         @return Count of the number of CIMProperty objects in the         @return Count of the number of CIMProperty objects in the
         CIMObject. Zero indicates that no CIMProperty objects         CIMObject. Zero indicates that no CIMProperty objects
         are contained in the CIMObject          are contained in the CIMObject.
         @exception Throws the OutOfBounds exception if the index  
         is out of bounds  
   
     */     */
     Uint32 getPropertyCount() const;     Uint32 getPropertyCount() const;
  
     /** Clones the given object.      /** Makes a deep copy (clone) of the given object.
           @return Copy of the CIMObject.
     */     */
     CIMObject clone() const;     CIMObject clone() const;
  
     /** Returns true if the two classes are structurally identical.      /** Compares with another CIM Object.
           @param x CIM object for comparison.
           @return True if the objects are identical; otherwise, false.
     */     */
     Boolean identical(const CIMConstObject& x) const;     Boolean identical(const CIMConstObject& x) const;
  
 #ifdef PEGASUS_INTERNALONLY      /** Determines if the object has not been initialized.
     /** isNull() - ATTN: */          @return  True if the object has not been initialized; otherwise, false.
     Boolean isNull() const;  
 #endif       */
       Boolean isUninitialized() const;
   
       /** Determines if the object represents a CIMClass.
           @return  True if the object represents a CIMClass; otherwise, false.
        */
       Boolean isClass () const;
   
       /** Determines if the object represents a CIMInstance.
           @return  True if the object represents a CIMInstance; otherwise, false.
        */
       Boolean isInstance () const;
  
 private: private:
  
     CIMObjectRep* _rep;     CIMObjectRep* _rep;
  
 #ifdef PEGASUS_INTERNALONLY  
     CIMObject(CIMObjectRep* rep);     CIMObject(CIMObjectRep* rep);
  
     void _checkRep() const;     void _checkRep() const;
Line 272 
Line 251 
     friend class CIMConstClass;     friend class CIMConstClass;
     friend class CIMInstance;     friend class CIMInstance;
     friend class CIMConstInstance;     friend class CIMConstInstance;
 #endif  
 }; };
  
 #define PEGASUS_ARRAY_T CIMObject #define PEGASUS_ARRAY_T CIMObject
Line 285 
Line 263 
 // //
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
  
   /**
   REVIEWERS: Add class defintion here
   */
 class PEGASUS_COMMON_LINKAGE CIMConstObject class PEGASUS_COMMON_LINKAGE CIMConstObject
 { {
 public: public:
  
       /** Constructs a new CIMConstObject with null values (default constructor).
       */
     CIMConstObject();     CIMConstObject();
  
       /** Constructs a new CIMConstObject.
       @param x Specifies the name of the CIMConstObject instance to create.
       */
     CIMConstObject(const CIMConstObject& x);     CIMConstObject(const CIMConstObject& x);
  
       /** Constructs a new CIMConstObject from a CIMObject instance.
       @param x Specifies the name of the CIMObject instance to use to create
       the CIMConstObject instance.
       */
     CIMConstObject(const CIMObject& x);     CIMConstObject(const CIMObject& x);
  
     /** Construction from CIMClass.      /** Constructs a CIMObject instance from a CIMClass instance.
       @param x Specifies the name of the CIMClass instance.
     */     */
     CIMConstObject(const CIMClass& x);     CIMConstObject(const CIMClass& x);
  
     /** Construction from CIMInstance.      /** Constructs a CIMObject instance from a CIMInstance instance.
       @param x Specifies the name of the CIMInstance instance.
     */     */
     CIMConstObject(const CIMInstance& x);     CIMConstObject(const CIMInstance& x);
  
     /** Construction from CIMClass.      /** Constructs a CIMObject instance from a CIMConstClass instance.
       @param x Specifies the name of the CIMConstClass instance.
     */     */
     CIMConstObject(const CIMConstClass& x);     CIMConstObject(const CIMConstClass& x);
  
     /** Construction from CIMInstance.      /** Constructs a CIMObject instance from a CIMConstInstance instance.
       @param x Specifies the name of the CIMConstInstance instance.
     */     */
     CIMConstObject(const CIMConstInstance& x);     CIMConstObject(const CIMConstInstance& x);
  
       /** REVIEWERS: Insert description here.
       @param x Specifies the name of the CIMConstObject instance.
       */
     CIMConstObject& operator=(const CIMConstObject& x);     CIMConstObject& operator=(const CIMConstObject& x);
  
     CIMConstObject& operator=(const CIMObject& x);      /** CIMConstObject destructor.
       */
     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;      /** REVIEWERS: Insert description here.
       */
       const CIMName& getClassName() const;
  
       /** REVIEWERS: Insert description here.
       */
     const CIMObjectPath& getPath() const;     const CIMObjectPath& getPath() const;
  
     Uint32 findQualifier(const String& name) const;      /** REVIEWERS: Insert description here.
       @param name Specifies the name of the CIMName instance.
       */
       Uint32 findQualifier(const CIMName& name) const;
  
     CIMConstQualifier getQualifier(Uint32 pos) const;      /** REVIEWERS: Insert description here.
       @param index Specifies the name of the Uint32 instance.
       */
       CIMConstQualifier getQualifier(Uint32 index) const;
  
       /** REVIEWERS: Insert description here.
       */
     Uint32 getQualifierCount() const;     Uint32 getQualifierCount() const;
  
     Uint32 findProperty(const String& name) const;      /** REVIEWERS: Insert description here.
       @param name Specifies the name of the CIMName instance.
       */
       Uint32 findProperty(const CIMName& name) const;
  
     CIMConstProperty getProperty(Uint32 pos) const;      /** REVIEWERS: Insert description here.
       @param index Specifies the name of the Uint32 instance.
       */
       CIMConstProperty getProperty(Uint32 index) const;
  
       /** REVIEWERS: Insert description here.
       */
     Uint32 getPropertyCount() const;     Uint32 getPropertyCount() const;
  
       /** REVIEWERS: Insert description here.
       */
     CIMObject clone() const;     CIMObject clone() const;
  
       /** REVIEWERS: Insert description here.
       */
     Boolean identical(const CIMConstObject& x) const;     Boolean identical(const CIMConstObject& x) const;
  
 #ifdef PEGASUS_INTERNALONLY      /** REVIEWERS: Insert description here.
     Boolean isNull() const;      */
 #endif      Boolean isUninitialized() const;
   
       /** REVIEWERS: Insert description here.
       */
       Boolean isClass() const;
   
       /** REVIEWERS: Insert description here.
       */
       Boolean isInstance() const;
  
 private: private:
  
     CIMObjectRep* _rep;     CIMObjectRep* _rep;
  
 #ifdef PEGASUS_INTERNALONLY  
     void _checkRep() const;     void _checkRep() const;
  
     friend class CIMObject;     friend class CIMObject;
Line 361 
Line 381 
     friend class CIMConstClass;     friend class CIMConstClass;
     friend class CIMInstance;     friend class CIMInstance;
     friend class CIMConstInstance;     friend class CIMConstInstance;
 #endif  
 };  
   
 /** The CIMObjectWithPath encapsulates a CIMObjectPath and CIMObject.  
     Accessors are provided for getting the two parts. Constructors are  
     provided for initializing it from a CIMObject.  
 */  
 class PEGASUS_COMMON_LINKAGE CIMObjectWithPath  
 {  
 public:  
   
     /** Constructor  
     */  
     CIMObjectWithPath();  
   
     /** constructor  
     */  
     CIMObjectWithPath(const CIMObjectPath& reference, const CIMObject& object);  
   
     /** Constructor - Constructs a CIMObjectWithPath Object from  
         another CimObjectWithPath  
         @param - ATTN  
     */  
     CIMObjectWithPath(const CIMObjectWithPath& x);  
   
     ~CIMObjectWithPath();  
   
     CIMObjectWithPath& operator=(const CIMObjectWithPath& x);  
   
     /** set -  
     */  
     void set(const CIMObjectPath& reference, const CIMObject& object);  
   
     /**  
     */  
     const CIMObjectPath& getReference() const;  
   
     /**  
     */  
     const CIMObject& getObject() const;  
   
     /**  
     */  
     CIMObjectPath& getReference();  
   
     /**  
     */  
     CIMObject& getObject();  
   
 private:  
   
     CIMObjectPath _reference;  
     CIMObject _object;  
 }; };
  
 #define PEGASUS_ARRAY_T CIMObjectWithPath  
 # include "ArrayInter.h"  
 #undef PEGASUS_ARRAY_T  
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* Pegasus_Object_h */ #endif /* Pegasus_Object_h */


Legend:
Removed from v.1.25  
changed lines
  Added in v.1.41

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2