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

Diff for /pegasus/src/Pegasus/Common/CIMMethod.h between version 1.11 and 1.44

version 1.11, 2001/05/21 17:15:44 version 1.44, 2004/06/03 08:45:20
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2003////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000 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.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a  // Permission is hereby granted, free of charge, to any person obtaining a copy
 // copy of this software and associated documentation files (the "Software"),  // of this software and associated documentation files (the "Software"), to
 // to deal in the Software without restriction, including without limitation  // deal in the Software without restriction, including without limitation the
 // the rights to use, copy, modify, merge, publish, distribute, sublicense,  // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 // and/or sell copies of the Software, and to permit persons to whom the  // sell copies of the Software, and to permit persons to whom the Software is
 // Software is furnished to do so, subject to the following conditions:  // furnished to do so, subject to the following conditions:
 // //
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL  // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING  // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER  // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 // DEALINGS IN THE SOFTWARE.  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com) // Author: Mike Brasher (mbrasher@bmc.com)
 // //
 // Modified By:  // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
   //              Carol Ann Krug Graves, Hewlett-Packard Company
   //                (carolann_graves@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 29 
Line 35 
 #define Pegasus_Method_h #define Pegasus_Method_h
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/CIMMethodRep.h>  #include <Pegasus/Common/Linkage.h>
   #include <Pegasus/Common/String.h>
   #include <Pegasus/Common/CIMName.h>
   #include <Pegasus/Common/CIMParameter.h>
   #include <Pegasus/Common/CIMQualifier.h>
   #include <Pegasus/Common/CIMType.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   class Resolver;
 class CIMConstMethod; class CIMConstMethod;
   class CIMMethodRep;
  
 /** Class CIMMethod - This class defines the operations associated with  /** The CIMMethod class is used to represent CIM methods in Pegasus.
     manipulation of the Pegasus implementation of the CIM CIMMethod. Within      A CIMMethod consists of the following entities:
     this class, methods are provides for creation, deletion, and manipulation      <ul>
     of method declarations.          <li>Name of the method, a CIMName.
   
     // ATTN: remove the classOrigin and propagated parameters.          <li>CIM type of the method return value, a CIMType.
   
           <li>Optional qualifiers (see CIMQualifier) for the method.
           A method can contain zero or more CIMQualifier objects.
   
           <li>Optional parameters (see CIMParameter) for the method.
           A CIMMethod may contain zero or more CIMParameter objects.
       </ul>
       In addition, a CIMMethod contains the following internal attributes:
       <ul>
           <li><b>propagated</b> - An attribute defining whether this CIMMethod is
           propagated from a superclass.  Note that this is normally set as part
           of completing the definition of objects (resolving) when they are
           created as part of a CIM schema and is NOT automatically set when
           creating a local object.  It can only be logically set in context of
           the schema in which the CIMMethod is defined.
           <li><b>classOrigin</b> - An attribute defining the class in which
           this CIMMethod was originally defined.  This is normally set within the
           context of the schema in which the CIMMethod is defined.
           This attribute is available from objects retrieved from the CIM
           Server, for example, and provides information on the defintion
           of this method in the class hierarchy.  Together the
           propagated and ClassOrigin attributes can be used to determine if
           methods originated with the current object or were inherited from
           higher levels in the hiearchy.
       </ul>
       A CIMMethod is generally defined in the context of a CIMClass.
   
       CIMMethod uses shared representations, meaning that multiple
       CIMMethod objects may refer to the same copy of data. Assignment and copy
       operators create new references to the same data, not distinct copies.
       A distinct copy may be created using the clone method.
       {@link Shared Classes}
       @see CIMConstMethod
       @see CIMParameter
       @see CIMQualifier
       @see CIMType
       @see CIMClass
 */ */
 class PEGASUS_COMMON_LINKAGE CIMMethod class PEGASUS_COMMON_LINKAGE CIMMethod
 { {
 public: public:
  
     /** Creates and instantiates a CIM method. */      /** Creates a new uninitialized CIMMethod object.
     CIMMethod() : _rep(0)          The only thing that can be done with this object is to copy another
     {          object into it.  Other methods, such as setName, will fail with an
           UninitializedObjectException.  The object has an uninitialized state,
     }          which can be tested with the isUninitialized method.
           @see isUninitialized()
     /** Creates and instantiates a CIM method from another method instance          @see UninitializedObjectException
         @return pointer to the new method instance      */
     */      CIMMethod();
     CIMMethod(const CIMMethod& x)  
     {      /** Creates a new CIMMethod object from another CIMMethod object.
         Inc(_rep = x._rep);          The new CIMMethod object references the same copy of data as the
     }          specified object; no copy is made.
           @param x CIMMethod object from which to create the new CIMMethod object.
     /** Assignment operator */          <p><b>Example:</b>
     CIMMethod& operator=(const CIMMethod& x)          <pre>
     {              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
         if (x._rep != _rep)              const CIMMethod cm1(m1);
         {          </pre>
             Dec(_rep);          {@link Shared Classes}
             Inc(_rep = x._rep);      */
         }      CIMMethod(const CIMMethod& x);
         return *this;  
     }      /** Creates a CIMMethod object with the specified attributes.
           @param name CIMName defining the name for the method.
     /**  Creates a CIM method with the specified name, type, and classOrigin  
         @param name for the method          @param type CIMType defining the method return type.
         @param type ATTN  
         @param classOrigin          @param classOrigin (optional) CIMName representing the class origin.
         @param propagated              Note that this should normally not be used.  If not provided set to
         @return  Throws IllegalName if name argument not legal CIM identifier.              CIMName() (Null name).
           @param propagated Optional flag indicating whether the definition of
               the CIM Method is local to the CIM Class (respectively, Instance)
               in which it appears, or was propagated without modification from
               a superclass. Default is false. Note that this attribute is
               normally not set by CIM Clients but is used internally within the
               CIM Server.
           <p><b>Example:</b>
           <pre>
               CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
           </pre>
     */     */
     CIMMethod(     CIMMethod(
         const String& name,          const CIMName& name,
         CIMType type,         CIMType type,
         const String& classOrigin = String(),          const CIMName& classOrigin = CIMName(),
         Boolean propagated = false)          Boolean propagated = false);
     {  
         _rep = new CIMMethodRep(name, type, classOrigin, propagated);  
     }  
   
     /** Desctructor. */  
     ~CIMMethod()  
     {  
         Dec(_rep);  
     }  
   
     /** CIMMethod getName - Gets the name of the method  
         @return String with the name of the method  
     */  
     const String& getName() const  
     {  
         _checkRep();  
         return _rep->getName();  
     }  
   
     /** CIMMethod setName - Set the method name  
         @param name  
         @exception IllegalName if name argument not legal CIM identifier.  
     */  
     void setName(const String& name)  
     {  
         _checkRep();  
         _rep->setName(name);  
     }  
   
     /** CIMMethod getType - gets the method type  
         @return The CIM method type for this method.  
     */  
     CIMType getType() const  
     {  
         _checkRep();  
         return _rep->getType();  
     }  
   
     /** CIMMethod setType - Sets the method type to the specified CIM method  
         type as defined in CIMType /Ref{TYPE}  
     */  
     void setType(CIMType type)  
     {  
         _checkRep();  
         _rep->setType(type);  
     }  
   
     /** CIMMethod getClassOrigin - Returns the class in which this method  
         was defined.  
         @return ATTN:  
     */  
     const String& getClassOrigin() const  
     {  
         _checkRep();  
         return _rep->getClassOrigin();  
     }  
   
     /** CIMMethod setClassOrigin - ATTN: */  
     void setClassOrigin(const String& classOrigin)  
     {  
         _checkRep();  
         _rep->setClassOrigin(classOrigin);  
     }  
   
     /** method getPropagated - ATTN: */  
     Boolean getPropagated() const  
     {  
         _checkRep();  
         return _rep->getPropagated();  
     }  
  
     /** method setPropagated - ATTN: */      /** Destructor for the CIMMethod.  The shared data copy remains valid until
     void setPropagated(Boolean propagated)          all referring objects are destructed.
     {          {@link Shared Classes}
         _checkRep();      */
         _rep->setPropagated(propagated);      ~CIMMethod();
     }  
       /** The assignment operator assigns one CIMMethod to another.
     /** CIMMethod addQualifier - Adds a Qualifier to the method object.          After the assignment, both CIMMethod objects refer to the same
         @param CIMQualifier to be added          data copy; a distinct copy is not created.
         @return Throws AlreadyExists excetpion if the qualifier already exists          @param x CIMMethod object from which to assign this CIMMethod object.
         in the method  
         @exception AlreadyExists exception          <p><b>Example:</b>
     */          <pre>
     CIMMethod& addQualifier(const CIMQualifier& x)              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     {              CIMMethod m2;
         _checkRep();              m2 = m1;
         _rep->addQualifier(x);          </pre>
         return *this;      */
     }      CIMMethod& operator=(const CIMMethod& x);
   
     /** CIMMethod findQualifier - returns the position of the qualifier with      /** Gets the name of the method.
         the given name.          @return CIMName with the name of the method.
         @param name Name of qualifier to be found.          <p><b>Example:</b>
         @return index of the parameter if found; otherwise Uint32(-1).          <pre>
     */              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     Uint32 findQualifier(const String& name)              assert(m1.getName() == CIMName ("getHostName"));
     {          </pre>
         _checkRep();      */
         return _rep->findQualifier(name);      const CIMName& getName() const;
     }  
       /** Sets the method name.
     Uint32 findQualifier(const String& name) const          @param name CIMName for the method name. Replaces any
     {              previously defined name for this method object.
         _checkRep();          <p><b>Example:</b>
         return _rep->findQualifier(name);          <pre>
     }              CIMMethod m2(CIMName ("test"), CIMTYPE_STRING);
               m2.setName(CIMName ("getVersion"));
     /** existsQualifier - returns the position of the qualifier with          </pre>
         the given name.      */
         @param name Name of qualifier to be found.      void setName(const CIMName& name);
         @return index of the parameter if found; otherwise Uint32(-1).  
     */      /** Gets the method return type.
     Boolean existsQualifier(const String& name)          @return A CIMType containing the method return type.
     {          @exception UninitializedObjectException Thrown if the object is not
         _checkRep();          initialized.
         return _rep->existsQualifier(name);          <p><b>Example:</b>
     }          <pre>
               CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     Boolean existsQualifier(const String& name) const              assert(m1.getType() == CIMTYPE_STRING);
     {          </pre>
         _checkRep();      */
         return _rep->existsQualifier(name);      CIMType getType() const;
     }  
       /** Sets the method return type to the specified CIMType.
           This is the type of the CIMValue
     /** CIMMethod getQualifier - Gets the CIMQualifier defined by the index          that is returned on a CIM method invocation.
         input as a parameter.          @param type CIMType to be set into the CIMMethod object.
         @param Index of the qualifier requested.          @exception UninitializedObjectException Thrown if the object is not
         @return CIMQualifier object or exception          initialized.
         @exception OutOfBounds exception if the index is outside the range of          <p><b>Example:</b>
         parameters available from the CIMMethod.          <pre>
     */              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     CIMQualifier getQualifier(Uint32 pos)              m1.setName(CIMName ("getVersion"));
     {              assert(m1.getName() == CIMName ("getVersion"));
         _checkRep();          </pre>
         return _rep->getQualifier(pos);      */
     }      void setType(CIMType type);
   
     CIMConstQualifier getQualifier(Uint32 pos) const      /** Gets the class in which this method was defined. This information
     {          is normally available with methods that are part of a schema
         _checkRep();          returned from a CIM Server.
         return _rep->getQualifier(pos);          @return CIMName containing the classOrigin attribute.
     }      */
       const CIMName& getClassOrigin() const;
     /** removeQualifier - Removes the CIMQualifier defined by the  
         position input as a parameter.      /** Sets the classOrigin attribute with the specified class name.
         @param Position of the qualifier requested.          Normally this method is used internally by a CIM Server when
         @return CIMQualifier object or exception          defining methods in the context of a schema.
         @exception OutOfBounds exception if the index is outside the range of          @param classOrigin CIMName parameter defining the name
         parameters available from the CIMMethod.          of the origin class.
     */          @exception UninitializedObjectException Thrown if the object is not
     void removeQualifier(Uint32 pos)          initialized.
     {      */
         _checkRep();      void setClassOrigin(const CIMName& classOrigin);
         _rep->removeQualifier(pos);  
     }      /** Tests the propagated attribute of the object.  The propagated
           attribute indicates whether this method was propagated from a
           higher-level class.  Normally this attribute is set as part of
     /** CIMMethod getQualifierCount - Returns the number of Qualifiers attached          defining a method in the context of a schema.  It is set in
         to this method.          methods retrieved from a CIM Server.
         @return integer representing number of Qualifiers.          @return True if method is propagated; otherwise, false.
     */      */
     Uint32 getQualifierCount() const      Boolean getPropagated() const;
     {  
         _checkRep();      /** Sets the propagated attribute.  Normally this is used by a CIM Server
         return _rep->getQualifierCount();          when defining a method in the context of a schema.
     }          @param propagated Flag indicating whether the method is propagated
           from a superclass.
     /** CIMMethod addParameter - Adds the parameter defined by the input          @exception UninitializedObjectException Thrown if the object is not
         to the CIMMethod          initialized.
     */      */
     CIMMethod& addParameter(const CIMParameter& x)      void setPropagated(Boolean propagated);
     {  
         _checkRep();      /** Adds the specified qualifier to the CIMMethod object.
         _rep->addParameter(x);          @param x CIMQualifier object representing the qualifier
         return *this;          to be added.
     }          @return The CIMMethod object after adding the specified qualifier.
           @exception AlreadyExistsException Thrown if the qualifier already
     /** CIMMethod findParameter - Finds the parameter whose name is given          exists in this CIMMethod.
         by the name parameter.          <p><b>Example:</b>
         @param name Name of parameter to be found.          <pre>
         @return index of the parameter if found; otherwise Uint32(-1).              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     */              m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
     Uint32 findParameter(const String& name)          </pre>
     {      */
         _checkRep();      CIMMethod& addQualifier(const CIMQualifier& x);
         return _rep->findParameter(name);  
     }      /** Searches for a qualifier with the specified input name.
           @param name CIMName of the qualifier to be found.
     Uint32 findParameter(const String& name) const          @return Zero origin index of the qualifier found or PEG_NOT_FOUND
     {          if not found.
         _checkRep();          @exception UninitializedObjectException Thrown if the object is not
         return _rep->findParameter(name);          initialized.
     }          <p><b>Example:</b>
           <pre>
     /** CIMMethod getParameter - ATTN: */              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     CIMParameter getParameter(Uint32 pos)              m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
     {              assert(m1.findQualifier(CIMName ("stuff")) != PEG_NOT_FOUND);
         _checkRep();          </pre>
         return _rep->getParameter(pos);      */
     }      Uint32 findQualifier(const CIMName& name) const;
   
     /** CIMMethod getParameter - Gets the parameter defined by the index      /** Gets the CIMQualifier defined by the input parameter.
         input as a parameter.          @param index Zero origin index of the qualifier requested.
         @param index for the parameter to be returned.          @return CIMQualifier object representing the qualifier found.
         @return CIMParameter requested.          @exception IndexOutOfBoundsException Thrown if the index is
         @Exception OutOfBounds exception is thrown if the index is outside the          outside the range of parameters available from the CIMMethod.
         range of available parameters          <p><b>Example:</b>
     */          <pre>
     CIMConstParameter getParameter(Uint32 pos) const              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     {              m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
         _checkRep();              Uint32 posQualifier = m1.findQualifier(CIMName ("stuff"));
         return _rep->getParameter(pos);              if (posQualifier != PEG_NOT_FOUND)
     }              {
                   CIMQualifier q = m1.getQualifier(posQualifier);
     /** CIMMethod getParameterCount - Gets the count of the numbeer of              }
         Parameters attached to the CIMMethod.          </pre>
         @retrun - count of the number of parameters attached to the CIMMethod.      */
     */      CIMQualifier getQualifier(Uint32 index);
     Uint32 getParameterCount() const  
     {      /** Gets the CIMQualifier defined by the input parameter.
         _checkRep();          @param index Zero origin index of the qualifier requested.
         return _rep->getParameterCount();          @return CIMQualifier object representing the qualifier found.
     }          @exception IndexOutOfBoundsException Thrown if the index is
           outside the range of parameters available from the CIMMethod.
     /** method resolve - ATTN: */          <p><b>Example:</b>
     void resolve(          <pre>
         DeclContext* declContext,              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
         const String& nameSpace,              m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
         const CIMConstMethod& method)              const CIMMethod m2 = m1;
     {              Uint32 posQualifier = m2.findQualifier(CIMName ("stuff"));
         _checkRep();              if (posQualifier != PEG_NOT_FOUND)
         _rep->resolve(declContext, nameSpace, method);              {
     }                  CIMConstQualifier q = m2.getQualifier(posQualifier);
               }
     /** CIMMethod resolve */          </pre>
     void resolve(      */
         DeclContext* declContext,      CIMConstQualifier getQualifier(Uint32 index) const;
         const String& nameSpace)  
     {      /** Removes the specified qualifier from this method.
         _checkRep();          @param index Index of the qualifier to remove.
         _rep->resolve(declContext, nameSpace);          @exception IndexOutOfBoundsException Thrown if the index is
     }              outside the range of parameters available from the CIMMethod.
           <p><b>Example:</b>
     /** Returns zero if CIMMethod refers to a null pointer */          <pre>
     operator int() const              // remove all qualifiers from a class
     {              Uint32 count = 0;
         return _rep != 0;              while((count = cimClass.getQualifierCount()) > 0)
     }                  cimClass.removeQualifier(count - 1);
           </pre>
     /** method toXML - placing XML encoding of this object into out arguemnt. */      */
     void toXml(Array<Sint8>& out) const      void removeQualifier(Uint32 index);
     {  
         _checkRep();      /** Returns the number of Qualifiers attached to this CIMMethod object.
         _rep->toXml(out);          @return The number of qualifiers attached to the CIM Method.
     }          <p><b>Example:</b>
           <pre>
     /** method print - prints this method (in CIM encoded form). */              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const              m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
     {              m1.addQualifier(CIMQualifier(CIMName ("stuff2"), true));
         _checkRep();              assert(m1.getQualifierCount() == 2);
         _rep->print(o);          </pre>
     }      */
       Uint32 getQualifierCount() const;
     /** CIMMethod identical - Returns true if this method is identical to the  
         one given by the argument x.      /** Adds the parameter defined by the input to the CIMMethod.
           @param x CIMParameter to be added to the CIM Method.
           @return CIMMethod object after the specified parameter is added.
           <p><b>Example:</b>
           @exception UninitializedObjectException Thrown if the object is not
           initialized.
           @exception AlreadyExistsException Thrown if the parameter already
           exists in this CIMMethod.
           <pre>
               CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
               m1.addParameter(CIMParameter(CIMName ("ipaddress"), CIMTYPE_STRING));
           </pre>
       */
       CIMMethod& addParameter(const CIMParameter& x);
   
       /** Finds the parameter with the specified name.
           @param name CIMName of parameter to be found.
           @return Index of the parameter object found or PEG_NOT_FOUND
           if the property is not found.
           <p><b>Example:</b>
           <pre>
               Uint32 posParameter;
               posParameter = m1.findParameter(CIMName ("ipaddress"));
               if (posParameter != PEG_NOT_FOUND)
                   ...
           </pre>
       */
       Uint32 findParameter(const CIMName& name) const;
   
       /** Gets the parameter defined by the specified index.
           @param index Index for the parameter to be returned.
           @return CIMParameter object requested.
           @exception IndexOutOfBoundsException Thrown if the index is outside
               the range of available parameters.
           <p><b>Example:</b>
           <pre>
               CIMParameter cp;
               Uint32 parameterIndex = m1.findParameter(CIMName ("ipaddress"));
               if (parameterIndex != PEG_NOT_FOUND)
               {
                   cp = m1.getParameter(parameterIndex);
               }
           </pre>
       */
       CIMParameter getParameter(Uint32 index);
   
       /** Gets the parameter defined by the specified index.
           @param index Index for the parameter to be returned.
           @return CIMParameter object requested.
           @exception IndexOutOfBoundsException Thrown if the index is outside
               the range of available parameters.
           <p><b>Example:</b>
           <pre>
               CIMConstParameter cp;
               Uint32 parameterIndex = m1.findParameter(CIMName ("ipaddress"));
               if (parameterIndex != PEG_NOT_FOUND)
               {
                   cp = m1.getParameter(parameterIndex);
               }
           </pre>
       */
       CIMConstParameter getParameter(Uint32 index) const;
   
       /** Removes the parameter defined by the specified index.
           @param index Index of the parameter to be removed.
           @exception IndexOutOfBoundsException Thrown if the index is outside the
               range of parameters available from the CIMMethod.
       */
       void removeParameter (Uint32 index);
   
       /** Gets the count of Parameters defined in the CIMMethod.
           @return Count of the number of parameters attached to the CIMMethod.
       */
       Uint32 getParameterCount() const;
   
       /** Determines if the object has not been initialized.
           @return True if the object has not been initialized;
                   otherwise, false.
           <p><b>Example:</b>
           <pre>
               CIMMethod m1;
               assert(m1.isUninitialized());
           </pre>
        */
       Boolean isUninitialized() const;
   
       /** Compares with a CIMConstMethod.
           @param x CIMConstMethod object for the method to be compared.
           @return True if this method is identical to the one specified;
                   otherwise, false.
           <p><b>Example:</b>
           <pre>
               CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
               CIMConstMethod m2(CIMName ("test"), CIMTYPE_STRING);
               assert(!m1.identical(m2));
           </pre>
     */     */
     Boolean identical(const CIMConstMethod& x) const;     Boolean identical(const CIMConstMethod& x) const;
  
     /** CIMMethod clone - makes a distinct replica of this method */      /** Makes a clone (deep copy) of this method. This creates
     CIMMethod clone() const          a new copy of all of the components of the method including
     {          parameters and qualifiers.
         return CIMMethod(_rep->clone());          @return Independent copy of the CIMMethod object.
     }      */
       CIMMethod clone() const;
  
 private: private:
  
     CIMMethod(CIMMethodRep* rep) : _rep(rep)      CIMMethod(CIMMethodRep* rep);
     {  
     }  
  
       /** This method is not implemented.  It is defined to explicitly disallow
           construction of a CIMMethod from a CIMConstMethod.  Because the
           CIMMethod class uses a shared representation model, allowing this
           construction would effectively allow modification of CIMConstMethod
           objects.
       */
     PEGASUS_EXPLICIT CIMMethod(const CIMConstMethod& x);     PEGASUS_EXPLICIT CIMMethod(const CIMConstMethod& x);
  
     void _checkRep() const      void _checkRep() const;
     {  
         if (!_rep)  
             ThrowUnitializedHandle();  
     }  
  
     CIMMethodRep* _rep;     CIMMethodRep* _rep;
     friend class CIMConstMethod;     friend class CIMConstMethod;
     friend class CIMClassRep;      friend class Resolver;
       friend class XmlWriter;
       friend class MofWriter;
       friend class BinaryStreamer;
 }; };
  
   /** The CIMConstMethod class is used to represent CIM methods in the
       same manner as the CIMMethod class except that the const attribute
       is applied to the objects created. This class includes equivalents
       to the methods from CIMMethod that are available in a const object,
       including constructors, accessor methods, and the destructor.
   
       Because the CIMMethod class uses a shared representation model, allowing
       the construction of a 'CIMMethod' from a 'const CIMMethod' would
       effectively allow modification of a 'const CIMMethod'.  The CIMConstMethod
       class is used to represent constant CIMMethod objects.  Since a
       CIMConstMethod cannot be converted to a CIMMethod, its value remains
       constant.
   
       @see CIMMethod()
   */
 class PEGASUS_COMMON_LINKAGE CIMConstMethod class PEGASUS_COMMON_LINKAGE CIMConstMethod
 { {
 public: public:
  
     CIMConstMethod() : _rep(0)      /** Creates a new uninitialized CIMConstMethod object.
     {          The only thing that can be done with this object is to copy another
           object into it.  Other methods, such as getName, will fail with an
     }          UninitializedObjectException.  The object has an uninitialized state,
           which can be tested with the isUninitialized method.
     CIMConstMethod(const CIMConstMethod& x)          @see isUninitialized()
     {          @see UninitializedObjectException
         Inc(_rep = x._rep);      */
     }      CIMConstMethod();
   
     CIMConstMethod(const CIMMethod& x)      /** Creates a new CIMConstMethod object from another CIMConstMethod object.
     {          The new CIMConstMethod object references the same copy of data as the
         Inc(_rep = x._rep);          specified object; no copy is made.
     }          @param x CIMConstMethod object from which to create the new
           CIMConstMethod object.
     CIMConstMethod& operator=(const CIMConstMethod& x)          <p><b>Example:</b>
     {          <pre>
         if (x._rep != _rep)              CIMConstMethod cm1(CIMName ("getHostName"), CIMTYPE_STRING);
         {              CIMConstMethod cm2(m1);
             Dec(_rep);          </pre>
             Inc(_rep = x._rep);          {@link Shared Classes}
         }      */
         return *this;      CIMConstMethod(const CIMConstMethod& x);
     }  
       /** Creates a new CIMConstMethod object from a CIMMethod object.
     CIMConstMethod& operator=(const CIMMethod& x)          The new CIMConstMethod object references the same copy of data as the
     {          specified object; no copy is made.
         if (x._rep != _rep)          @param x CIMMethod object from which to create the new
         {          CIMConstMethod object.
             Dec(_rep);          <p><b>Example:</b>
             Inc(_rep = x._rep);          <pre>
         }              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
         return *this;              CIMConstMethod cm1(m1);
     }          </pre>
           {@link Shared Classes}
     // Throws IllegalName if name argument not legal CIM identifier.      */
       CIMConstMethod(const CIMMethod& x);
   
       /** Creates a CIMConstMethod object with the specified attributes.
           @param name CIMName defining the name for the method.
   
           @param type CIMType defining the method return type.
   
           @param classOrigin (optional) CIMName representing the class origin.
               Note that this should normally not be used.  If not provided set to
               CIMName() (Null name).
           @param propagated Optional flag indicating whether the definition of
               the CIM Method is local to the CIM Class (respectively, Instance)
               in which it appears, or was propagated without modification from
               a superclass. Default is false. Note that this attribute is
               normally not set by CIM Clients but is used internally within the
               CIM Server.
           <p><b>Example:</b>
           <pre>
               CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
           </pre>
       */
     CIMConstMethod(     CIMConstMethod(
         const String& name,          const CIMName& name,
         CIMType type,         CIMType type,
         const String& classOrigin = String(),          const CIMName& classOrigin = CIMName(),
         Boolean propagated = false)          Boolean propagated = false);
     {  
         _rep = new CIMMethodRep(name, type, classOrigin, propagated);  
     }  
   
     ~CIMConstMethod()  
     {  
         Dec(_rep);  
     }  
   
     const String& getName() const  
     {  
         _checkRep();  
         return _rep->getName();  
     }  
   
     CIMType getType() const  
     {  
         _checkRep();  
         return _rep->getType();  
     }  
   
     const String& getClassOrigin() const  
     {  
         _checkRep();  
         return _rep->getClassOrigin();  
     }  
  
     Boolean getPropagated() const      /** Destructor for the CIMConstMethod.  The shared data copy remains valid
     {          until all referring objects are destructed.
         _checkRep();          {@link Shared Classes}
         return _rep->getPropagated();      */
     }      ~CIMConstMethod();
   
     Uint32 findQualifier(const String& name) const      /** The assignment operator assigns one CIMConstMethod to another.
     {          After the assignment, both CIMConstMethod objects refer to the same
         _checkRep();          data copy; a distinct copy is not created.
         return _rep->findQualifier(name);          @param x CIMConstMethod object from which to assign this
     }          CIMConstMethod object.
   
     Uint32 getQualifier(Uint32 pos) const          <p><b>Example:</b>
     {          <pre>
         _checkRep();              CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
         return _rep->getQualifier(pos);              CIMConstMethod m2;
     }              m2 = m1;
           </pre>
     Uint32 getQualifierCount() const      */
     {      CIMConstMethod& operator=(const CIMConstMethod& x);
         _checkRep();  
         return _rep->getQualifierCount();      /** The assignment operator assigns a CIMMethod object to a
     }          CIMConstMethod.
           After the assignment, both objects refer to the same
     Uint32 findParameter(const String& name) const          data copy; a distinct copy is not created.
     {          @param x CIMConstMethod object from which to assign this
         _checkRep();          CIMConstMethod object.
         return _rep->findParameter(name);  
     }          <p><b>Example:</b>
           <pre>
     CIMConstParameter getParameter(Uint32 pos) const              CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     {              CIMConstMethod m2;
         _checkRep();              m2 = m1;
         return _rep->getParameter(pos);          </pre>
     }      */
       CIMConstMethod& operator=(const CIMMethod& x);
     Uint32 getParameterCount() const  
     {      /** Gets the name of the method.
         _checkRep();          @return CIMName with the name of the method.
         return _rep->getParameterCount();          <p><b>Example:</b>
     }          <pre>
               CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     operator int() const { return _rep != 0; }              assert(m1.getName() == CIMName ("getHostName"));
           </pre>
     void toXml(Array<Sint8>& out) const      */
     {      const CIMName& getName() const;
         _checkRep();  
         _rep->toXml(out);      /** Gets the method return type.
     }          @return A CIMType containing the method return type.
           @exception UninitializedObjectException Thrown if the object is not
     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const          initialized.
     {          <p><b>Example:</b>
         _checkRep();          <pre>
         _rep->print(o);              CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
     }              assert(m1.getType() == CIMTYPE_STRING);
           </pre>
     Boolean identical(const CIMConstMethod& x) const      */
     {      CIMType getType() const;
         x._checkRep();  
         _checkRep();      /** Gets the class in which this method was defined. This information
         return _rep->identical(x._rep);          is normally available with methods that are part of a schema
     }          returned from a CIM Server.
           @return CIMName containing the classOrigin attribute.
       */
       const CIMName& getClassOrigin() const;
   
       /** Tests the propagated attribute of the object.  The propagated
           attribute indicates whether this method was propagated from a
           higher-level class.  Normally this attribute is set as part of
           defining a method in the context of a schema.  It is set in
           methods retrieved from a CIM Server.
           @return True if method is propagated; otherwise, false.
       */
       Boolean getPropagated() const;
   
       /** Searches for a qualifier with the specified input name.
           @param name CIMName of the qualifier to be found.
           @return Zero origin index of the qualifier found or PEG_NOT_FOUND
           if not found.
           @exception UninitializedObjectException Thrown if the object is not
           initialized.
           <p><b>Example:</b>
           <pre>
               CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
               m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
               CIMConstMethod m2(m1);
               assert(m2.findQualifier(CIMName ("stuff")) != PEG_NOT_FOUND);
           </pre>
       */
       Uint32 findQualifier(const CIMName& name) const;
   
       /** Gets the CIMQualifier defined by the input parameter.
           @param index Zero origin index of the qualifier requested.
           @return CIMQualifier object representing the qualifier found.
           @exception IndexOutOfBoundsException Thrown if the index is
           outside the range of parameters available from the CIMMethod.
           <p><b>Example:</b>
           <pre>
               CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
               m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
               CIMConstMethod m2(m1);
               Uint32 posQualifier = m2.findQualifier(CIMName ("stuff"));
               if (posQualifier != PEG_NOT_FOUND)
               {
                   CIMQualifier q = m2.getQualifier(posQualifier);
               }
           </pre>
       */
       CIMConstQualifier getQualifier(Uint32 index) const;
   
       /** Returns the number of Qualifiers attached to this CIMConstMethod
           object.
           @return The number of qualifiers attached to the CIM method.
           <p><b>Example:</b>
           <pre>
               CIMMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
               m1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
               m1.addQualifier(CIMQualifier(CIMName ("stuff2"), true));
               CIMConstMethod m2(m1);
               assert(m2.getQualifierCount() == 2);
           </pre>
       */
       Uint32 getQualifierCount() const;
   
       /** Finds the parameter with the specified name.
           @param name CIMName of parameter to be found.
           @return Index of the parameter object found or PEG_NOT_FOUND
           if the property is not found.
           <p><b>Example:</b>
           <pre>
               Uint32 posParameter;
               posParameter = m1.findParameter(CIMName ("ipaddress"));
               if (posParameter != PEG_NOT_FOUND)
                   ...
           </pre>
       */
       Uint32 findParameter(const CIMName& name) const;
   
       /** Gets the parameter defined by the specified index.
           @param index Index for the parameter to be returned.
           @return CIMConstParameter object requested.
           @exception IndexOutOfBoundsException Thrown if the index is outside
               the range of available parameters.
           <p><b>Example:</b>
           <pre>
               CIMConstParameter cp;
               Uint32 parameterIndex = m1.findParameter(CIMName ("ipaddress"));
               if (parameterIndex != PEG_NOT_FOUND)
               {
                   cp = m1.getParameter(parameterIndex);
               }
           </pre>
       */
       CIMConstParameter getParameter(Uint32 index) const;
   
       /** Gets the count of Parameters defined in the CIMMethod.
           @return Count of the number of parameters attached to the CIMMethod.
       */
       Uint32 getParameterCount() const;
   
       /** Determines if the object has not been initialized.
           @return True if the object has not been initialized;
                   otherwise, false.
           <p><b>Example:</b>
           <pre>
               CIMConstMethod m1;
               assert(m1.isUninitialized());
           </pre>
        */
       Boolean isUninitialized() const;
   
       /** Compares with a CIMConstMethod.
           @param x CIMConstMethod object for the method to be compared.
           @return True if this method is identical to the one specified;
                   otherwise, false.
           <p><b>Example:</b>
           <pre>
               CIMConstMethod m1(CIMName ("getHostName"), CIMTYPE_STRING);
               CIMConstMethod m2(CIMName ("test"), CIMTYPE_STRING);
               assert(!m1.identical(m2));
           </pre>
       */
       Boolean identical(const CIMConstMethod& x) const;
  
     CIMMethod clone() const      /** Makes a clone (deep copy) of this CIMConstMethod. This creates
     {          a new copy of all of the components of the method including
         return CIMMethod(_rep->clone());          parameters and qualifiers.
     }          @return Independent copy of the CIMConstMethod object.  Note that
           the copy is a non-constant CIMMethod.
       */
       CIMMethod clone() const;
  
 private: private:
  
     void _checkRep() const      void _checkRep() const;
     {  
         if (!_rep)  
             ThrowUnitializedHandle();  
     }  
  
     CIMMethodRep* _rep;     CIMMethodRep* _rep;
  
     friend class CIMMethod;     friend class CIMMethod;
     friend class CIMMethodRep;     friend class CIMMethodRep;
       friend class XmlWriter;
       friend class MofWriter;
 }; };
  
   #define PEGASUS_ARRAY_T CIMMethod
   # include <Pegasus/Common/ArrayInter.h>
   #undef PEGASUS_ARRAY_T
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* Pegasus_Method_h */ #endif /* Pegasus_Method_h */


Legend:
Removed from v.1.11  
changed lines
  Added in v.1.44

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2