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

Diff for /pegasus/src/Pegasus/Common/CIMClass.h between version 1.3 and 1.65

version 1.3, 2001/02/20 05:16:57 version 1.65, 2004/06/30 21:07:54
Line 1 
Line 1 
 //BEGIN_LICENSE  //%2003////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000 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
   // of this software and associated documentation files (the "Software"), to
   // deal in the Software without restriction, including without limitation the
   // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   // sell copies of the Software, and to permit persons to whom the Software is
   // furnished to do so, subject to the following conditions:
   //
   // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
   // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
   // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
   // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
   // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
   // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
   // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   //
   //==============================================================================
   //
   // 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)
   //              Adriann Schuur (schuur@de.ibm.com) PEP 164
   //              Karl Schopmeyer k.schopmeyer@opengroup.org (PEP 157)
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a  //%/////////////////////////////////////////////////////////////////////////////
 // copy of this software and associated documentation files (the "Software"),  
 // to deal in the Software without restriction, including without limitation  
 // the rights to use, copy, modify, merge, publish, distribute, sublicense,  
 // and/or sell copies of the Software, and to permit persons to whom the  
 // Software is furnished to do so, subject to the following conditions:  
 //  
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL  
 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING  
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER  
 // DEALINGS IN THE SOFTWARE.  
 //  
 //END_LICENSE  
 //BEGIN_HISTORY  
 //  
 // Author:  
 //  
 // $Log$  
 // Revision 1.3  2001/02/20 05:16:57  mike  
 // Implemented CIMInstance::getInstanceName()  
 //  
 // Revision 1.2  2001/02/19 01:47:16  mike  
 // Renamed names of the form CIMConst to ConstCIM.  
 //  
 // Revision 1.1  2001/02/18 18:39:05  mike  
 // new  
 //  
 // Revision 1.2  2001/02/18 03:56:00  mike  
 // Changed more class names (e.g., ConstClassDecl -> ConstCIMClass)  
 //  
 // Revision 1.1  2001/02/16 02:06:06  mike  
 // Renamed many classes and headers.  
 //  
 // Revision 1.5  2001/01/30 23:39:00  karl  
 // Add doc++ Documentation to header files  
 //  
 // Revision 1.4  2001/01/28 18:48:07  mike  
 // fixed typo in comment  
 //  
 // Revision 1.3  2001/01/28 18:46:50  mike  
 // more docs  
 //  
 // Revision 1.2  2001/01/15 04:31:43  mike  
 // worked on resolve scheme  
 //  
 // Revision 1.1.1.1  2001/01/14 19:50:37  mike  
 // Pegasus import  
 //  
 //  
 //END_HISTORY  
  
 #ifndef Pegasus_ClassDecl_h  #ifndef Pegasus_CIMClass_h
 #define Pegasus_ClassDecl_h  #define Pegasus_CIMClass_h
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/CIMClassRep.h>  #include <Pegasus/Common/Linkage.h>
   #include <Pegasus/Common/CIMName.h>
   #include <Pegasus/Common/CIMObject.h>
   #include <Pegasus/Common/CIMMethod.h>
   #include <Pegasus/common/CIMInstance.h>
   #include <Pegasus/Common/CIMPropertyList.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 class ConstCIMClass;  class CIMConstClass;
   class CIMClassRep;
   class Resolver;
  
 /** The CIMClass class is used to represent CIM classes in Pegasus.  In CIM,  
     a class object may be a class or an associator.  A CIM class must contain a  
     name and may contain methods, properties, and qualifiers.  It is a template  
     for creating a CIM instance.  A CIM class represents a collection of CIM  
     instances, all of which support a common type (for example, a set of  
     properties, methods, and associations).  
 */  
  
   /** The CIMClass class is used to represent CIM classes in Pegasus.
   */
 class PEGASUS_COMMON_LINKAGE CIMClass class PEGASUS_COMMON_LINKAGE CIMClass
 { {
 public: public:
  
     /** Constructor - Creates and instantiates a new object reprenting a CIM      /** Creates an uninitialized new CIM object representing a CIM class.
         class. If you use this constructor, use setName to define a name for          The class object created by this constructor can only be used
         the class          in an operation such as the copy constructor. It cannot be used
           to create a class by appending names, properties, etc. since it
           is uninitialized.
   
           Use one of the other constructors to create an initialized new
           CIM class object.
           @exception UninitializedObjectException if an attempt is made to
           use the unitialized object.
       */
       CIMClass();
   
       /** Creates a new CIM object representing a CIMClass from the given
           CIMClass object.
           @param x  CIMClass Object from which to create the CIMClass
       */
       CIMClass(const CIMClass& x);
   
       /** Creates a new CIMClass object representing a CIMClass from the given
           CIMObject Object.
           @param x  CIMObject object from which to create the CIMClass object.
           @exception DynamicCastFailedException If a CIMClass can not be
           created from the given CIMObject.
       */
       PEGASUS_EXPLICIT CIMClass(const CIMObject& x);
   
       /** Creates a new CIM object representing a CIMClass from inputs
           of a classname and SuperClassName.
           @param className  CIMName representing name of the class being created.
           @param superClassName CIMName representing name of the SuperClass.
           <pre>
               CIMClass NewClass("MyClass", "YourClass");
           </pre>
     */     */
     CIMClass() : _rep(0)      CIMClass(
     {          const CIMName& className,
           const CIMName& superClassName = CIMName());
  
     }      ///
       CIMClass& operator=(const CIMClass& x);
  
     /// Constructor - Creates a class from a previous class      /// Destructor
     CIMClass(const CIMClass& x)      ~CIMClass();
     {  
         Inc(_rep = x._rep);  
     }  
  
     /// Operator = ATTN:      /** Identifies whether or not this CIM class is an association. An
     CIMClass& operator=(const CIMClass& x)          association is a relationship between two (or more) classes or
     {          instances of two classes. The properties of an association class
         if (x._rep != _rep)          include pointers, or references, to the two (or more) instances.
         {          All CIM classes can be included in one or more associations.
             Dec(_rep);          @return  true if this CIM class is an association, false
             Inc(_rep = x._rep);          otherwise.
         }  
         return *this;  
     }  
   
     /**  Constructor - Creates a Class from inputs of a classname and  
         SuperClassName  
         @param className - String representing name of the class being created  
         @param superClassName - String representing name of the SuperClass  
         ATTN: Define what makes up legal name.  
         @return Throws IllegalName if className argument illegal CIM identifier.  
     */     */
     CIMClass(      Boolean isAssociation() const;
         const String& className,  
         const String& superClassName = String())  
     {  
         _rep = new CIMClassRep(className, superClassName);  
     }  
   
     /// Destructor  
     ~CIMClass()  
     {  
         Dec(_rep);  
     }  
  
     /** CIMMethod isAssociation - Identifies whether or not this CIM class      /** Tests if the CIMClass is abstract.
         is an association. An association is a relationship between two          @return true if the CIMClass Object is abstract, false otherwise.
         (or more) classes or instances of two classes.  The properties of an  
         association class include pointers, or references, to the two (or  
         more) instances. All CIM classes can be included in one or more  
         associations.  ATTN: Move the association definition elsewhere  
         @return  Boolean True if this CIM class belongs to an association;  
         otherwise, false.  
     */     */
     Boolean isAssociation() const      Boolean isAbstract() const;
     {  
         _checkRep();  
         return _rep->isAssociation();  
     }  
  
     ///  CIMMethod isAbstract  
     Boolean isAbstract() const  
     {  
         _checkRep();  
         return _rep->isAbstract();  
     }  
  
     /** CIMMethod Gets the name of the class      /** Gets the name of the class represented by this CIM object.
         ATTN: COMMENT. Why not just get name so we have common method for all.          @return CIMName with the class name.
     */     */
     const String& getClassName() const      const CIMName& getClassName() const;
     {  
         _checkRep();      ///
         return _rep->getClassName();      const CIMObjectPath& getPath() const;
     }  
  
     /** CIMMethod getSuperClassName - Gets the name of the Parent      /** Sets the object path for the class.
         @return String with parent class name.          @param  path  CIMObjectPath containing the object path.
     */     */
     const String& getSuperClassName() const      void setPath (const CIMObjectPath & path);
     {  
         _checkRep();      /** Gets the name of the Parent class of this CIM Object.
         return _rep->getSuperClassName();          @return CIMName with parent class name.
     }  
   
     /** CIMMethod setSuperClassName - Sets the name of the parent class from  
         the input parameter. \REF{CLASSNAME}. ATTN: Define legal classnames  
         @param - String defining parent name.  
         @return Throws IllegalName if superClassName argument not legal CIM  
         identifier.  
     */     */
     void setSuperClassName(const String& superClassName)      const CIMName& getSuperClassName() const;
     {  
         _checkRep();      /** Sets the name of the parent class from the input
         _rep->setSuperClassName(superClassName);          parameter.
     }          @param superClassName - CIMName defining parent class name.
   
     /** CIMMethod addQualifier - Adds the specified qualifier to the class  
         and increments the qualifier count. It is illegal to add the same  
         qualifier more than one time.  
         @param - CIMQualifier object representing the qualifier to be added  
         ATTN: Pointer to qualifier object.  
         @return Throws AlreadyExists.  
     */     */
     CIMClass& addQualifier(const CIMQualifier& qualifier)      void setSuperClassName(const CIMName& superClassName);
     {  
         _checkRep();      /** Adds the specified qualifier to the class and increments the
         _rep->addQualifier(qualifier);          qualifier count. It is illegal to add the same qualifier more
         return *this;          than one time.
     }          @param qualifier  CIMQualifier object representing the qualifier
           to be added.
     /** CIMMethod findQualifier - Finds a qualifier with the specified input          @return the CIMClass object.
         name if it exists in the class @param name CIMName of the qualifier          @exception AlreadyExistsException if the qualifier already exists.
         to be found @return Position of the qualifier in the Class ATTN:  
         Clarify the return.  What if not found, etc.  
     */     */
     Uint32 findQualifier(const String& name)      CIMClass& addQualifier(const CIMQualifier& qualifier);
     {  
         _checkRep();      /** Searches for a qualifier with the specified input name if it
         return _rep->findQualifier(name);          exists in the class.
     }          @param name  CIMName of the qualifier to be found
           @return Index of the qualifier found or PEG_NOT_FOUND
     /** CIMMethod FindQualifier - ATTN:          if not found.
         @param name of the qualifier to be found  
         @return ATTN: Define this  
     */     */
     Uint32 findQualifier(const String& name) const      Uint32 findQualifier(const CIMName& name) const;
     {  
         _checkRep();      /** Gets the CIMQualifier object defined by the input parameter.
         return _rep->findQualifier(name);          @param index  Index of the qualifier in the class from the
     }          findQualifier method.
   
     /**  CIMMethod getQualifier - Gets the CIMQualifier object defined  
         by the input parameter  
         @param pos defines the position of the qualifier in the class from the  
         findQualifier method  
         @return CIMQualifier object representing the qualifier found.         @return CIMQualifier object representing the qualifier found.
         ATTN: what is error return here?          On error, CIMQualifier object will be null.
           @exception IndexOutOfBoundsException exception if the index is
           outside the range of parameters available from the CIMClass.
     */     */
     CIMQualifier getQualifier(Uint32 pos)      CIMQualifier getQualifier(Uint32 index);
     {  
         _checkRep();  
         return _rep->getQualifier(pos);  
     }  
  
     /// CIMMethod getQualifier - ATTN:      /** Gets the qualifier defined by the input parameter from the
     CIMConstQualifier getQualifier(Uint32 pos) const          qualifier list for this CIMClass.
     {          @param index  Index of the qualifier in the CIM class.
         _checkRep();          @return CIMConstQualifier object representing the qualifier
         return _rep->getQualifier(pos);          found. On error, CIMConstQualifier object will be null.
     }          @exception IndexOutOfBoundsException exception if the index is
           outside the range of parameters available from the CIMClass.
     /** CIMMethod getQualifierCount - Returns the number of qualifiers  
         in the class.  
         @return ATTN:  
     */     */
     Uint32 getQualifierCount() const      CIMConstQualifier getQualifier(Uint32 index) const;
     {  
         _checkRep();  
         return _rep->getQualifierCount();  
     }  
  
     /** CIMMethod addProperty - Adds the specified property object to the      /** Removes the qualifier defined by the index parameter.
         properties in the CIM class          @param index  Defines the index of the qualifier to be removed.
           @exception IndexOutOfBoundsException if the index is outside
           the range of existing qualifier objects for this class.
     */     */
     CIMClass& addProperty(const CIMProperty& x)      void removeQualifier(Uint32 index);
     {  
         _checkRep();      /** Gets the count of the number of qualifiers defined in the class.
         _rep->addProperty(x);          @return the number of qualifiers in the class definition (not
         return *this;          those on properties or methods)
     }  
   
     /** CIMMethod removeProperty - Removes the property represented  
         by the position input parameter from the class  
         @param position parameter for the property to be removed from the  
         findPropety method  
         @return ATTN:  
     */     */
     void removeProperty(Uint32 pos)      Uint32 getQualifierCount() const;
     {  
         _checkRep();      /** Adds the specified property object to the properties in
         _rep->removeProperty(pos);          the CIM class
     }          @param x  CIMProperty to be added to the CIM Class.
           @return CIMClass object after the specified property is added.
     /** CIMMethod findProperty - Finds the property object with the  
         name defined by the input parameter in the class.  
         @param String parameter with the property name.  
         @return position representing the property object found.  
         ATTN:   Clarify case of not found  
     */     */
     Uint32 findProperty(const String& name)      CIMClass& addProperty(const CIMProperty& x);
     {  
         _checkRep();  
         return _rep->findProperty(name);  
     }  
  
     /// CIMMethod findProperty      /** Finds the property object with the name defined by the
     Uint32 findProperty(const String& name) const          input parameter in the class.
     {          @param name  CIMName with the property name to be found.
         _checkRep();          @return Index of the property object found or
         return _rep->findProperty(name);          PEG_NOT_FOUND if the property is not found.
     }  
   
     /** CIMMethod getProperty - Returns a property representing the property  
         defined by the input parameter  
         @param position for this property  
         ATTN: Should we not use something like handle for position???  
         @return CIMProperty object  
         ATTN: what is error return?  
     */     */
     CIMProperty getProperty(Uint32 pos)      Uint32 findProperty(const CIMName& name) const;
     {  
         _checkRep();  
         return _rep->getProperty(pos);  
     }  
  
     /// CIMMethod getProperty - ATTN      /** Gets a property object from the CIMClass.
     ConstCIMProperty getProperty(Uint32 pos) const          @param index  Index for the property object to get.
     {          @return CIMProperty object requested.
         _checkRep();          @exception IndexOutOfBoundsException if the index is outside
         return _rep->getProperty(pos);          the range of properties in this class.
     }  
   
     /** CIMMethod getProperty -   Gets the count of the number of properties  
         defined in the class.  
         @return count of number of proerties in the class  
     */     */
     Uint32 getPropertyCount() const      CIMProperty getProperty(Uint32 index);
     {  
         _checkRep();      /** Gets a property object from the CIMClass.
         return _rep->getPropertyCount();          @param index  Index for the property object to get.
     }          @return CIMProperty object requested.
           @exception IndexOutOfBoundsException if the index is outside
     /** CIMMethod addMethod - Adds the method object defined by the input          the range of properties in this class.
         parameter to the class and increments the count of the number of  
         methods in the class  
         @param - method object representing the method to be added  
     */     */
     CIMClass& addMethod(const CIMMethod& x)      CIMConstProperty getProperty(Uint32 index) const;
     {  
         _checkRep();      /** Removes the specified property from the class.
         _rep->addMethod(x);          @param index  Index of the property to be removed.
         return *this;          @exception IndexOutOfBoundsException if the index is outside
     }          the range of properties in this class.
   
     /** CIMMethod findMethod - Located the method object defined by the  
         name input  
         @param String representing the name of the method to be found  
         @return Position of the method object in the class to be used in  
         subsequent getmethod, etc. operations  
     */     */
     Uint32 findMethod(const String& name)      void removeProperty(Uint32 index);
     {  
         _checkRep();  
         return _rep->findMethod(name);  
     }  
  
     /// CIMMethod findMethod - ATTN:      /** Gets the count of the number of properties defined in the class.
     Uint32 findMethod(const String& name) const          @return count of number of properties in the class.
     {  
         _checkRep();  
         return _rep->findMethod(name);  
     }  
   
     /** CIMMethod getMethod - Gets the method object defined by the  
         input parameter.  
         @param   ATTN:  
         @ method object representing the method defined  
         ATTN: Error???  
     */     */
     CIMMethod getMethod(Uint32 pos)      Uint32 getPropertyCount() const;
     {  
         _checkRep();  
         return _rep->getMethod(pos);  
     }  
  
     /// CIMMethod getMethod - ATTN:      /** Adds the method object defined by the input parameter to the
     CIMConstMethod getMethod(Uint32 pos) const          class and increments the count of the number of methods in the class.
     {          @param name  CIMMethod object representing the method to be added.
         _checkRep();          @return the CIMClass object to which the method was added.
         return _rep->getMethod(pos);          @exception AlreadyExistsException if the method already exists.
     }          @exception UninitializedObjectException if the object is not initialized.
       */
       CIMClass& addMethod(const CIMMethod& x);
  
     /** CIMMethod getMethodCount - Count of the number of methods in the class      /** Locate the method object defined by the input parameter.
         @return integer representing the number of methods in the class          @param name  CIMName representing the name of the method to be found.
           @return Position of the method object in the class.
     */     */
     Uint32 getMethodCount() const      Uint32 findMethod(const CIMName& name) const;
     {  
         _checkRep();  
         return _rep->getMethodCount();  
     }  
   
     /** CIMMethod Resolve -  Resolve the class: inherit any properties and  
         qualifiers. Make sure the superClass really exists and is consistent  
         with this class. Also set the propagated flag class-origin for each  
         class feature.  
         ATTN: explain why this here  
     */  
     void resolve(  
         DeclContext* declContext,  
         const String& nameSpace)  
     {  
         _checkRep();  
         _rep->resolve(declContext, nameSpace);  
     }  
  
     /// operator - ATTN:      /** Gets the method object defined by the input parameter.
     operator int() const { return _rep != 0; }          @param index  Index to the method object to get.
           @return CIMMethod object of the method requested.
           @exception IndexOutOfBoundsException if the index is outside
           the range of methods in this class.
       */
       CIMMethod getMethod(Uint32 index);
  
     /// CIMMethod toXML      /** Gets the method object defined by the input parameter.
     void toXml(Array<Sint8>& out) const          @param index  Index to the method object to get.
     {          @return CIMConstMethod object of the method requested.
         _checkRep();          @exception IndexOutOfBoundsException if the index is outside
         _rep->toXml(out);          the range of methods in this class.
     }      */
       CIMConstMethod getMethod(Uint32 index) const;
  
     /// CIMMethod print      /** Removes the method defined by the index parameter.
     void print() const          @param index  Defines the index of the method to be removed.
     {          @exception IndexOutOfBoundsException if the index is outside
         _checkRep();          the range of methods in this class.
         _rep->print();  
     }  
   
     /** CIMMethod identical -  Compares with another class  
         ATTN: Clarify exactly what identical means  
         @parm Class object for the class to be compared  
         @return True if the classes are identical  
     */     */
     Boolean identical(const ConstCIMClass& x) const;      void removeMethod(Uint32 index);
  
     /// CIMMethod clone - ATTN:      /** Gets the count of the number of methods in the class.
     CIMClass clone() const          @return the count of the number of methods in the class object.
     {      */
         return CIMClass(_rep->clone());      Uint32 getMethodCount() const;
     }  
  
     void getKeyNames(Array<String>& keyNames) const      /// Get names of all keys of this class.
     {      void getKeyNames(Array<CIMName>& keyNames) const;
         _checkRep();  
         _rep->getKeyNames(keyNames);  
     }  
  
 private:      /** Determines if the object has keys.
           @return  true if the object has keys, false otherwise.
       */
       Boolean hasKeys() const;
  
     CIMClass(CIMClassRep* rep) : _rep(rep)      /** Makes a deep copy (clone) of the given object.
     {          @return copy of the CIMClass object.
     }      */
       CIMClass clone() const;
  
     void _checkRep() const      /** Compares with another CIM class.
     {          @param x  Class object for the class to be compared.
         if (!_rep)          @return true if the classes are identical, false otherwise.
             throw UnitializedHandle();      */
     }      Boolean identical(const CIMConstClass& x) const;
  
     CIMClassRep* _rep;      /** Determines if the object has not been initialized.
     friend class ConstCIMClass;          @return  true if the object has not been initialized,
 };          false otherwise.
       */
       Boolean isUninitialized() const;
   
       /**
       Build a CIMInstance based on this CIM Class.  Properties in the instance
       are initialized to the default values (if any) specified in the class
       definition.  The parameters of the call determine whether qualifiers are
       included, the class origin attributes are included and which properties
       are included in the new instance.  This method is designed specifically
       for providers to allow them to easily build instance objects using the
       parameters provided with the CIM instance operations such as getInstance,
       enumerateInstances.
   
       @param includeQualifiers If true attaches the class level qualifiers from
       this class to the instance and all properties inserted in the instance.
       If false, no qualifiers are attached to the instance or to any properties
       included in the instance.  The TOINSTANCE flavor is ignored.  Because
       there is still confusion over the exact operation of this parameter in the
       CIM specifications and the concept of instance level qualifiers, the
       behavior of this function when the parameter is true MAY change in the
       future to match any future clarifications of interoperable behavior in the
       CIM specifications.
   
       @param includeClassOrigin If true ClassOrigin attributes attached to
       properties inthe class object are transferred to the properties attached
       to the instance object.  If false, any ClassOrigin attributes are ignored.
  
 /** ConstCIMClass      @param propertyList A CIMPropertyList defining the properties that are to
       be added to the created instance.  If propertyList is not NULL properties
       defined in the class and in this propertyList are added to the new
       instance.  If the propertyLlist is NULL, all properties are added to the
       instance.  If the propertyList exists but is empty, not properties are
       added.  Note that this function does NOT generate an error if a property
       name is supplied that is NOT in the class; it simply does not add that
       property to the instance.
  
       @return CIMInstance of this class appropriately initialized.
   
       EXAMPLE:
   
       <Will be provided with the code>
 */ */
       CIMInstance createInstance(Boolean includeQualifiers,
           Boolean includeClassOrigin,
           const CIMPropertyList & propertyList) const;
   
   private:
  
 class PEGASUS_COMMON_LINKAGE ConstCIMClass      CIMClassRep* _rep;
   
       CIMClass(CIMClassRep* rep);
   
       void _checkRep() const;
   
       friend class CIMConstClass;
       friend class CIMObject;
       friend class CIMConstObject;
       friend class Resolver;
       friend class XmlWriter;
       friend class MofWriter;
       friend class BinaryStreamer;
   };
   
   #define PEGASUS_ARRAY_T CIMClass
   #include <Pegasus/Common/ArrayInter.h>
   #undef PEGASUS_ARRAY_T
   
   /// CIMConstClass
   class PEGASUS_COMMON_LINKAGE CIMConstClass
 { {
 public: public:
  
     ConstCIMClass() : _rep(0)      ///
     {      CIMConstClass();
  
     }      ///
       CIMConstClass(const CIMConstClass& x);
  
     ConstCIMClass(const ConstCIMClass& x)      ///
     {      CIMConstClass(const CIMClass& x);
         Inc(_rep = x._rep);  
     }  
  
     ConstCIMClass(const CIMClass& x)      ///
     {      PEGASUS_EXPLICIT CIMConstClass(const CIMObject& x);
         Inc(_rep = x._rep);  
     }  
  
     ConstCIMClass& operator=(const ConstCIMClass& x)      ///
     {      PEGASUS_EXPLICIT CIMConstClass(const CIMConstObject& x);
         if (x._rep != _rep)  
         {  
             Dec(_rep);  
             Inc(_rep = x._rep);  
         }  
         return *this;  
     }  
  
     ConstCIMClass& operator=(const CIMClass& x)      ///
     {      CIMConstClass(
         if (x._rep != _rep)          const CIMName& className,
         {          const CIMName& superClassName = CIMName());
             Dec(_rep);  
             Inc(_rep = x._rep);  
         }  
         return *this;  
     }  
   
     // Throws IllegalName if className argument not legal CIM identifier.  
   
     ConstCIMClass(  
         const String& className,  
         const String& superClassName = String())  
     {  
         _rep = new CIMClassRep(className, superClassName);  
     }  
  
     ~ConstCIMClass()      ///
     {      CIMConstClass& operator=(const CIMConstClass& x);
         Dec(_rep);  
     }  
  
     Boolean isAssociation() const      ///
     {      CIMConstClass& operator=(const CIMClass& x);
         _checkRep();  
         return _rep->isAssociation();  
     }  
  
     Boolean isAbstract() const      ///
     {      ~CIMConstClass();
         _checkRep();  
         return _rep->isAbstract();  
     }  
  
     const String& getClassName() const      ///
     {      Boolean isAssociation() const;
         _checkRep();  
         return _rep->getClassName();  
     }  
  
     const String& getSuperClassName() const      ///
     {      Boolean isAbstract() const;
         _checkRep();  
         return _rep->getSuperClassName();  
     }  
  
     Uint32 findQualifier(const String& name) const      ///
     {      const CIMName& getClassName() const;
         _checkRep();  
         return _rep->findQualifier(name);  
     }  
  
     CIMConstQualifier getQualifier(Uint32 pos) const      ///
     {      const CIMObjectPath& getPath() const;
         _checkRep();  
         return _rep->getQualifier(pos);  
     }  
  
     Uint32 getQualifierCount() const      ///
     {      const CIMName& getSuperClassName() const;
         _checkRep();  
         return _rep->getQualifierCount();  
     }  
  
     Uint32 findProperty(const String& name) const      ///
     {      Uint32 findQualifier(const CIMName& name) const;
         _checkRep();  
         return _rep->findProperty(name);  
     }  
  
     ConstCIMProperty getProperty(Uint32 pos) const      ///
     {      CIMConstQualifier getQualifier(Uint32 index) const;
         _checkRep();  
         return _rep->getProperty(pos);  
     }  
  
     Uint32 getPropertyCount() const      ///
     {      Uint32 getQualifierCount() const;
         _checkRep();  
         return _rep->getPropertyCount();  
     }  
  
     Uint32 findMethod(const String& name) const      ///
     {      Uint32 findProperty(const CIMName& name) const;
         _checkRep();  
         return _rep->findMethod(name);  
     }  
  
     CIMConstMethod getMethod(Uint32 pos) const      ///
     {      CIMConstProperty getProperty(Uint32 index) const;
         _checkRep();  
         return _rep->getMethod(pos);  
     }  
  
     Uint32 getMethodCount() const      ///
     {      Uint32 getPropertyCount() const;
         _checkRep();  
         return _rep->getMethodCount();  
     }  
  
     operator int() const { return _rep != 0; }      ///
       Uint32 findMethod(const CIMName& name) const;
  
     void toXml(Array<Sint8>& out) const      ///
     {      CIMConstMethod getMethod(Uint32 index) const;
         _checkRep();  
         _rep->toXml(out);  
     }  
  
     void print() const      ///
     {      Uint32 getMethodCount() const;
         _checkRep();  
         _rep->print();  
     }  
  
     Boolean identical(const ConstCIMClass& x) const      ///
     {      void getKeyNames(Array<CIMName>& keyNames) const;
         x._checkRep();  
         _checkRep();  
         return _rep->identical(x._rep);  
     }  
  
     CIMClass clone() const      ///
     {      Boolean hasKeys() const;
         return CIMClass(_rep->clone());  
     }  
  
     void getKeyNames(Array<String>& keyNames) const      ///
     {      CIMClass clone() const;
         _checkRep();  
         _rep->getKeyNames(keyNames);  
     }  
  
 private:      ///
       Boolean identical(const CIMConstClass& x) const;
  
     void _checkRep() const      ///
     {      Boolean isUninitialized() const;
         if (!_rep)  
             throw UnitializedHandle();  private:
     }  
  
     CIMClassRep* _rep;     CIMClassRep* _rep;
  
       void _checkRep() const;
   
     friend class CIMClassRep;     friend class CIMClassRep;
     friend class CIMClass;     friend class CIMClass;
     friend class CIMInstanceRep;     friend class CIMInstanceRep;
       friend class CIMObject;
       friend class CIMConstObject;
       friend class XmlWriter;
       friend class MofWriter;
       friend class BinaryStreamer;
 }; };
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* Pegasus_ClassDecl_h */  #endif /* Pegasus_CIMClass_h */


Legend:
Removed from v.1.3  
changed lines
  Added in v.1.65

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2