(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.47.18.2

version 1.12, 2001/07/10 22:31:09 version 1.47.18.2, 2006/02/10 16:09:35
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:  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 /*  
  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.  
   
 */  
   
 #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/CIMQualifierRep.h>  #include <Pegasus/Common/Linkage.h>
   #include <Pegasus/Common/CIMName.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;
   class Resolver;
   class CIMQualifierRep;
  
 /** Class CIMQualifier - This class defines the Pegasus implementation of the  /** The CIMQualifier class is used to represent CIM qualifiers in Pegasus.
     CIM CIMQualifier \Ref{QUALIFIER}.      It is almost identical to \Ref{CIMQualifierDecl} except that it has no
       scope member.
       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
       CIMProperties using the \Ref{CIMQualifierList} Class and its
       functions.
 */ */
 class PEGASUS_COMMON_LINKAGE CIMQualifier class PEGASUS_COMMON_LINKAGE CIMQualifier
 { {
 public: public:
  
     /** Constructor instantiates a CIM qualifier with empty name value      /** Constructor - Creates a CIM qualifier object with empty name
         fields.Constructor          value fields.
         @return instantiated empty qualifier object  
     */     */
     CIMQualifier() : _rep(0)      CIMQualifier();
     {  
  
     }      /** Constructor - Creates a CIM qualifier object from another
           CIM qualifier object.
     /** Constructor - instantiates a CIM qualifier object from another          @param x - CIMQualifier object.
     qualifier object.  
     @param CIM CIMQualifier object  
     ATTN: What is differenc from clone?  
     @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  
     defined on input.  
     @param String representing CIMName for the new qualifier  
     @param value  
     @param flavor - ATTN:  
     @param propoagated - ATTN:  
     @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      /** Constructor - Creates a CIM qualifier object with the parameters
     identifier.          defined on input.
           @param name - CIMName representing name for the new qualifier.
           @param value - CIMValue from which to extract the value for the keys.
           @param flavor - Flavor defined for this qualifier definition. Default
           for this parameter is CIMFlavor::NONE.
           @param propagated - Boolean defining whether this is a propagated
           qualifier.  This is an optional parameter with default = false
      */      */
     CIMQualifier(     CIMQualifier(
         const String& name,          const CIMName& name,
         const CIMValue& value,         const CIMValue& value,
         Uint32 flavor = CIMFlavor::DEFAULTS,          const CIMFlavor & flavor = CIMFlavor (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      ///
       CIMQualifier& operator=(const CIMQualifier& x);
  
       /** Returns the name field from the qualifier.
           @return CIMName containing the qualifier name.
     */     */
     const String& getName() const      const CIMName& getName() const;
     {  
         _checkRep();  
         return _rep->getName();  
     }  
  
     /** CIMMethod      /** Sets the qualifier name field in the qualifier object.
      Throws IllegalName if name argument not legal CIM  identifier.          @param name - CIMName containing the name for the qualifier.
     */     */
     void setName(const String& name)      void setName(const CIMName& name);
     {  
         _checkRep();  
         _rep->setName(name);  
     }  
   
     /** CIMMethod  
  
       /** Gets the type field from the qualifier object.
           @return CIMType containing the type for this qualifier.
     */     */
     CIMType getType() const      CIMType getType() const;
     {  
         _checkRep();  
         return _rep->getType();  
     }  
   
     /** CIMMethod  
  
       /** Return true if the qualifier is an array.
           @return true if the qualifier is an array, false otherwise.
     */     */
     Boolean isArray() const      Boolean isArray() const;
     {  
         _checkRep();  
         return _rep->isArray();  
     }  
   
     /** CIMMethod  
  
       /** 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  
  
       /** 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  
  
       /** Sets the bits defined on input into the Flavor variable
           for the Qualifier Object.
           @param flavor - CIMFlavor object defines the flavor bits to be set.
     */     */
     Uint32 getFlavor() const      void setFlavor(const CIMFlavor & flavor);
     {  
         _checkRep();  
         return _rep->getFlavor();  
     }  
   
     /** CIMMethod  
  
       /** Resets the bits defined for the flavor
           for the Qualifier Object with the input.
           @param flavor - CIMFlavor object defines the flavor bits to be unset.
    */    */
     const Uint32 getPropagated() const      void unsetFlavor(const CIMFlavor & flavor);
     {  
         _checkRep();  
         return _rep->getPropagated();  
     }  
   
     /** CIMMethod  
  
       /** Gets the Flavor field from the Qualifier.
           @return CIMFlavor object from this qualifier.
     */     */
     void setPropagated(Boolean propagated)      const CIMFlavor & getFlavor() const;
     {  
         _checkRep();  
         _rep->setPropagated(propagated);  
     }  
   
     /** CIMMethod  
  
       /** Gets the Propagated flag for the qualifier.
           (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, zero otherwise.
     */     */
     operator int() const { return _rep != 0; }      const Uint32 getPropagated() const;
   
     /** CIMMethod  
  
       /** Sets the Propagated flag for the qualifier.
           @param propagated - Flag indicating propagation.
     */     */
     void toXml(Array<Sint8>& out) const      void setPropagated(Boolean propagated);
     {  
         _checkRep();  
         _rep->toXml(out);  
     }  
   
     /** CIMMethod  
  
       /** Determines if the object has not been initialized.
           @return  true if the object has not been initialized,
                    false otherwise.
    */    */
     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const      Boolean isUninitialized() const;
     {  
         _checkRep();  
         _rep->print(o);  
     }  
   
     /** CIMMethod  
  
       /** Compares two CIMQualifier objects.
           @return  true if the objects are identical, false otherwise.
    */    */
     Boolean identical(const CIMConstQualifier& x) const;     Boolean identical(const CIMConstQualifier& x) const;
  
     /** CIMMethod      /** Creates an exact copy of the qualifier and returns the
           new object.
           @return copy of CIMQualifier 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 Resolver;
       friend class XmlWriter;
       friend class MofWriter;
       friend class BinaryStreamer;
 }; };
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Line 253 
Line 197 
 // //
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
  
   ///
 class PEGASUS_COMMON_LINKAGE CIMConstQualifier class PEGASUS_COMMON_LINKAGE CIMConstQualifier
 { {
 public: public:
  
     CIMConstQualifier() : _rep(0)      ///
     {      CIMConstQualifier();
   
     }  
   
     CIMConstQualifier(const CIMConstQualifier& x)  
     {  
         Inc(_rep = x._rep);  
     }  
  
     CIMConstQualifier(const CIMQualifier& x)      ///
     {      CIMConstQualifier(const CIMConstQualifier& x);
         Inc(_rep = x._rep);  
     }  
  
     // Throws IllegalName if name argument not legal CIM identifier.      ///
       CIMConstQualifier(const CIMQualifier& x);
  
       ///
     CIMConstQualifier(     CIMConstQualifier(
         const String& name,          const CIMName& name,
         const CIMValue& value,         const CIMValue& value,
         Uint32 flavor = CIMFlavor::DEFAULTS,          const CIMFlavor & flavor = CIMFlavor (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 CIMName& 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 CIMFlavor & getFlavor() const;
         _checkRep();  
         return _rep->isArray();  
     }  
  
     const CIMValue& getValue() const      ///
     {      const Uint32 getPropagated() const;
         _checkRep();  
         return _rep->getValue();  
     }  
   
     const Uint32 getFlavor() const  
     {  
         _checkRep();  
         return _rep->getFlavor();  
     }  
  
     const Uint32 getPropagated() const      ///
     {      Boolean isUninitialized() const;
         _checkRep();  
         return _rep->getPropagated();  
     }  
   
     operator int() const { return _rep != 0; }  
   
     void toXml(Array<Sint8>& out) const  
     {  
         _checkRep();  
         _rep->toXml(out);  
     }  
  
     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const      ///
     {      Boolean identical(const CIMConstQualifier& x) const;
         _checkRep();  
         _rep->print(o);  
     }  
   
     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.47.18.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2