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

Diff for /pegasus/src/Pegasus/Common/CIMQualifier.h between version 1.29 and 1.54

version 1.29, 2002/07/17 12:07:56 version 1.54, 2008/06/17 18:18:17
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // The Open Group, Tivoli Systems  // 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 21 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By: Karl Schopmeyer (k.schopmeyer@opengroup.org)  
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 /*  
  CIMQualifier.h - Defines the CIM qualifiers class.  
   
 */  
   
 #ifndef Pegasus_Qualifier_h #ifndef Pegasus_Qualifier_h
 #define Pegasus_Qualifier_h #define Pegasus_Qualifier_h
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
   #include <Pegasus/Common/Linkage.h>
   #include <Pegasus/Common/CIMName.h>
 #include <Pegasus/Common/CIMFlavor.h> #include <Pegasus/Common/CIMFlavor.h>
 #include <Pegasus/Common/CIMType.h> #include <Pegasus/Common/CIMType.h>
 #include <Pegasus/Common/CIMValue.h> #include <Pegasus/Common/CIMValue.h>
Line 51 
Line 51 
  
 class CIMConstQualifier; class CIMConstQualifier;
 class CIMClassRep; class CIMClassRep;
 #if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)  class Resolver;
 class CIMQualifierRep; class CIMQualifierRep;
 #endif  
  
 /** Class CIMQualifier - This class defines the Pegasus implementation of the  /**
     CIM Qualifier \Ref{QUALIFIER}.  It is almost identical to      A CIMQualifier represents a DMTF standard CIM qualifier.
     CIMQualifierDecl except that it has no scope member. \Ref{CIMQualifierDecl}      A CIMQualifier differs from a CIMQualifierDecl in that it has no scope
     This includes functions to create qualifiers and manipulate/test      attribute.
     the individual components of the CIMQualifier.  
     CIMQualifiers are accumulated into lists for use in CIMClasses and CIM      <p>The CIMQualifier class uses a shared representation model, such that
     Properties using the CIMQualifierList Class and its      multiple CIMQualifier objects may refer to the same data copy.  Assignment
     functions. \Ref{CIMQualifierList}      and copy operators create new references to the same data, not distinct
       copies.  An update to a CIMQualifier object affects all the CIMQualifier
       objects that refer to the same data copy.  The data remains valid until
       all the CIMQualifier objects that refer to it are destructed.  A separate
       copy of the data may be created using the clone method.
 */ */
 class PEGASUS_COMMON_LINKAGE CIMQualifier class PEGASUS_COMMON_LINKAGE CIMQualifier
 { {
 public: public:
  
     /** Constructor instantiates a CIM qualifier with empty name value      /**
         fields.Constructor          Constructs an uninitialized CIMQualifier object.  A method
         @return instantiated empty qualifier object          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.
     */     */
     CIMQualifier();     CIMQualifier();
  
     /** Constructor - instantiates a CIM qualifier object from another      /**
         qualifier object.          Constructs a CIMQualifier object from the value of a specified
         @param CIM CIMQualifier object          CIMQualifier object, so that both objects refer to the same data copy.
         @return - Instantiated qualifier object          @param x The CIMQualifier object from which to construct a new
               CIMQualifier object.
     */     */
     CIMQualifier(const CIMQualifier& x);     CIMQualifier(const CIMQualifier& x);
  
     /** Constructor - Instantiates a CIM qualifier object with the parameters      /**
         defined on input.          Constructs a CIMQualifier object with the specified attributes.
         @param String representing CIMName for the new qualifier          @param name A CIMName specifying the name of the qualifier.
         @param value          @param value A CIMValue specifying the qualifier value, and implicitly
         @param flavor - Flavor defined for this qualifier definition. Default              defining the qualifier type and whether the qualifier is an Array
         for this parameter is CIMFlavor::NONE.              qualifier.
         @param propoagated - Boolean defining whether this is a propagated          @param flavor A CIMFlavor indicating the qualifier flavors.
         qualifier.  This is an optional parameter with default = false          @param propagated A Boolean indicating whether the qualifier is local
         @return -Returns the instantiated qualifier object or throws an              to the context in which it appears or was propagated
         exception if the name argument is illegal              (without modification) from other schema.
           @exception UninitializedObjectException If the qualifier name is null.
         @exception Throws IllegalName if name argument not legal CIM  
         identifier.  
     */     */
     CIMQualifier(     CIMQualifier(
         const String& name,          const CIMName& name,
         const CIMValue& value,         const CIMValue& value,
         Uint32 flavor = CIMFlavor::NONE,          const CIMFlavor & flavor = CIMFlavor (CIMFlavor::NONE),
         Boolean propagated = false);         Boolean propagated = false);
  
     /// destructor      /**
     ~CIMQualifier();          Destructs the CIMQualifier object.
   
     /// operator  
     CIMQualifier& operator=(const CIMQualifier& x);  
   
     /** getName - Returns the name field from the qualifier  
         @return String containing the qualifier name.  
     */     */
     const String& getName() const;      ~CIMQualifier();
  
     /** setName - Sets the qualifier name field in the qualifier object.      /**
         @param name - String containing the name for the qualifier          Assigns the value of the specified CIMQualifier object to this
         @exception Throws IllegalName if name argument not legal CIM identifier.          object, so that both objects refer to the same data copy.
           @param x The CIMQualifier object from which to assign this
               CIMQualifier object.
           @return A reference to this CIMQualifier object.
     */     */
     void setName(const String& name);      CIMQualifier& operator=(const CIMQualifier& x);
  
     /** getType - Gets the type field from the qualifier object.      /**
         @return CIMType containing the type for this qualifier /Ref{CIMType}.          Gets the name of the qualifier.
           @return A CIMName containing the name of the qualifier.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       const CIMName& getName() const;
   
       /**
           Sets the qualifier name.
           @param name A CIMName containing the new name of the qualifier.
           @exception UninitializedObjectException If the object is not
               initialized.
           @exception Exception If the object is already contained by CIMClass,
               CIMInstance, CIMObject, CIMProperty, CIMParameter or CIMMethod
       */
       void setName(const CIMName& name);
   
       /**
           Gets the qualifier type.
           @return A CIMType containing the qualifier type.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     CIMType getType() const;     CIMType getType() const;
  
     /** isArray - Returns true if the qualifier is an array      /**
         @return Boolean true if array qualifier.          Checks whether the qualifier is an Array qualifier.
           @return True if the qualifier is an Array qualifier, false otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     Boolean isArray() const;     Boolean isArray() const;
  
     /** getValue - Gets the value component of the qualifier object      /**
         @return CIMValue containing the value component          Gets the qualifier value.
           @return A CIMValue containing the qualifier value.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     const CIMValue& getValue() const;     const CIMValue& getValue() const;
  
     /** setValue - Puts a CIMValue object into a CIMQualifier object      /**
         @param value - The CIMValue object to install          Sets the qualifier value.
           @param value A CIMValue containing the new value of the qualifier.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     void setValue(const CIMValue& value);     void setValue(const CIMValue& value);
  
     /** setFlavor - Sets the bits defined on input into the Flavor variable      /**
         for the Qualifier Object.          Adds flavors to the qualifier.
         @param flavor - Uint32 defines the flavor bits to be set.          @param flavor A CIMFlavor indicating the flavors to add.
     */          @exception UninitializedObjectException If the object is not
     void setFlavor(Uint32 flavor);              initialized.
       */
     /** unsetFlavor - Resets the bits defined for the flavor      void setFlavor(const CIMFlavor & flavor);
         for the Qualifier Object with the input.  
         @param flavor - Uint32 defines the flavor bits to be set.      /**
     */          Removes flavors from the qualifier.
     void unsetFlavor(Uint32 flavor);          @param flavor A CIMFlavor indicating the flavors to remove.
           @exception UninitializedObjectException If the object is not
     /** getFlavor - Gets the Flavor field from a Qualifier              initialized.
         @return - Uint32 with the Flavor flags that can be tested      */
         against the CIMFlavor constants.      void unsetFlavor(const CIMFlavor & flavor);
     */  
     Uint32 getFlavor() const;      /**
           Gets the qualifier flavors.
     /** isFlavor - Boolean function that determines if particular flavor          @return A CIMFlavor containing the qualifier flavor settings.
         flags are set in the flavor variable of a qualifier.          @exception UninitializedObjectException If the object is not
         @param flavor - The flavor bits to test.              initialized.
         Return True if the defined flavor is set.      */
         <pre>      const CIMFlavor & getFlavor() const;
         if (q.isFlavor(CIMType::TOSUBCLASS)  
                 do something based on TOSUBCLASS being true      /**
         </pre>          Tests the propagated attribute of the qualifier.  The propagated
     */          attribute indicates whether this qualifier was propagated from a
     Boolean isFlavor(Uint32 flavor) const;          higher-level class.  Normally this attribute is set as part of
           defining a qualifier in the context of a schema.  It is set in
     /** resolveFlavor - Function used only in object creation to          qualifiers retrieved from a CIM Server.
         resolve the combination of a qualifer flavor input and          (Note: Although this method is intended to return a Boolean value,
         the corresponding inherited flavor from declaration or          changing the return type would break interface compatibility.)
         superclass and set the current qualifier to that          @return Non-zero if qualifier is propagated, otherwise zero.
         definition.  The functions changes the current flavor based          @exception UninitializedObjectException If the object is not
         on the characteristics of the inheritance.              initialized.
         @param inheritedFlavor - The flavor inherited from higher level      */
         @param inherited - True if inherited from definition. False if this      Uint32 getPropagated() const;
         is definition that inherits from the declaration  
     */      /**
     void resolveFlavor(Uint32 inheritedFlavor, Boolean inherited);          Sets the propagated attribute.  Normally this is used by a CIM Server
           when defining a qualifier in the context of a schema.
     /** getPropagated returns the propagated indicator          @param propagated A Boolean indicating whether the qualifier is
         @return Uint32 - TBD              propagated.
     */          @exception UninitializedObjectException If the object is not
     const Uint32 getPropagated() const;              initialized.
   
     /** setPropagated - Sets the Propagated flag for the object.  
     */     */
     void setPropagated(Boolean propagated);     void setPropagated(Boolean propagated);
  
 #ifdef PEGASUS_INTERNALONLY      /**
     /** CIMMethod          Determines whether the object has been initialized.
     */          @return True if the object has not been initialized, false otherwise.
     Boolean isNull() const;      */
 #endif      Boolean isUninitialized() const;
   
     /** identical - compares two CIMQualifier objects.      /**
         @return - True if the objects are identical.          Compares the qualifier with another qualifier.
           @param x The CIMConstQualifier to be compared.
           @return True if this qualifier is identical to the one specified,
               false otherwise.
           @exception UninitializedObjectException If either of the objects
               is not initialized.
     */     */
     Boolean identical(const CIMConstQualifier& x) const;     Boolean identical(const CIMConstQualifier& x) const;
  
     /** clone Creates an exact copy of the qualifier and returns the      /**
         new object.          Makes a deep copy of the qualifier.  This creates a new copy
         @return CIMQualifier New Qualifier object.          of all the qualifier attributes.
           @return A new copy of the CIMQualifier object.
           @exception UninitializedObjectException If the object is not
               initialized.
     */     */
     CIMQualifier clone() const;     CIMQualifier clone() const;
  
Line 209 
Line 247 
  
     CIMQualifier(CIMQualifierRep* rep);     CIMQualifier(CIMQualifierRep* rep);
  
     void _checkRep() const;  
   
     CIMQualifierRep* _rep;     CIMQualifierRep* _rep;
  
     friend class CIMConstQualifier;     friend class CIMConstQualifier;
     friend class CIMClassRep;     friend class CIMClassRep;
       friend class Resolver;
     friend class XmlWriter;     friend class XmlWriter;
     friend class MofWriter;     friend class MofWriter;
       friend class BinaryStreamer;
       friend class CIMQualifierList;
 }; };
  
   
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 // //
 // CIMConstQualifier // CIMConstQualifier
 // //
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
  
   /**
       The CIMConstQualifier class provides a const interface to a CIMQualifier
       object.  This class is needed because the shared representation model
       used by CIMQualifier does not prevent modification to a const CIMQualifier
       object.  Note that the value of a CIMConstQualifier object could still be
       modified by a CIMQualifier object that refers to the same data copy.
   */
 class PEGASUS_COMMON_LINKAGE CIMConstQualifier class PEGASUS_COMMON_LINKAGE CIMConstQualifier
 { {
 public: public:
  
       /**
           Constructs an uninitialized CIMConstQualifier 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.
       */
     CIMConstQualifier();     CIMConstQualifier();
  
       /**
           Constructs a CIMConstQualifier object from the value of a specified
           CIMConstQualifier object, so that both objects refer to the same data
           copy.
           @param x The CIMConstQualifier object from which to construct a new
               CIMConstQualifier object.
       */
     CIMConstQualifier(const CIMConstQualifier& x);     CIMConstQualifier(const CIMConstQualifier& x);
  
       /**
           Constructs a CIMConstQualifier object from the value of a specified
           CIMQualifier object, so that both objects refer to the same data
           copy.
           @param x The CIMQualifier object from which to construct a new
               CIMConstQualifier object.
       */
     CIMConstQualifier(const CIMQualifier& x);     CIMConstQualifier(const CIMQualifier& x);
  
     // Throws IllegalName if name argument not legal CIM identifier.      /**
           Constructs a CIMConstQualifier object with the specified attributes.
           @param name A CIMName specifying the name of the qualifier.
           @param value A CIMValue specifying the qualifier value, and implicitly
               defining the qualifier type and whether the qualifier is an Array
               qualifier.
           @param flavor A CIMFlavor indicating the qualifier flavors.
           @param propagated A Boolean indicating whether the qualifier is local
               to the context in which it appears or was propagated
               (without modification) from other schema.
           @exception UninitializedObjectException If the qualifier name is null.
       */
     CIMConstQualifier(     CIMConstQualifier(
         const String& name,          const CIMName& name,
         const CIMValue& value,         const CIMValue& value,
         Uint32 flavor = CIMFlavor::NONE,          const CIMFlavor & flavor = CIMFlavor (CIMFlavor::NONE),
         Boolean propagated = false);         Boolean propagated = false);
  
       /**
           Destructs the CIMQualifier object.
       */
     ~CIMConstQualifier();     ~CIMConstQualifier();
  
       /**
           Assigns the value of the specified CIMConstQualifier object to this
           object, so that both objects refer to the same data copy.
           @param x The CIMConstQualifier object from which to assign this
               CIMConstQualifier object.
           @return A reference to this CIMConstQualifier object.
       */
     CIMConstQualifier& operator=(const CIMConstQualifier& x);     CIMConstQualifier& operator=(const CIMConstQualifier& x);
  
       /**
           Assigns the value of the specified CIMQualifier object to this
           object, so that both objects refer to the same data copy.
           @param x The CIMQualifier object from which to assign this
               CIMConstQualifier object.
           @return A reference to this CIMConstQualifier object.
       */
     CIMConstQualifier& operator=(const CIMQualifier& x);     CIMConstQualifier& operator=(const CIMQualifier& x);
  
     const String& getName() const;      /**
           Gets the name of the qualifier.
           @return A CIMName containing the name of the qualifier.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       const CIMName& getName() const;
   
       /**
           Gets the qualifier type.
           @return A CIMType containing the qualifier type.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     CIMType getType() const;     CIMType getType() const;
  
       /**
           Checks whether the qualifier is an Array qualifier.
           @return True if the qualifier is an Array qualifier, false otherwise.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     Boolean isArray() const;     Boolean isArray() const;
  
       /**
           Gets the qualifier value.
           @return A CIMValue containing the qualifier value.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     const CIMValue& getValue() const;     const CIMValue& getValue() const;
  
     const Uint32 getFlavor() const;      /**
           Gets the qualifier flavors.
     Boolean isFlavor(Uint32 flavor) const;          @return A CIMFlavor containing the qualifier flavor settings.
           @exception UninitializedObjectException If the object is not
     Boolean isFlavorToSubclass() const;              initialized.
       */
     Boolean isFlavorToInstance() const;      const CIMFlavor & getFlavor() const;
   
     Boolean isFlavorOverridable() const;      /**
           Tests the propagated attribute of the qualifier.  The propagated
     const Uint32 getPropagated() const;          attribute indicates whether this qualifier was propagated from a
           higher-level class.  Normally this attribute is set as part of
 #ifdef PEGASUS_INTERNALONLY          defining a qualifier in the context of a schema.  It is set in
     Boolean isNull() const;          qualifiers retrieved from a CIM Server.
 #endif          (Note: Although this method is intended to return a Boolean value,
           changing the return type would break interface compatibility.)
           @return Non-zero if qualifier is propagated, otherwise zero.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
       Uint32 getPropagated() const;
   
       /**
           Determines whether the object has been initialized.
           @return True if the object has not been initialized, false otherwise.
       */
       Boolean isUninitialized() const;
   
       /**
           Compares the qualifier with another qualifier.
           @param x The CIMConstQualifier to be compared.
           @return True if this qualifier is identical to the one specified,
               false otherwise.
           @exception UninitializedObjectException If either of the objects
               is not initialized.
       */
     Boolean identical(const CIMConstQualifier& x) const;     Boolean identical(const CIMConstQualifier& x) const;
  
       /**
           Makes a deep copy of the qualifier.  This creates a new copy
           of all the qualifier attributes.
           @return A CIMQualifier object with a separate copy of the
               CIMConstQualifier object.
           @exception UninitializedObjectException If the object is not
               initialized.
       */
     CIMQualifier clone() const;     CIMQualifier clone() const;
  
 private: private:
  
     void _checkRep() const;  
   
     CIMQualifierRep* _rep;     CIMQualifierRep* _rep;
  
     friend class CIMQualifier;     friend class CIMQualifier;


Legend:
Removed from v.1.29  
changed lines
  Added in v.1.54

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2