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

Diff for /pegasus/src/Pegasus/Common/CIMParameter.h between version 1.38.10.1 and 1.38.10.2

version 1.38.10.1, 2006/02/10 16:09:34 version 1.38.10.2, 2006/03/07 18:45:46
Line 52 
Line 52 
 class CIMConstParameter; class CIMConstParameter;
 class CIMParameterRep; class CIMParameterRep;
  
 /** This class provides the interface to construct and manage CIM Parameters.  /**
     CIM Parameters are the parameters attached to CIMMethods.      The CIMParameter class represents the DMTF standard CIM parameter
       definition.  A CIMParameter is generally defined in the context of
       a CIMMethod.
     A CIM Parameter consists of:     A CIM Parameter consists of:
     <UL>      <ul>
     <LI> <B>qualifiers</B> - zero or more qualifiers.          <li>A CIMName containing the name of the parameter
     <LI> <B>name</B> - The name of the parameter which must be a valid CIM name.          <li>A CIMType defining the parameter type
     <LI> <B>type</B> - The type for the parameter, one of the inherent CIM types          <li>A Boolean indicating whether it is an Array parameter
     <LI> <B>value</B> - Which is dependent on the type. The value can be          <li>A Uint32 indicating the size of the Array, if the parameter is an
         <UL>              Array parameter
         <LI> a reference type. In this class the value is a Class reference. This must be          <li>A CIMName containing the reference class name for this parameter,
         a single value              if the parameter is of reference type
         <LI> an array (fixed or variable number of elements) or a single value          <li>Zero or more CIMQualifier objects
         with any CIMType other than reference.  The input parameters allow specifying      </ul>
         these conditions.  
         </UL>      <p>The CIMParameter class uses a shared representation model, such that
     </UL>      multiple CIMParameter objects may refer to the same data copy.  Assignment
       and copy operators create new references to the same data, not distinct
     ATTN: Define the form of this objec, the rep and what it means.      copies.  An update to a CIMParameter object affects all the CIMParameter
       objects that refer to the same data copy.  The data remains valid until
       all the CIMParameter objects that refer to it are destructed.  A separate
       copy of the data may be created using the clone method.
 */ */
 class PEGASUS_COMMON_LINKAGE CIMParameter class PEGASUS_COMMON_LINKAGE CIMParameter
 { {
 public: public:
  
     /// Construct a NULL CIMParameter object.      /**
           Constructs an uninitialized CIMParameter object.  A method
           invocation on an uninitialized object will result in the throwing
           of an UninitializedObjectException.  An uninitialized object may
           be converted into an initialized object only by using the assignment
           operator with an initialized object.
       */
     CIMParameter();     CIMParameter();
  
     /** Construct a CIMParameter from another CIMParameter      /**
         @param CIMParameter from which the new object is to be constructed          Constructs a CIMParameter object from the value of a specified
           CIMParameter object, so that both objects refer to the same data copy.
           @param x The CIMParameter object from which to construct a new
               CIMParameter object.
     */     */
     CIMParameter(const CIMParameter& x);     CIMParameter(const CIMParameter& x);
  
     /** Constructs a CIMParameter object with properties. The Properties      /**
         Must include name and type and may include the indicator whether          Constructs a CIMParameter object with the specified attributes.
         this is an array or not, the size of the array and a reference          @param name A CIMName specifying the name of the parameter.
         class name.          @param type A CIMType defining the parameter type.
         @param name Name of the parameter, a legal CIMName.          @param isArray A Boolean indicating whether it is an Array parameter.
         @param type CIMType defining the CIM Type for this parameter          @param arraySize A Uint32 indicating the size of the Array, if the
         @param isArray Boolean indicating whether this parameter defines an              parameter is an Array parameter.  The default value of zero
         array.              indicates a variable size array.
         @param arraySize Size of the array if this is to be a fixed size          @param referenceClassName A CIMName containing the reference class
         array parameter. The default is zero which indicates a variable size array.              name for this parameter, if the parameter is of reference type.
         @param referenceClassName Optional property but required for reference          @exception TypeMismatchException If the parameter is of reference
         type parameters.  This defines the class for the reference.              type and referenceClassName is null or if the parameter is not of
         @exception TypeMismatchException Thrown if reference type and referenceClassname              reference type and referenceClassName is not null.
         is Null.          @exception TypeMismatchException If isArray is true and arraySize is
         @exception TypeMismatchException Thrown if arraysize != zero and isArray true.              not zero.
           @exception UninitializedObjectException If the parameter name is null.
     */     */
     CIMParameter(     CIMParameter(
         const CIMName& name,         const CIMName& name,
Line 106 
Line 121 
         Uint32 arraySize = 0,         Uint32 arraySize = 0,
         const CIMName& referenceClassName = CIMName());         const CIMName& referenceClassName = CIMName());
  
     /** Destroys the object.      /**
           Destructs the CIMParameter object.
     */     */
     ~CIMParameter();     ~CIMParameter();
  
     /** Assignment operator. Assigns one CIMParameter to      /**
         another CIMParameter          Assigns the value of the specified CIMParameter object to this object,
           so that both objects refer to the same data copy.
           @param x The CIMParameter object from which to assign this
               CIMParameter object.
           @return A reference to this CIMParameter object.
     */     */
     CIMParameter& operator=(const CIMParameter& x);     CIMParameter& operator=(const CIMParameter& x);
  
     /** Get the name from the CIMParameter object.      /**
         @return CIMName containing the name from the object.          Gets the parameter name.
           @return A CIMName containing the name of the parameter.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     const CIMName& getName() const;     const CIMName& getName() const;
  
     /** Set the name field in the object with a valid CIMName      /**
         @param name CIMName to set into the name field.          Sets the parameter name.
           @param name A CIMName indicating the new name for the parameter.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     void setName(const CIMName& name);     void setName(const CIMName& name);
  
     /** Test for Array type for this parameter object.      /**
         @return true if the value for this parameter is defined          Checks whether the parameter is an Array parameter.
         as an array (is array = true).          @return True if the parameter is an Array parameter, false otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     Boolean isArray() const;     Boolean isArray() const;
  
     /** Get the array size for the parameter.      /**
           Gets the array size for the parameter.
         @return Uint32 array size.         @return Uint32 array size.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     Uint32 getArraySize() const;     Uint32 getArraySize() const;
  
     ///      /**
           Gets the reference class name for the parameter.
           @return A CIMName containing the reference class name for the
               parameter if the parameter is of reference type, a null CIMName
               otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     const CIMName& getReferenceClassName() const;     const CIMName& getReferenceClassName() const;
  
     /** Get the type (CIMTYPE) defined for this parameter.      /**
         If the parameter is not initialized the type returned is          Gets the parameter type.
         TBD.          @return A CIMType indicating the type of this parameter.
         @return the type for this parameter defined as a CIMTYPE          @exception UninitializedObjectException If the object is not
         object.              initialized.
     */     */
     CIMType getType() const ;     CIMType getType() const ;
  
     /** Add a single qualifier object to the CIMParameter.      /**
         @param x CIMQualifier object to be added.          Adds a qualifier to the parameter.
         @exception AlreadyExistsException if a qualifier with the          @param x The CIMQualifier to be added.
         same name already exists for this CIMParameter.          @return A reference to this CIMParameter object.
           @exception AlreadyExistsException If a qualifier with the
               same name already exists in the CIMParameter.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     CIMParameter& addQualifier(const CIMQualifier& x);     CIMParameter& addQualifier(const CIMQualifier& x);
  
     /** Find a qualifier by name.  Finds a single qualifier      /**
         based on the name input as parameter and returns an          Finds a qualifier by name.
         index to the name.          @param name A CIMName specifying the name of the qualifier to be found.
         @param name CIMName with the name of the qualifier to be found          @return Index of the qualifier if found or PEG_NOT_FOUND if not found.
         @return Uint32 with either the index (zero origin) of          @exception UninitializedObjectException If the object is not
         the parameter that was to be found or the value              initialized.
         PEG_NOT_FOUND if no parameter is found with the  
         defined name.  
     */     */
     Uint32 findQualifier(const CIMName& name) const;     Uint32 findQualifier(const CIMName& name) const;
  
     /** Get qualifier at index defined by input.  Gets the      /**
         qualifier in the array of qualifiers for this parameter          Gets the qualifier at the specified index.
         defined by the index provided on input.          @param index The index of the qualifier to be retrieved.
         @param index Specifies the position in the qualifier array          @return The CIMQualifier at the specified index.
         of the qualifier to be retrieved          @exception IndexOutOfBoundsException If the index is outside
         @return CIMQualifier object containing the qualifer defined              the range of qualifiers available for the CIMParameter.
         by the index          @exception UninitializedObjectException If the object is not
         @exception IndexOutOfBoundsException thrown if index outside              initialized.
         the array of qualifiers.  
     */     */
     CIMQualifier getQualifier(Uint32 index);     CIMQualifier getQualifier(Uint32 index);
  
     /** Removes the CIMQualifier defined by the input parameter.      /**
           Removes a qualifier from the parameter.
         @param index Index of the qualifier to be removed.         @param index Index of the qualifier to be removed.
         @exception IndexOutOfBoundsException if the index is outside          @exception IndexOutOfBoundsException If the index is outside
         the range of qualifiers available for the CIMParameter.         the range of qualifiers available for the CIMParameter.
         @exception IndexOutOfBoundsException thrown if index outside          @exception UninitializedObjectException If the object is not
         the array of qualifiers.              initialized.
     */     */
     void removeQualifier (Uint32 index);     void removeQualifier (Uint32 index);
  
     /** Get qualifier at index defined by input.  Gets the      /**
         qualifier in the array of qualifiers for this parameter          Gets the qualifier at the specified index.
         defined by the index provided on input.          @param index The index of the qualifier to be retrieved.
         @param index Specifies the position in the qualifier array          @return The CIMConstQualifier at the specified index.
         of the qualifier to be retrieved          @exception IndexOutOfBoundsException If the index is outside
         @return CIMQualifier object containing the qualifer defined              the range of qualifiers available for the CIMParameter.
         by the index          @exception UninitializedObjectException If the object is not
         @exception IndexOutOfBoundsException thrown if index outside              initialized.
         the array of qualifiers.  
     */     */
     CIMConstQualifier getQualifier(Uint32 index) const;     CIMConstQualifier getQualifier(Uint32 index) const;
  
     /** Gets the count of qualifiers attached to this CIMParameter.      /**
         @return count of number of qualifiers that have been added          Gets the number of qualifiers in the parameter.
         to this CIMparameter.  
         <pre>         <pre>
              // loop to access all qualifiers in a CIMparameter              // loop to access all qualifiers in a CIMparameter
              CIMParameter parm;              CIMParameter parm;
              ....               // build the parameter              ....               // build the parameter
             for (Uint32 i = 0 ; i < parm.getQualifierCount() ; i++               for (Uint32 i = 0 ; i < parm.getQualifierCount() ; i++)
                 ....                 ....
         </pre>         </pre>
           @return An integer count of the CIMQualifiers in the CIMParameter.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     Uint32 getQualifierCount() const;     Uint32 getQualifierCount() const;
  
     /** Determines if the object has not been initialized. A CIM parameter      /**
         is intialized only when the name and type fields have been set either          Determines whether the object has been initialized.
         on construction or through the set functions.          @return True if the object has not been initialized, false otherwise.
         @return  true if the object has not been initialized,  
                  false otherwise.  
      */      */
     Boolean isUninitialized() const;     Boolean isUninitialized() const;
  
     ///      /**
           Compares the parameter with another parameter.
           @param x The CIMConstParameter to be compared.
           @return True if this parameter is identical to the one specified,
               false otherwise.
           @exception UninitializedObjectException If either of the objects
               is not initialized.
       */
     Boolean identical(const CIMConstParameter& x) const;     Boolean identical(const CIMConstParameter& x) const;
  
     /** Creates a deep copy, i.e. a clone, of the associated object.      /**
         @return The deep copy of the associated object.          Makes a deep copy of the parameter.  This creates a new copy
           of all the parameter attributes including qualifiers.
           @return A new copy of the CIMParameter object.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     CIMParameter clone() const;     CIMParameter clone() const;
  
Line 242 
Line 292 
     friend class BinaryStreamer;     friend class BinaryStreamer;
 }; };
  
   
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 // //
 // CIMConstParameter // CIMConstParameter
 // //
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
  
 ///  /**
       The CIMConstParameter class provides a const interface to a CIMParameter
       object.  This class is needed because the shared representation model
       used by CIMParameter does not prevent modification to a const CIMParameter
       object.  Note that the value of a CIMConstParameter object could still be
       modified by a CIMParameter object that refers to the same data copy.
   */
 class PEGASUS_COMMON_LINKAGE CIMConstParameter class PEGASUS_COMMON_LINKAGE CIMConstParameter
 { {
 public: public:
  
     ///      /**
           Constructs an uninitialized CIMConstParameter object.  A method
           invocation on an uninitialized object will result in the throwing
           of an UninitializedObjectException.  An uninitialized object may
           be converted into an initialized object only by using the assignment
           operator with an initialized object.
       */
     CIMConstParameter();     CIMConstParameter();
  
     ///      /**
           Constructs a CIMConstParameter object from the value of a specified
           CIMConstParameter object, so that both objects refer to the same data
           copy.
           @param x The CIMConstParameter object from which to construct a new
               CIMConstParameter object.
       */
     CIMConstParameter(const CIMConstParameter& x);     CIMConstParameter(const CIMConstParameter& x);
  
     ///      /**
           Constructs a CIMConstParameter object from the value of a specified
           CIMParameter object, so that both objects refer to the same data
           copy.
           @param x The CIMParameter object from which to construct a new
               CIMConstParameter object.
       */
     CIMConstParameter(const CIMParameter& x);     CIMConstParameter(const CIMParameter& x);
  
     ///      /**
           Constructs a CIMConstParameter object with the specified attributes.
           @param name A CIMName specifying the name of the parameter.
           @param type A CIMType defining the parameter type.
           @param isArray A Boolean indicating whether it is an Array parameter.
           @param arraySize A Uint32 indicating the size of the Array, if the
               parameter is an Array parameter.  The default value of zero
               indicates a variable size array.
           @param referenceClassName A CIMName containing the reference class
               name for this parameter, if the parameter is of reference type.
           @exception TypeMismatchException If the parameter is of reference
               type and referenceClassName is null.
           @exception TypeMismatchException If isArray is true and arraySize is
               not zero.
       */
     CIMConstParameter(     CIMConstParameter(
         const CIMName& name,         const CIMName& name,
         CIMType type,         CIMType type,
Line 270 
Line 359 
         Uint32 arraySize = 0,         Uint32 arraySize = 0,
         const CIMName& referenceClassName = CIMName());         const CIMName& referenceClassName = CIMName());
  
     ///      /**
           Destructs the CIMConstParameter object.
       */
     ~CIMConstParameter();     ~CIMConstParameter();
  
     ///      /**
           Assigns the value of the specified CIMConstParameter object to this
           object, so that both objects refer to the same data copy.
           @param x The CIMConstParameter object from which to assign this
               CIMConstParameter object.
           @return A reference to this CIMConstParameter object.
       */
     CIMConstParameter& operator=(const CIMConstParameter& x);     CIMConstParameter& operator=(const CIMConstParameter& x);
  
     ///      /**
           Assigns the value of the specified CIMParameter object to this
           object, so that both objects refer to the same data copy.
           @param x The CIMParameter object from which to assign this
               CIMConstParameter object.
           @return A reference to this CIMConstParameter object.
       */
     CIMConstParameter& operator=(const CIMParameter& x);     CIMConstParameter& operator=(const CIMParameter& x);
  
     ///      /**
           Gets the parameter name.
           @return A CIMName containing the name of the parameter.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     const CIMName& getName() const;     const CIMName& getName() const;
  
     ///      /**
           Checks whether the parameter is an Array parameter.
           @return True if the parameter is an Array parameter, false otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     Boolean isArray() const;     Boolean isArray() const;
  
     ///      /**
           Gets the array size for the parameter.
           @return Uint32 array size.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     Uint32 getArraySize() const;     Uint32 getArraySize() const;
  
     ///      /**
           Gets the reference class name for the parameter.
           @return A CIMName containing the reference class name for the
               parameter if the parameter is of reference type, a null CIMName
               otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     const CIMName& getReferenceClassName() const;     const CIMName& getReferenceClassName() const;
  
     ///      /**
           Gets the parameter type.
           @return A CIMType indicating the type of this parameter.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     CIMType getType() const;     CIMType getType() const;
  
     ///      /**
           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;     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 CIMConstQualifier at the specified index.
           @exception IndexOutOfBoundsException If the index is outside
               the range of qualifiers available for the CIMParameter.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     CIMConstQualifier getQualifier(Uint32 index) const;     CIMConstQualifier getQualifier(Uint32 index) const;
  
     ///      /**
           Gets the number of qualifiers in the parameter.
           @return An integer count of the qualifiers in the CIMParameter.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     Uint32 getQualifierCount() const;     Uint32 getQualifierCount() const;
  
     ///      /**
           Determines whether the object has been initialized.
           @return True if the object has not been initialized, false otherwise.
       */
     Boolean isUninitialized() const;     Boolean isUninitialized() const;
  
     ///      /**
           Compares the parameter with another parameter.
           @param x The CIMConstParameter to be compared.
           @return True if this parameter is identical to the one specified,
               false otherwise.
           @exception UninitializedObjectException If either of the objects
               is not initialized.
       */
     Boolean identical(const CIMConstParameter& x) const;     Boolean identical(const CIMConstParameter& x) const;
  
     ///      /**
           Makes a deep copy of the parameter.  This creates a new copy
           of all the parameter attributes including qualifiers.
           @return A CIMParameter object with a separate copy of the
               CIMConstParameter object.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     CIMParameter clone() const;     CIMParameter clone() const;
  
 private: private:


Legend:
Removed from v.1.38.10.1  
changed lines
  Added in v.1.38.10.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2