(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.12 and 1.29

version 1.12, 2001/07/10 22:31:09 version 1.29, 2002/07/17 12:07:56
Line 1 
Line 1 
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM  // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
   // The Open Group, Tivoli Systems
 // //
 // 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 22 
Line 23 
 // //
 // Author: Mike Brasher (mbrasher@bmc.com) // Author: Mike Brasher (mbrasher@bmc.com)
 // //
 // Modified By:  // Modified By: Karl Schopmeyer (k.schopmeyer@opengroup.org)
   //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 /* /*
  CIMQualifier.h - Defines the CIM qualifiers class.  CIMQualifier.h - Defines the CIM qualifiers class.
         This class represents a CIM qualifiers. It is almost identical to  
         CIMQualifierDecl except that it has no scope member.  
  
 */ */
  
Line 37 
Line 37 
 #define Pegasus_Qualifier_h #define Pegasus_Qualifier_h
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/CIMQualifierRep.h>  #include <Pegasus/Common/CIMFlavor.h>
   #include <Pegasus/Common/CIMType.h>
   #include <Pegasus/Common/CIMValue.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 49 
Line 51 
  
 class CIMConstQualifier; class CIMConstQualifier;
 class CIMClassRep; class CIMClassRep;
   #if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
   class CIMQualifierRep;
   #endif
  
 /** Class CIMQualifier - This class defines the Pegasus implementation of the /** Class CIMQualifier - This class defines the Pegasus implementation of the
     CIM CIMQualifier \Ref{QUALIFIER}.      CIM Qualifier \Ref{QUALIFIER}.  It is almost identical to
       CIMQualifierDecl except that it has no scope member. \Ref{CIMQualifierDecl}
       This includes functions to create qualifiers and manipulate/test
       the individual components of the CIMQualifier.
       CIMQualifiers are accumulated into lists for use in CIMClasses and CIM
       Properties using the CIMQualifierList Class and its
       functions. \Ref{CIMQualifierList}
 */ */
 class PEGASUS_COMMON_LINKAGE CIMQualifier class PEGASUS_COMMON_LINKAGE CIMQualifier
 { {
Line 61 
Line 72 
         fields.Constructor         fields.Constructor
         @return instantiated empty qualifier object         @return instantiated empty qualifier object
     */     */
     CIMQualifier() : _rep(0)      CIMQualifier();
     {  
   
     }  
  
     /** Constructor - instantiates a CIM qualifier object from another     /** Constructor - instantiates a CIM qualifier object from another
     qualifier object.     qualifier object.
     @param CIM CIMQualifier object     @param CIM CIMQualifier object
     ATTN: What is differenc from clone?  
     @return - Instantiated qualifier object     @return - Instantiated qualifier object
  */  */
     CIMQualifier(const CIMQualifier& x)      CIMQualifier(const CIMQualifier& x);
     {  
         Inc(_rep = x._rep);  
     }  
     /** Constructor - Instantiates a CIM qualifier object with the parameters     /** Constructor - Instantiates a CIM qualifier object with the parameters
     defined on input.     defined on input.
     @param String representing CIMName for the new qualifier     @param String representing CIMName for the new qualifier
     @param value     @param value
     @param flavor - ATTN:          @param flavor - Flavor defined for this qualifier definition. Default
     @param propoagated - ATTN:          for this parameter is CIMFlavor::NONE.
     @return -Returns the instantiated qualifier object or throws an exception          @param propoagated - Boolean defining whether this is a propagated
     if the name argument is illegal          qualifier.  This is an optional parameter with default = false
           @return -Returns the instantiated qualifier object or throws an
           exception if the name argument is illegal
  
     @exception Throws IllegalName if name argument not legal CIM     @exception Throws IllegalName if name argument not legal CIM
     identifier.     identifier.
Line 91 
Line 98 
     CIMQualifier(     CIMQualifier(
         const String& name,         const String& name,
         const CIMValue& value,         const CIMValue& value,
         Uint32 flavor = CIMFlavor::DEFAULTS,          Uint32 flavor = CIMFlavor::NONE,
         Boolean propagated = false)          Boolean propagated = false);
     {  
         _rep = new CIMQualifierRep(name, value, flavor, propagated);  
     }  
     /// destructor  
     ~CIMQualifier()  
     {  
         Dec(_rep);  
     }  
     /// operator  
     CIMQualifier& operator=(const CIMQualifier& x)  
     {  
         if (x._rep != _rep)  
         {  
             Dec(_rep);  
             Inc(_rep = x._rep);  
         }  
  
         return *this;      /// destructor
     }      ~CIMQualifier();
  
     /** CIMMethod      /// operator
       CIMQualifier& operator=(const CIMQualifier& x);
  
       /** getName - Returns the name field from the qualifier
           @return String containing the qualifier name.
     */     */
     const String& getName() const      const String& getName() const;
     {  
         _checkRep();  
         return _rep->getName();  
     }  
  
     /** CIMMethod      /** setName - Sets the qualifier name field in the qualifier object.
      Throws IllegalName if name argument not legal CIM  identifier.          @param name - String containing the name for the qualifier
           @exception Throws IllegalName if name argument not legal CIM identifier.
     */     */
     void setName(const String& name)      void setName(const String& name);
     {  
         _checkRep();  
         _rep->setName(name);  
     }  
   
     /** CIMMethod  
  
       /** getType - Gets the type field from the qualifier object.
           @return CIMType containing the type for this qualifier /Ref{CIMType}.
     */     */
     CIMType getType() const      CIMType getType() const;
     {  
         _checkRep();  
         return _rep->getType();  
     }  
   
     /** CIMMethod  
  
       /** isArray - Returns true if the qualifier is an array
           @return Boolean true if array qualifier.
     */     */
     Boolean isArray() const      Boolean isArray() const;
     {  
         _checkRep();  
         return _rep->isArray();  
     }  
   
     /** CIMMethod  
  
       /** getValue - Gets the value component of the qualifier object
           @return CIMValue containing the value component
     */     */
     const CIMValue& getValue() const      const CIMValue& getValue() const;
     {  
         _checkRep();  
         return _rep->getValue();  
     }  
   
     /** CIMMethod  
  
       /** setValue - Puts a CIMValue object into a CIMQualifier object
           @param value - The CIMValue object to install
     */     */
     void setValue(const CIMValue& value)      void setValue(const CIMValue& value);
     {  
         _checkRep();  
         _rep->setValue(value);  
     }  
   
     /** CIMMethod  
  
       /** setFlavor - Sets the bits defined on input into the Flavor variable
           for the Qualifier Object.
           @param flavor - Uint32 defines the flavor bits to be set.
     */     */
     Uint32 getFlavor() const      void setFlavor(Uint32 flavor);
     {  
         _checkRep();  
         return _rep->getFlavor();  
     }  
   
     /** CIMMethod  
  
       /** unsetFlavor - Resets the bits defined for the flavor
           for the Qualifier Object with the input.
           @param flavor - Uint32 defines the flavor bits to be set.
    */    */
     const Uint32 getPropagated() const      void unsetFlavor(Uint32 flavor);
     {  
         _checkRep();  
         return _rep->getPropagated();  
     }  
   
     /** CIMMethod  
  
       /** getFlavor - Gets the Flavor field from a Qualifier
           @return - Uint32 with the Flavor flags that can be tested
           against the CIMFlavor constants.
     */     */
     void setPropagated(Boolean propagated)      Uint32 getFlavor() const;
     {  
         _checkRep();  
         _rep->setPropagated(propagated);  
     }  
   
     /** CIMMethod  
  
       /** isFlavor - Boolean function that determines if particular flavor
           flags are set in the flavor variable of a qualifier.
           @param flavor - The flavor bits to test.
           Return True if the defined flavor is set.
           <pre>
           if (q.isFlavor(CIMType::TOSUBCLASS)
                   do something based on TOSUBCLASS being true
           </pre>
     */     */
     operator int() const { return _rep != 0; }      Boolean isFlavor(Uint32 flavor) const;
   
     /** CIMMethod  
  
       /** resolveFlavor - Function used only in object creation to
           resolve the combination of a qualifer flavor input and
           the corresponding inherited flavor from declaration or
           superclass and set the current qualifier to that
           definition.  The functions changes the current flavor based
           on the characteristics of the inheritance.
           @param inheritedFlavor - The flavor inherited from higher level
           @param inherited - True if inherited from definition. False if this
           is definition that inherits from the declaration
     */     */
     void toXml(Array<Sint8>& out) const      void resolveFlavor(Uint32 inheritedFlavor, Boolean inherited);
     {  
         _checkRep();  
         _rep->toXml(out);  
     }  
  
     /** CIMMethod      /** getPropagated returns the propagated indicator
           @return Uint32 - TBD
       */
       const Uint32 getPropagated() const;
  
       /** setPropagated - Sets the Propagated flag for the object.
    */    */
     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const      void setPropagated(Boolean propagated);
     {  
         _checkRep();  
         _rep->print(o);  
     }  
  
   #ifdef PEGASUS_INTERNALONLY
     /** CIMMethod     /** CIMMethod
       */
       Boolean isNull() const;
   #endif
  
       /** identical - compares two CIMQualifier objects.
           @return - True if the objects are identical.
    */    */
     Boolean identical(const CIMConstQualifier& x) const;     Boolean identical(const CIMConstQualifier& x) const;
  
     /** CIMMethod      /** clone Creates an exact copy of the qualifier and returns the
           new object.
           @return CIMQualifier New Qualifier object.
     */     */
     CIMQualifier clone() const      CIMQualifier clone() const;
     {  
         return CIMQualifier(_rep->clone());  
     }  
  
 private: private:
  
     CIMQualifier(CIMQualifierRep* rep) : _rep(rep)      CIMQualifier(CIMQualifierRep* rep);
     {  
     }  
  
     void _checkRep() const      void _checkRep() const;
     {  
         if (!_rep)  
             ThrowUnitializedHandle();  
     }  
  
     CIMQualifierRep* _rep;     CIMQualifierRep* _rep;
   
     friend class CIMConstQualifier;     friend class CIMConstQualifier;
     friend class CIMClassRep;     friend class CIMClassRep;
       friend class XmlWriter;
       friend class MofWriter;
 }; };
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Line 257 
Line 229 
 { {
 public: public:
  
     CIMConstQualifier() : _rep(0)      CIMConstQualifier();
     {  
  
     }      CIMConstQualifier(const CIMConstQualifier& x);
  
     CIMConstQualifier(const CIMConstQualifier& x)      CIMConstQualifier(const CIMQualifier& x);
     {  
         Inc(_rep = x._rep);  
     }  
   
     CIMConstQualifier(const CIMQualifier& x)  
     {  
         Inc(_rep = x._rep);  
     }  
  
     // Throws IllegalName if name argument not legal CIM identifier.     // Throws IllegalName if name argument not legal CIM identifier.
  
     CIMConstQualifier(     CIMConstQualifier(
         const String& name,         const String& name,
         const CIMValue& value,         const CIMValue& value,
         Uint32 flavor = CIMFlavor::DEFAULTS,          Uint32 flavor = CIMFlavor::NONE,
         Boolean propagated = false)          Boolean propagated = false);
     {  
         _rep = new CIMQualifierRep(name, value, flavor, propagated);  
     }  
  
     ~CIMConstQualifier()      ~CIMConstQualifier();
     {  
         Dec(_rep);  
     }  
  
     CIMConstQualifier& operator=(const CIMConstQualifier& x)      CIMConstQualifier& operator=(const CIMConstQualifier& x);
     {  
         if (x._rep != _rep)  
         {  
             Dec(_rep);  
             Inc(_rep = x._rep);  
         }  
  
         return *this;      CIMConstQualifier& operator=(const CIMQualifier& x);
     }  
  
     CIMConstQualifier& operator=(const CIMQualifier& x)      const String& getName() const;
     {  
         if (x._rep != _rep)  
         {  
             Dec(_rep);  
             Inc(_rep = x._rep);  
         }  
  
         return *this;      CIMType getType() const;
     }  
  
     const String& getName() const      Boolean isArray() const;
     {  
         _checkRep();  
         return _rep->getName();  
     }  
  
     CIMType getType() const      const CIMValue& getValue() const;
     {  
         _checkRep();  
         return _rep->getType();  
     }  
  
     Boolean isArray() const      const Uint32 getFlavor() const;
     {  
         _checkRep();  
         return _rep->isArray();  
     }  
  
     const CIMValue& getValue() const      Boolean isFlavor(Uint32 flavor) const;
     {  
         _checkRep();  
         return _rep->getValue();  
     }  
  
     const Uint32 getFlavor() const      Boolean isFlavorToSubclass() const;
     {  
         _checkRep();  
         return _rep->getFlavor();  
     }  
  
     const Uint32 getPropagated() const      Boolean isFlavorToInstance() const;
     {  
         _checkRep();  
         return _rep->getPropagated();  
     }  
  
     operator int() const { return _rep != 0; }      Boolean isFlavorOverridable() const;
  
     void toXml(Array<Sint8>& out) const      const Uint32 getPropagated() const;
     {  
         _checkRep();  
         _rep->toXml(out);  
     }  
  
     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const  #ifdef PEGASUS_INTERNALONLY
     {      Boolean isNull() const;
         _checkRep();  #endif
         _rep->print(o);  
     }  
  
     Boolean identical(const CIMConstQualifier& x) const      Boolean identical(const CIMConstQualifier& x) const;
     {  
         x._checkRep();  
         _checkRep();  
         return _rep->identical(x._rep);  
     }  
  
     CIMQualifier clone() const      CIMQualifier clone() const;
     {  
         return CIMQualifier(_rep->clone());  
     }  
  
 private: private:
  
     void _checkRep() const      void _checkRep() const;
     {  
         if (!_rep)  
             ThrowUnitializedHandle();  
     }  
  
     CIMQualifierRep* _rep;     CIMQualifierRep* _rep;
   
     friend class CIMQualifier;     friend class CIMQualifier;
       friend class XmlWriter;
       friend class MofWriter;
 }; };
  
 PEGASUS_MEMORY_FUNCTIONS(CIMQualifier)  
 PEGASUS_MEMORY_FUNCTIONS(CIMQualifier*)  
   
 #define PEGASUS_ARRAY_T CIMQualifier #define PEGASUS_ARRAY_T CIMQualifier
 # include "ArrayInter.h"  # include <Pegasus/Common/ArrayInter.h>
 #undef PEGASUS_ARRAY_T #undef PEGASUS_ARRAY_T
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2