(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.30 and 1.73

version 1.30, 2002/03/24 13:33:07 version 1.73, 2006/02/17 19:30:37
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%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
Line 20 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By:  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #ifndef Pegasus_CIMClass_h #ifndef Pegasus_CIMClass_h
 #define Pegasus_CIMClass_h #define Pegasus_CIMClass_h
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
   #include <Pegasus/Common/Linkage.h>
   #include <Pegasus/Common/CIMName.h>
 #include <Pegasus/Common/CIMObject.h> #include <Pegasus/Common/CIMObject.h>
 #include <Pegasus/Common/CIMClassRep.h>  #include <Pegasus/Common/CIMMethod.h>
   #include <Pegasus/Common/CIMInstance.h>
   #include <Pegasus/Common/CIMPropertyList.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 class CIMConstClass; class CIMConstClass;
 class CIMObject;  class CIMClassRep;
 class CIMConstObject;  class Resolver;
  
 // REVIEW: redocument.  
  
 /** 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      The CIMClass class represents the DMTF standard CIM class definition.
     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      <p>The CIMClass class uses a shared representation model, such that
     instances, all of which support a common type (for example, a set of      multiple CIMClass objects may refer to the same data copy.  Assignment
     properties, methods, and associations).      and copy operators create new references to the same data, not distinct
       copies.  An update to a CIMClass object affects all the CIMClass
       objects that refer to the same data copy.  The data remains valid until
       all the CIMClass objects that refer to it are destructed.  A separate
       copy of the data may be created using the clone method.
 */ */
 class PEGASUS_COMMON_LINKAGE CIMClass class PEGASUS_COMMON_LINKAGE CIMClass
 { {
 public: public:
  
     /** Constructor - Creates an uninitiated a new CIM object      /**
         reprenting a CIM class. The class object created by this          Constructs an uninitialized CIMClass object.  A method
         constructor can only be used in an operation such as the          invocation on an uninitialized object will result in the throwing
         copy constructor.  It cannot be used to create a class by          of an UninitializedObjectException.  An uninitialized object may
         appending names, properties, etc. since it is unitiated.          be converted into an initialized object only by using the assignment
           operator with an initialized object.
         Use one of the other constructors to create an initiated new CIM class      */
         object.      CIMClass();
         @exception Throws an exception "unitialized handle" if this  
         unitialized handle is used      /**
         /REF(HPEGASUS_HANDLES)          Constructs a CIMClass 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 a new
               CIMClass object.
       */
       CIMClass(const CIMClass& x);
   
       /**
           Constructs a CIMClass 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 the
               CIMClass object.
           @exception DynamicCastFailedException If a CIMClass can not be
               created from the given CIMObject.
     */     */
     CIMClass() : _rep(0)  
     {  
     }  
   
     /** Constructor - Creates a class from a previous class  
     */  
     CIMClass(const CIMClass& x)  
     {  
         Inc(_rep = x._rep);  
     }  
   
     PEGASUS_EXPLICIT CIMClass(const CIMObject& x);     PEGASUS_EXPLICIT CIMClass(const CIMObject& x);
  
     PEGASUS_EXPLICIT CIMClass(const CIMObject& x, NoThrow&);      /**
           Constructs a CIMClass object with the specified attributes.
     /** Assignment operator.          <p><b>Example:</b>
     */  
     CIMClass& operator=(const CIMClass& x)  
     {  
         if (x._rep != _rep)  
         {  
             Dec(_rep);  
             Inc(_rep = x._rep);  
         }  
         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.  
         <pre>         <pre>
             CIMClass NewCass("MyClass", "YourClass");              CIMClass NewClass("MyClass", "YourClass");
         </pre>         </pre>
  
           @param className A CIMName specifying the name of the class.
           @param superClassName A CIMName specifying name of the parent class.
               (A null value indicates no superclass.)
     */     */
     CIMClass(     CIMClass(
         const CIMReference& reference,          const CIMName& className,
         const String& superClassName = String())          const CIMName& superClassName = CIMName());
     {  
         _rep = new CIMClassRep(reference, superClassName);  
     }  
  
     /// Destructor      /**
     ~CIMClass()          Assigns the value of the specified CIMClass object to this object,
     {          so that both objects refer to the same data copy.
         Dec(_rep);          @param x The CIMClass object from which to assign this CIMClass
     }              object.
           @return A reference to this CIMClass object.
     /** isAssociation - Identifies whether or not this CIM class  
         is an association. An association is a relationship between two  
         (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.  
         @return  Boolean True if this CIM class belongs to an association;  
         otherwise, false.  
     */  
     Boolean isAssociation() const  
     {  
         _checkRep();  
         return _rep->isAssociation();  
     }  
   
     /** isAbstract Test if the CIMClass is abstract.  
         @return - True if the CIMClass Object is abstract  
         SeeAlso: Abstract  
     */  
     Boolean isAbstract() const  
     {  
         _checkRep();  
         return _rep->isAbstract();  
     }  
   
     /** getClassName Gets the name of the class  
         ATTN: COMMENT. Why not just get name so we have common method for all.  
         @return Returns string with the class name.  
     */  
     const String& getClassName() const  
     {  
         _checkRep();  
         return _rep->getClassName();  
     }  
   
     const CIMReference& getPath() const  
     {  
         _checkRep();  
         return _rep->getPath();  
     }  
   
     /** getSuperClassName - Gets the name of the Parent  
         @return String with parent class name.  
     */  
     const String& getSuperClassName() const  
     {  
         _checkRep();  
         return _rep->getSuperClassName();  
     }  
   
     /** 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  
         @exception throws IllegalName if the name is not correct. See  
         \URL[ClassNames]{DefinitionofTerms.html#CLASSNAME}  
     */  
     void setSuperClassName(const String& superClassName)  
     {  
         _checkRep();  
         _rep->setSuperClassName(superClassName);  
     }  
   
     /** 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 qualifier CIMQualifier object representing the qualifier to be  
         added  
         @return Returns handle of the class object  
         @exception Throws AlreadyExists.  
     */  
     CIMClass& addQualifier(const CIMQualifier& qualifier)  
     {  
         _checkRep();  
         _rep->addQualifier(qualifier);  
         return *this;  
     }  
   
     /** findQualifier - Searches for a qualifier with the specified `  
         input name if it exists in the class  
         @param name CIMName of the qualifier  
         to be found @return Position of the qualifier in the Class.  
         @return Returns index of the qualifier found or PEG_NOT_FOUND  
         if not found.  
     */  
     Uint32 findQualifier(const String& name)  
     {  
         _checkRep();  
         return _rep->findQualifier(name);  
     }  
     ///  
     Uint32 findQualifier(const String& name) const  
     {  
         _checkRep();  
         return _rep->findQualifier(name);  
     }  
     /** existsQualifier - Returns true if the qualifier with the  
     specified name exists in the class  
     @param name String name of the qualifier object being tested.  
     @return True if the qualifier exits.  Otherwise false is returned.  
     */  
     Boolean existsQualifier(const String& name)  
     {  
         _checkRep();  
         return _rep->existsQualifier(name);  
     }  
     ///  
     Boolean existsQualifier(const String& name) const  
     {  
         _checkRep();  
         return _rep->existsQualifier(name);  
     }  
   
     /** 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. On error,  
             CIMQualifier handle will be null.  
     */  
     CIMQualifier getQualifier(Uint32 pos)  
     {  
         _checkRep();  
         return _rep->getQualifier(pos);  
     }  
   
     /// getQualifier - ATTN:  
     CIMConstQualifier getQualifier(Uint32 pos) const  
     {  
         _checkRep();  
         return _rep->getQualifier(pos);  
     }  
   
     /** removeQualifier - Removes the qualifier defined by the  
     index parameter.  
     @param Defines the index of the qualifier to be removed.  
     @return There is no return.  
     @exception Throw OutOfBound exception if the index is outside  
     the range of existing qualifier objects for this class  
     */  
     void removeQualifier(Uint32 pos) const  
     {  
         _checkRep();  
         _rep->removeQualifier(pos);  
     }  
   
     /** getQualifierCount - Returns the number of qualifiers  
         in the class.  
         @return ATTN:  
     */  
     Uint32 getQualifierCount() const  
     {  
         _checkRep();  
         return _rep->getQualifierCount();  
     }  
   
     /** addProperty - Adds the specified property object to the  
         properties in the CIM class  
     */  
     CIMClass& addProperty(const CIMProperty& x)  
     {  
         _checkRep();  
         _rep->addProperty(x);  
         return *this;  
     }  
   
     /** 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 or  
         PEG_NOT_FOUND if the property is not found.  
     */  
     Uint32 findProperty(const String& name)  
     {  
         _checkRep();  
         return _rep->findProperty(name);  
     }  
   
     Uint32 findProperty(const String& name) const  
     {  
         _checkRep();  
         return _rep->findProperty(name);  
     }  
   
     /** existsPropery - 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)  
     {  
         _checkRep();  
         return _rep->existsProperty(name);  
     }  
   
         Boolean existsProperty(const String& name) const  
     {  
        _checkRep();  
        return _rep->existsProperty(name);  
     }  
   
     /** 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)  
     {  
         _checkRep();  
         return _rep->getProperty(pos);  
     }  
   
     /**getProperty Gets a property object from the CIMClass  
         @param pos The index of the property object to get.  
         @return Returns handle of the property object requested  
         @exception Throws OutofBounds if the size field is greather than the  
         bunber of properties in the class.  
     */  
     CIMConstProperty getProperty(Uint32 pos) const  
     {  
         _checkRep();  
         return _rep->getProperty(pos);  
     }  
   
     /** removeProperty - Removes the property represented  
         by the position input parameter from the class  
         @param pos Index to the property to be removed from the  
         findPropety method  
         @exception Throws OutofBounds if index is not a property object  
     */  
     void removeProperty(Uint32 pos)  
     {  
         _checkRep();  
         _rep->removeProperty(pos);  
     }  
   
     /** getPropertyCount -   Gets the count of the number of properties  
         defined in the class.  
         @return count of number of proerties in the class  
     */  
     Uint32 getPropertyCount() const  
     {  
         _checkRep();  
         return _rep->getPropertyCount();  
     }  
   
     /** addMethod - Adds the method object defined by the input  
         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  
         @return Returns the CIMClass object to which the method was added.  
         @exception Throws AlreadyExists if the method already exists and throws  
         UnitializedHandle if the handle is not initialized  
     */  
     CIMClass& addMethod(const CIMMethod& x)  
     {  
         _checkRep();  
         _rep->addMethod(x);  
         return *this;  
     }  
   
     /** findMethod - Locate 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)  
     {  
         _checkRep();  
         return _rep->findMethod(name);  
     }  
   
     Uint32 findMethod(const String& name) const  
     {  
         _checkRep();  
         return _rep->findMethod(name);  
     }  
   
      /** existsMethod - Determine if the method object defined by the  
         name input exists  
         @param String representing the name of the method to be found  
         @return True if the method exists  
     */  
     Boolean existsMethod(const String& name)  
     {  
         _checkRep();  
         return _rep->existsMethod(name);  
     }  
   
     Boolean existsMethod(const String& name) const  
     {  
         _checkRep();  
         return _rep->existsMethod(name);  
     }  
   
     /** getMethod - Gets the method object defined by the  
         input parameter.  
         @param pos Index to the method object to get  
         @return Returns handle of the method requested  
         @exception Throws OutofBounds if the index represented by pos is greater  
         than the number of methods defined in the class object  
     */  
     CIMMethod getMethod(Uint32 pos)  
     {  
         _checkRep();  
         return _rep->getMethod(pos);  
     }  
   
     /** getMethod Gets the method object defined by the input  
     parameter. This is the const version.  
     */  
   
     CIMConstMethod getMethod(Uint32 pos) const  
     {  
         _checkRep();  
         return _rep->getMethod(pos);  
     }  
   
     /** removeMethod - Removes the method defined by the  
     index parameter.  
     @param Defines the index of the method to be removed.  
     @return There is no return.  
     @exception Throw OutOfBound exception if the index is outside  
     the range of existing method objects for this class  
     */     */
     void removeMethod(Uint32 pos) const      CIMClass& operator=(const CIMClass& x);
     {  
         _checkRep();  
         _rep->removeMethod(pos);  
     }  
  
     /** getMethodCount - Count of the number of methods in the class      /**
         @return integer representing the number of methods in the class object.          Destructs the CIMClass object.
     */  
     Uint32 getMethodCount() const  
     {  
         _checkRep();  
         return _rep->getMethodCount();  
     }  
   
     /** 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:  
     operator int() const { return _rep != 0; }  
   
     /** toXML  - prepares an XML representation of the CIMClass object  
         in the provided Sint8 variable.  
         @param out Sint8 array for the XML representation  
     */     */
     void toXml(Array<Sint8>& out) const      ~CIMClass();
     {  
         _checkRep();  
         _rep->toXml(out);  
     }  
  
     /** print -  Prints the toXML output to cout      /**
     */          Indicates whether this class is an association class.  An
     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const          association is a relationship between two (or more) classes or
     {          instances.  The Association qualifier is used to make this
         _checkRep();          determination.
         _rep->print(o);          @return True if this class is an association class, false otherwise.
     }          @exception UninitializedObjectException If the object is not
               initialized.
     /** toMof  - prepares a MOF representation of the CIMClass object      */
         in the provided Sint8 variable.      Boolean isAssociation() const;
         @param out Sint8 array for the XML representation  
     */      /**
     void toMof(Array<Sint8>& out) const          Indicates whether this class is an abstract class.
     {          The Abstract qualifier is used to make this determination.
         _checkRep();          @return True if this class is an abstract class, false otherwise.
         _rep->toMof(out);          @exception UninitializedObjectException If the object is not
     }              initialized.
     /** printMof -  Prints the toMof output to cout      */
     */      Boolean isAbstract() const;
     void printMof(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const  
     {      /**
         _checkRep();          Gets the name of the class.
         _rep->printMof(o);          @return A CIMName containing the class name.
     }          @exception UninitializedObjectException If the object is not
               initialized.
     /** identical -  Compares with another class      */
         ATTN: Clarify exactly what identical means      const CIMName& getClassName() const;
         @param Class object for the class to be compared  
         @return True if the classes are identical      /**
           Gets the object path for the class.
           @return A CIMObjectPath containing the object path.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       const CIMObjectPath& getPath() const;
   
       /**
           Sets the object path for the class.
           @param path A CIMObjectPath containing the object path.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       void setPath (const CIMObjectPath & path);
   
       /**
           Gets the name of the parent class of this class.
           @return A CIMName containing parent class name.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       const CIMName& getSuperClassName() const;
   
       /**
           Sets the name of the parent class.
           @param superClassName A CIMName specifying the parent class name.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       void setSuperClassName(const CIMName& superClassName);
   
       /**
           Adds a qualifier to the class.
           @param qualifier The CIMQualifier to be added.
           @return A reference to this CIMClass object.
           @exception AlreadyExistsException If a qualifier with the
               same name already exists in the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMClass& addQualifier(const CIMQualifier& qualifier);
   
       /**
           Finds a qualifier by name.
           @param name A CIMName specifying the name of the qualifier to be found.
           @return Index of the qualifier if found or PEG_NOT_FOUND if not found.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Uint32 findQualifier(const CIMName& name) const;
   
       /**
           Gets the qualifier at the specified index.
           @param index The index of the qualifier to be retrieved.
           @return The CIMQualifier at the specified index.
           @exception IndexOutOfBoundsException If the index is outside
               the range of qualifiers available for the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMQualifier getQualifier(Uint32 index);
   
       /**
           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 CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMConstQualifier getQualifier(Uint32 index) const;
   
       /**
           Removes a qualifier from the class.
           @param index The index of the qualifier to remove.
           @exception IndexOutOfBoundsException If the index is
               outside the range of qualifiers available for the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       void removeQualifier(Uint32 index);
   
       /**
           Gets the number of qualifiers in the class.
           @return An integer count of the qualifiers in the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Uint32 getQualifierCount() const;
   
       /**
           Adds a property to the class.
           @param x The CIMProperty to be added.
           @return A reference to this CIMClass object.
           @exception AlreadyExistsException If a property with the
               same name already exists in the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMClass& addProperty(const CIMProperty& x);
   
       /**
           Finds a property by name.
           @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.
       */
       Uint32 findProperty(const CIMName& name) const;
   
       /**
           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 CIMClass.
           @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 CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMConstProperty getProperty(Uint32 index) const;
   
       /**
           Removes a property from the class.
           @param index The index of the property to remove.
           @exception IndexOutOfBoundsException If the index is
               outside the range of properties available for the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       void removeProperty(Uint32 index);
   
       /**
           Gets the number of properties in the class.
           @return An integer count of the properties in the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Uint32 getPropertyCount() const;
   
       /**
           Adds a method to the class.
           @param x The CIMMethod to be added.
           @return A reference to this CIMClass object.
           @exception AlreadyExistsException If a method with the
               same name already exists in the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMClass& addMethod(const CIMMethod& x);
   
       /**
           Finds a method by name.
           @param name A CIMName specifying the name of the method to be found.
           @return Index of the method if found or PEG_NOT_FOUND if not found.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Uint32 findMethod(const CIMName& name) const;
   
       /**
           Gets the method at the specified index.
           @param index The index of the method to be retrieved.
           @return The CIMMethod at the specified index.
           @exception IndexOutOfBoundsException If the index is outside
               the range of methods available for the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMMethod getMethod(Uint32 index);
   
       /**
           Gets the method at the specified index.
           @param index The index of the method to be retrieved.
           @return The CIMConstMethod at the specified index.
           @exception IndexOutOfBoundsException If the index is outside
               the range of methods available for the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMConstMethod getMethod(Uint32 index) const;
   
       /**
           Removes a method from the class.
           @param index The index of the method to remove.
           @exception IndexOutOfBoundsException If the index is
               outside the range of methods available for the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       void removeMethod(Uint32 index);
   
       /**
           Gets the number of methods in the class.
           @return An integer count of the methods in the CIMClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Uint32 getMethodCount() const;
   
       /**
           Gets the list of key properties in this class.  The Key qualifier
           on CIMProperty objects is used to locate key properties.
           @return An Array of CIMName objects containing the names of the key
           properties.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       void getKeyNames(Array<CIMName>& keyNames) const;
   
       /**
           Indicates whether this class contains key properties.  The Key
           qualifier on CIMProperty objects is used to make this determination.
           @return True if this class contains key properties, false otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Boolean hasKeys() const;
   
       /**
           Makes a deep copy of the class.  This creates a new copy of all
           the class attributes including qualifiers, properties, and methods.
           @return A new copy of the CIMClass object.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMClass clone() const;
   
       /**
           Compares the CIMClass with a specified CIMConstClass.
           @param x The CIMConstClass to be compared.
           @return True if this class is identical to the one specified,
               false otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     Boolean identical(const CIMConstClass& x) const;     Boolean identical(const CIMConstClass& x) const;
  
     /** Makes a deep copy (clone) of the given object. */      /**
     CIMClass clone() const          Determines whether the object has been initialized.
     {          @return True if the object has not been initialized, false otherwise.
         return CIMClass((CIMClassRep*)(_rep->clone()));      */
     }      Boolean isUninitialized() const;
   
   #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
       /**
           <I><B>Experimental Interface</B></I><BR>
           Builds a CIMInstance based on this CIMClass.  Properties in the
           instance are initialized to the default values (if any) specified
           in the class definition.  The method arguments 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 and enumerateInstances.
  
     /** Get names of all keys of this class. */          <p><b>Example:</b>
     void getKeyNames(Array<String>& keyNames) const          <pre>
     {              CIMClass myClass .. a defined and complete CIMClass.
         _checkRep();              // create instance with qualifiers, class origin and all properties
         _rep->getKeyNames(keyNames);              CIMInstance myInstance =
     }                  myClass.buildInstance(true, true, CIMPropertyList());
           </pre>
  
     Boolean hasKeys() const          @param includeQualifiers A Boolean indicating whether qualifiers in
     {          the class definition (and its properties) are to be added to the
         _checkRep();          instance.  If false, no qualifiers are added to the instance or its
         return _rep->hasKeys();          properties.  The TOINSTANCE flavor is ignored.  Because the CIM
     }          specification is unclear on the meaning of this parameter and its
           relationship to instance operations, the behavior when this parameter
           is true MAY change in the future based on clarifications of the
           CIM specification.
   
           @param includeClassOrigin A Boolean indicating whether ClassOrigin
           attributes are to be transferred from the class object to the
           instance.
   
           @param propertyList A CIMPropertyList defining the properties that
           are to be added to the created instance.  If the propertyList is not
           NULL, properties defined in the class and in this propertyList are
           added to the new instance.  If the propertyList is NULL, all
           properties are added to the instance.  If the propertyList is empty,
           no 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.
   
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMInstance buildInstance(Boolean includeQualifiers,
           Boolean includeClassOrigin,
           const CIMPropertyList & propertyList) const;
   #endif
  
 private: private:
  
     CIMClass(CIMClassRep* rep) : _rep(rep)      CIMClassRep* _rep;
     {  
     }  
  
     void _checkRep() const      CIMClass(CIMClassRep* rep);
     {  
         if (!_rep)      void _checkRep() const;
             ThrowUnitializedHandle();  
     }  
  
     CIMClassRep* _rep;  
     friend class CIMConstClass;     friend class CIMConstClass;
     friend class CIMObject;     friend class CIMObject;
     friend class CIMConstObject;     friend class CIMConstObject;
       friend class Resolver;
       friend class XmlWriter;
       friend class MofWriter;
       friend class BinaryStreamer;
 }; };
  
 #define PEGASUS_ARRAY_T CIMClass #define PEGASUS_ARRAY_T CIMClass
 # include "ArrayInter.h"  #include <Pegasus/Common/ArrayInter.h>
 #undef PEGASUS_ARRAY_T #undef PEGASUS_ARRAY_T
  
 /** CIMConstClass - ATTN: define this.  
  
   /**
       The CIMConstClass class provides a const interface to a CIMClass
       object.  This class is needed because the shared representation model
       used by CIMClass does not prevent modification to a const CIMClass
       object.  Note that the value of a CIMConstClass object could still be
       modified by a CIMClass object that refers to the same data copy.
 */ */
 class PEGASUS_COMMON_LINKAGE CIMConstClass class PEGASUS_COMMON_LINKAGE CIMConstClass
 { {
 public: public:
  
     CIMConstClass() : _rep(0)      /**
     {          Constructs an uninitialized CIMConstClass object.  A method
     }          invocation on an uninitialized object will result in the throwing
           of an UninitializedObjectException.  An uninitialized object may
     CIMConstClass(const CIMConstClass& x)          be converted into an initialized object only by using the assignment
     {          operator with an initialized object.
         Inc(_rep = x._rep);      */
     }      CIMConstClass();
   
     CIMConstClass(const CIMClass& x)      /**
     {          Constructs a CIMConstClass object from the value of a specified
         Inc(_rep = x._rep);          CIMConstClass object, so that both objects refer to the same data copy.
     }          @param x The CIMConstClass object from which to construct a new
               CIMConstClass object.
       */
       CIMConstClass(const CIMConstClass& x);
   
       /**
           Constructs a CIMConstClass 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 a new
               CIMConstClass object.
       */
       CIMConstClass(const CIMClass& x);
   
       /**
           Constructs a CIMConstClass 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 the
               CIMConstClass object.
           @exception DynamicCastFailedException If a CIMConstClass can not be
               created from the given CIMObject.
       */
     PEGASUS_EXPLICIT CIMConstClass(const CIMObject& x);     PEGASUS_EXPLICIT CIMConstClass(const CIMObject& x);
  
       /**
           Constructs a CIMConstClass 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 the
               CIMConstClass object.
           @exception DynamicCastFailedException If a CIMConstClass can not be
               created from the given CIMConstObject.
       */
     PEGASUS_EXPLICIT CIMConstClass(const CIMConstObject& x);     PEGASUS_EXPLICIT CIMConstClass(const CIMConstObject& x);
  
     PEGASUS_EXPLICIT CIMConstClass(const CIMObject& x, NoThrow&);      /**
           Constructs a CIMConstClass object with the specified attributes.
     PEGASUS_EXPLICIT CIMConstClass(const CIMConstObject& x, NoThrow&);          @param className A CIMName specifying the name of the class.
           @param superClassName A CIMName specifying name of the parent class.
     CIMConstClass& operator=(const CIMConstClass& x)              (A null value indicates no superclass.)
     {      */
         if (x._rep != _rep)  
         {  
             Dec(_rep);  
             Inc(_rep = x._rep);  
         }  
         return *this;  
     }  
   
     CIMConstClass& operator=(const CIMClass& x)  
     {  
         if (x._rep != _rep)  
         {  
             Dec(_rep);  
             Inc(_rep = x._rep);  
         }  
         return *this;  
     }  
   
     // Throws IllegalName if className argument not legal CIM identifier.  
   
     CIMConstClass(     CIMConstClass(
         const CIMReference& reference,          const CIMName& className,
         const String& superClassName = String())          const CIMName& superClassName = CIMName());
     {  
         _rep = new CIMClassRep(reference, superClassName);  
     }  
  
     ~CIMConstClass()      /**
     {          Assigns the value of the specified CIMConstClass object to this
         Dec(_rep);          object, so that both objects refer to the same data copy.
     }          @param x The CIMConstClass object from which to assign this
               CIMConstClass object.
     Boolean isAssociation() const          @return A reference to this CIMConstClass object.
     {      */
         _checkRep();      CIMConstClass& operator=(const CIMConstClass& x);
         return _rep->isAssociation();  
     }      /**
           Assigns the value of the specified CIMClass object to this
     Boolean isAbstract() const          object, so that both objects refer to the same data copy.
     {          @param x The CIMClass object from which to assign this
         _checkRep();              CIMConstClass object.
         return _rep->isAbstract();          @return A reference to this CIMConstClass object.
     }      */
       CIMConstClass& operator=(const CIMClass& x);
     const String& getClassName() const  
     {      /**
         _checkRep();          Destructs the CIMConstClass object.
         return _rep->getClassName();      */
     }      ~CIMConstClass();
   
     const CIMReference& getPath() const      /**
     {          Indicates whether this class is an association class.  An
         _checkRep();          association is a relationship between two (or more) classes or
         return _rep->getPath();          instances.  The Association qualifier is used to make this
     }          determination.
           @return True if this class is an association class, false otherwise.
     const String& getSuperClassName() const          @exception UninitializedObjectException If the object is not
     {              initialized.
         _checkRep();      */
         return _rep->getSuperClassName();      Boolean isAssociation() const;
     }  
       /**
     Uint32 findQualifier(const String& name) const          Indicates whether this class is an abstract class.
     {          The Abstract qualifier is used to make this determination.
         _checkRep();          @return True if this class is an abstract class, false otherwise.
         return _rep->findQualifier(name);          @exception UninitializedObjectException If the object is not
     }              initialized.
       */
     CIMConstQualifier getQualifier(Uint32 pos) const      Boolean isAbstract() const;
     {  
         _checkRep();      /**
         return _rep->getQualifier(pos);          Gets the name of the class.
     }          @return A CIMName containing the class name.
           @exception UninitializedObjectException If the object is not
     Uint32 getQualifierCount() const              initialized.
     {      */
         _checkRep();      const CIMName& getClassName() const;
         return _rep->getQualifierCount();  
     }      /**
           Gets the object path for the class.
     Uint32 findProperty(const String& name) const          @return A CIMObjectPath containing the object path.
     {          @exception UninitializedObjectException If the object is not
         _checkRep();              initialized.
         return _rep->findProperty(name);      */
     }      const CIMObjectPath& getPath() const;
   
     CIMConstProperty getProperty(Uint32 pos) const      /**
     {          Gets the name of the parent class of this class.
         _checkRep();          @return A CIMName containing parent class name.
         return _rep->getProperty(pos);          @exception UninitializedObjectException If the object is not
     }              initialized.
       */
     Uint32 getPropertyCount() const      const CIMName& getSuperClassName() const;
     {  
         _checkRep();      /**
         return _rep->getPropertyCount();          Finds a qualifier by name.
     }          @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.
     Uint32 findMethod(const String& name) const          @exception UninitializedObjectException If the object is not
     {              initialized.
         _checkRep();      */
         return _rep->findMethod(name);      Uint32 findQualifier(const CIMName& name) const;
     }  
       /**
     CIMConstMethod getMethod(Uint32 pos) const          Gets the qualifier at the specified index.
     {          @param index The index of the qualifier to be retrieved.
         _checkRep();          @return The CIMConstQualifier at the specified index.
         return _rep->getMethod(pos);          @exception IndexOutOfBoundsException If the index is outside
     }              the range of qualifiers available for the CIMConstClass.
           @exception UninitializedObjectException If the object is not
     Uint32 getMethodCount() const              initialized.
     {      */
         _checkRep();      CIMConstQualifier getQualifier(Uint32 index) const;
         return _rep->getMethodCount();  
     }      /**
           Gets the number of qualifiers in the class.
     operator int() const { return _rep != 0; }          @return An integer count of the qualifiers in the CIMConstClass.
           @exception UninitializedObjectException If the object is not
     void toXml(Array<Sint8>& out) const              initialized.
     {      */
         _checkRep();      Uint32 getQualifierCount() const;
         _rep->toXml(out);  
     }      /**
           Finds a property by name.
     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const          @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.
         _checkRep();          @exception UninitializedObjectException If the object is not
         _rep->print(o);              initialized.
     }      */
       Uint32 findProperty(const CIMName& name) const;
     Boolean identical(const CIMConstClass& x) const  
     {      /**
         x._checkRep();          Gets the property at the specified index.
         _checkRep();          @param index The index of the property to be retrieved.
         return _rep->identical(x._rep);          @return The CIMConstProperty at the specified index.
     }          @exception IndexOutOfBoundsException If the index is outside
               the range of properties available for the CIMConstClass.
     CIMClass clone() const          @exception UninitializedObjectException If the object is not
     {              initialized.
         return CIMClass((CIMClassRep*)(_rep->clone()));      */
     }      CIMConstProperty getProperty(Uint32 index) const;
   
     void getKeyNames(Array<String>& keyNames) const      /**
     {          Gets the number of properties in the class.
         _checkRep();          @return An integer count of the properties in the CIMConstClass.
         _rep->getKeyNames(keyNames);          @exception UninitializedObjectException If the object is not
     }              initialized.
       */
       Uint32 getPropertyCount() const;
   
       /**
           Finds a method by name.
           @param name A CIMName specifying the name of the method to be found.
           @return Index of the method if found or PEG_NOT_FOUND if not found.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Uint32 findMethod(const CIMName& name) const;
   
       /**
           Gets the method at the specified index.
           @param index The index of the method to be retrieved.
           @return The CIMConstMethod at the specified index.
           @exception IndexOutOfBoundsException If the index is outside
               the range of methods available for the CIMConstClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMConstMethod getMethod(Uint32 index) const;
   
       /**
           Gets the number of methods in the class.
           @return An integer count of the methods in the CIMConstClass.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Uint32 getMethodCount() const;
   
       /**
           Gets the list of key properties in this class.  The Key qualifier
           on CIMConstProperty objects is used to locate key properties.
           @return An Array of CIMName objects containing the names of the key
           properties.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       void getKeyNames(Array<CIMName>& keyNames) const;
   
       /**
           Indicates whether this class contains key properties.  The Key
           qualifier on CIMConstProperty objects is used to make this
           determination.
           @return True if this class contains key properties, false otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Boolean hasKeys() const;
   
       /**
           Makes a deep copy of the class.  This creates a new copy of all
           the class attributes including qualifiers, properties, and methods.
           @return A CIMClass object with a separate copy of the
               CIMConstClass object.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       CIMClass clone() const;
   
       /**
           Compares the CIMConstClass with a specified CIMConstClass.
           @param x The CIMConstClass to be compared.
           @return True if this class is identical to the one specified,
               false otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Boolean identical(const CIMConstClass& x) const;
  
     Boolean hasKeys() const      /**
     {          Determines whether the object has been initialized.
         _checkRep();          @return True if the object has not been initialized, false otherwise.
         return _rep->hasKeys();      */
     }      Boolean isUninitialized() const;
  
 private: private:
  
     void _checkRep() const  
     {  
         if (!_rep)  
             ThrowUnitializedHandle();  
     }  
   
     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 CIMObject;
     friend class CIMConstObject;     friend class CIMConstObject;
       friend class XmlWriter;
       friend class MofWriter;
       friend class BinaryStreamer;
 }; };
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.30  
changed lines
  Added in v.1.73

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2