(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.4 and 1.13

version 1.4, 2001/04/08 01:13:21 version 1.13, 2001/05/24 00:48:35
Line 1 
Line 1 
 //BEGIN_LICENSE  //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
 // //
Line 17 
Line 17 
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
 // //
 //END_LICENSE  //==============================================================================
 //BEGIN_HISTORY  
 // //
 // Author:  // Author: Mike Brasher (mbrasher@bmc.com)
 // //
 // $Log$  // Modified By:
 // Revision 1.4  2001/04/08 01:13:21  mike  
 // Changed "ConstCIM" to "CIMConst"  
 // //
 // Revision 1.2  2001/02/19 01:47:16  mike  //%/////////////////////////////////////////////////////////////////////////////
 // Renamed names of the form CIMConst to CIMConst.  
 //  
 // Revision 1.1  2001/02/18 18:39:06  mike  
 // new  
 //  
 // Revision 1.2  2001/02/18 03:56:01  mike  
 // Changed more class names (e.g., ConstClassDecl -> CIMConstClass)  
 //  
 // Revision 1.1  2001/02/16 02:07:06  mike  
 // Renamed many classes and headers (using new CIM prefixes).  
 //  
 // Revision 1.5  2001/02/16 00:34:17  mike  
 // added ATTN  
 //  
 // Revision 1.4  2001/02/06 17:04:03  karl  
 // add documentation  
 //  
 // Revision 1.3  2001/01/28 19:07:07  karl  
 // add DOC++ comments  
 //  
 // Revision 1.2  2001/01/15 04:31:44  mike  
 // worked on resolve scheme  
 //  
 // Revision 1.1.1.1  2001/01/14 19:52:57  mike  
 // Pegasus import  
 //  
 //  
 //END_HISTORY  
   
 /*  
  CIMMethod.h - This header file defines the method class.  
 */  
  
 #ifndef Pegasus_Method_h #ifndef Pegasus_Method_h
 #define Pegasus_Method_h #define Pegasus_Method_h
Line 68 
Line 33 
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   
 class CIMConstMethod; class CIMConstMethod;
  
 /** Class CIMMethod - This class defines the operations associated with /** Class CIMMethod - This class defines the operations associated with
 manipulation of the Pegasus implementation of the CIM CIMMethod.  Within this      manipulation of the Pegasus implementation of the CIM CIMMethod. Within
 class, methods are provides for creation, deletion, and manipulation of method      this class, methods are provides for creation, deletion, and manipulation
 declarations.      of method declarations.
  
       // ATTN: remove the classOrigin and propagated parameters.
 */ */
   
 class PEGASUS_COMMON_LINKAGE CIMMethod class PEGASUS_COMMON_LINKAGE CIMMethod
 { {
 public: public:
     /// Creates and instantiates a CIM method.  
       /** Creates and instantiates a CIM method. */
     CIMMethod() : _rep(0)     CIMMethod() : _rep(0)
     {     {
  
     }     }
   
     /** Creates and instantiates a CIM method from another method instance     /** Creates and instantiates a CIM method from another method instance
     @return pointer to the new method instance     @return pointer to the new method instance
     */     */
Line 93 
Line 59 
     {     {
         Inc(_rep = x._rep);         Inc(_rep = x._rep);
     }     }
     ///  
       /** Assignment operator */
     CIMMethod& operator=(const CIMMethod& x)     CIMMethod& operator=(const CIMMethod& x)
     {     {
         if (x._rep != _rep)         if (x._rep != _rep)
Line 104 
Line 71 
         return *this;         return *this;
     }     }
  
     // ATTN: remove the classOrigin and propagated parameters.  
   
     /**  Creates a CIM method with the specified name, type, and classOrigin     /**  Creates a CIM method with the specified name, type, and classOrigin
     @param name for the method     @param name for the method
     @param type ATTN     @param type ATTN
Line 122 
Line 87 
         _rep = new CIMMethodRep(name, type, classOrigin, propagated);         _rep = new CIMMethodRep(name, type, classOrigin, propagated);
     }     }
  
     /// CIMMethod desctructor      /** Desctructor. */
     ~CIMMethod()     ~CIMMethod()
     {     {
         Dec(_rep);         Dec(_rep);
     }     }
   
     /** CIMMethod getName - Gets the name of the method     /** CIMMethod getName - Gets the name of the method
     @return String with the name of the method     @return String with the name of the method
     */     */
Line 137 
Line 103 
     }     }
  
     /** CIMMethod setName - Set the method name     /** CIMMethod setName - Set the method name
     @parm name ATTN (make reference to name defintion here)          @param name
     @return Throws IllegalName if name argument not legal CIM identifier.          @exception IllegalName if name argument not legal CIM identifier.
     */     */
     void setName(const String& name)     void setName(const String& name)
     {     {
         _checkRep();         _checkRep();
         _rep->setName(name);         _rep->setName(name);
     }     }
   
     /** CIMMethod getType - gets the method type     /** CIMMethod getType - gets the method type
     @return The CIM method type for this method.     @return The CIM method type for this method.
     */     */
   
     CIMType getType() const     CIMType getType() const
     {     {
         _checkRep();         _checkRep();
         return _rep->getType();         return _rep->getType();
     }     }
   
     /** CIMMethod setType - Sets the method type to the specified CIM method     /** CIMMethod setType - Sets the method type to the specified CIM method
     type as defined in CIMType /Ref{TYPE}     type as defined in CIMType /Ref{TYPE}
     */     */
Line 162 
Line 129 
         _checkRep();         _checkRep();
         _rep->setType(type);         _rep->setType(type);
     }     }
   
     /** CIMMethod getClassOrigin - Returns the class in which this method     /** CIMMethod getClassOrigin - Returns the class in which this method
      was defined.      was defined.
     @return ATTN:     @return ATTN:
Line 171 
Line 139 
         _checkRep();         _checkRep();
         return _rep->getClassOrigin();         return _rep->getClassOrigin();
     }     }
     /** CIMMethod setClassOrigin - ATTN:  
     */      /** CIMMethod setClassOrigin - ATTN: */
     void setClassOrigin(const String& classOrigin)     void setClassOrigin(const String& classOrigin)
     {     {
         _checkRep();         _checkRep();
         _rep->setClassOrigin(classOrigin);         _rep->setClassOrigin(classOrigin);
     }     }
     /// method getPropagated - ATTN:  
       /** method getPropagated - ATTN: */
     Boolean getPropagated() const     Boolean getPropagated() const
     {     {
         _checkRep();         _checkRep();
         return _rep->getPropagated();         return _rep->getPropagated();
     }     }
     /// method setPropagated - ATTN:  
       /** method setPropagated - ATTN: */
     void setPropagated(Boolean propagated)     void setPropagated(Boolean propagated)
     {     {
         _checkRep();         _checkRep();
         _rep->setPropagated(propagated);         _rep->setPropagated(propagated);
     }     }
     /** CIMMethod addQualifier -  
     @parm CIMQualifier to add      /** CIMMethod addQualifier - Adds a Qualifier to the method object.
     @param CIMQualifier to be added     @param CIMQualifier to be added
     @return Throws AlreadyExists excetpion if the qualifier already exists in          @return Throws AlreadyExists excetpion if the qualifier already exists
     the method          in the method
     @exception  AlreadyExists exception of CIMQualifier already exists.          @exception AlreadyExists exception
     */     */
     CIMMethod& addQualifier(const CIMQualifier& x)     CIMMethod& addQualifier(const CIMQualifier& x)
     {     {
Line 203 
Line 173 
         _rep->addQualifier(x);         _rep->addQualifier(x);
         return *this;         return *this;
     }     }
     /** CIMMethod findQualifier - Finds the CIMQualifier named by the input string.  
     @param String defining the name of the parameter to be found      /** CIMMethod findQualifier - returns the position of the qualifier with
     @return Index to the parameter found or -1 if not found          the given name.
     The -1 must be converted to a Unit32 as follows:          @param name Name of qualifier to be found.
     <PRE>          @return index of the parameter if found; otherwise PEG_NOT_FOUND.
         Uint32 pos = myClass.findProperty("name");  
         if (pos == Uint32(-1))  
         {  
             // Not found!  
         }  
     </PRE>  
     */     */
     Uint32 findQualifier(const String& name)     Uint32 findQualifier(const String& name)
     {     {
         _checkRep();         _checkRep();
         return _rep->findQualifier(name);         return _rep->findQualifier(name);
     }     }
     /** CIMMethod findQualifier - Find the qualifier with the name defined on  
     input  
     @param String with the name of the parameter to be found.  
     @return - index to the qualifier found or -1 if no qualifier found.  
     */  
     Uint32 findQualifier(const String& name) const     Uint32 findQualifier(const String& name) const
     {     {
         _checkRep();         _checkRep();
         return _rep->findQualifier(name);         return _rep->findQualifier(name);
     }     }
     /** CIMMethod getQualifier - Gets the CIMQualifier defined by the index input  
     as a parameter.      /** existsQualifier - returns the position of the qualifier with
           the given name.
           @param name Name of qualifier to be found.
           @return index of the parameter if found; otherwise PEG_NOT_FOUND.
       */
       Boolean existsQualifier(const String& name)
       {
           _checkRep();
           return _rep->existsQualifier(name);
       }
   
       Boolean existsQualifier(const String& name) const
       {
           _checkRep();
           return _rep->existsQualifier(name);
       }
   
   
       /** CIMMethod getQualifier - Gets the CIMQualifier defined by the index
           input as a parameter.
     @param Index of the qualifier requested.     @param Index of the qualifier requested.
     @return CIMQualifier object or exception     @return CIMQualifier object or exception
     @exception OutOfBounds exception if the index is outside the range of     @exception OutOfBounds exception if the index is outside the range of
Line 248 
Line 227 
         _checkRep();         _checkRep();
         return _rep->getQualifier(pos);         return _rep->getQualifier(pos);
     }     }
     /** CIMMethod getQualifierCount - Returns count of the number of Qualifiers  
     attached to the CIMMethod      /** removeQualifier - Removes the CIMQualifier defined by the
           position input as a parameter.
           @param Position of the qualifier requested.
           @return CIMQualifier object or exception
           @exception OutOfBounds exception if the index is outside the range of
           parameters available from the CIMMethod.
       */
       void removeQualifier(Uint32 pos)
       {
           _checkRep();
           _rep->removeQualifier(pos);
       }
   
   
       /** CIMMethod getQualifierCount - Returns the number of Qualifiers attached
           to this method.
     @return integer representing number of Qualifiers.     @return integer representing number of Qualifiers.
     */     */
     Uint32 getQualifierCount() const     Uint32 getQualifierCount() const
Line 257 
Line 251 
         _checkRep();         _checkRep();
         return _rep->getQualifierCount();         return _rep->getQualifierCount();
     }     }
     /** CIMMethod addParameter - Adds the parameter defined by the input to the  
     CIMMethod      /** CIMMethod addParameter - Adds the parameter defined by the input
     Param - ATTN:          to the CIMMethod
     */     */
     CIMMethod& addParameter(const CIMParameter& x)     CIMMethod& addParameter(const CIMParameter& x)
     {     {
Line 267 
Line 261 
         _rep->addParameter(x);         _rep->addParameter(x);
         return *this;         return *this;
     }     }
     /// CIMMethod findParameter - ATTN:  
       /** CIMMethod findParameter - Finds the parameter whose name is given
           by the name parameter.
           @param name Name of parameter to be found.
           @return index of the parameter if found; otherwise PEG_NOT_FOUND.
       */
     Uint32 findParameter(const String& name)     Uint32 findParameter(const String& name)
     {     {
         _checkRep();         _checkRep();
         return _rep->findParameter(name);         return _rep->findParameter(name);
     }     }
  
     /** CIMMethod findParameter - Finds the parameter defined by the name input  
     and returns an index to the CIMParameter  
     @param String defining the parameter to be found  
     @return index to the parameter if found.  Returns -1 if parameter not  
     found  
     */  
      Uint32 findParameter(const String& name) const      Uint32 findParameter(const String& name) const
     {     {
         _checkRep();         _checkRep();
         return _rep->findParameter(name);         return _rep->findParameter(name);
     }     }
     /// CIMMethod getParameter - ATTN:  
       /** CIMMethod getParameter - ATTN: */
     CIMParameter getParameter(Uint32 pos)     CIMParameter getParameter(Uint32 pos)
     {     {
         _checkRep();         _checkRep();
Line 305 
Line 299 
         return _rep->getParameter(pos);         return _rep->getParameter(pos);
     }     }
  
     /** CIMMethod getParameterCount - Gets the count of the numbeer of Parameters      /** CIMMethod getParameterCount - Gets the count of the numbeer of
     attached to the CIMMethod.          Parameters attached to the CIMMethod.
     @retrun - count of the number of parameters attached to the CIMMethod.     @retrun - count of the number of parameters attached to the CIMMethod.
     */     */
     Uint32 getParameterCount() const     Uint32 getParameterCount() const
Line 314 
Line 308 
         _checkRep();         _checkRep();
         return _rep->getParameterCount();         return _rep->getParameterCount();
     }     }
     /// method resolve - ATTN:  
       /** method resolve - ATTN: */
     void resolve(     void resolve(
         DeclContext* declContext,         DeclContext* declContext,
         const String& nameSpace,         const String& nameSpace,
Line 323 
Line 318 
         _checkRep();         _checkRep();
         _rep->resolve(declContext, nameSpace, method);         _rep->resolve(declContext, nameSpace, method);
     }     }
     /// CIMMethod resolve  
       /** CIMMethod resolve */
     void resolve(     void resolve(
         DeclContext* declContext,         DeclContext* declContext,
         const String& nameSpace)         const String& nameSpace)
Line 331 
Line 327 
         _checkRep();         _checkRep();
         _rep->resolve(declContext, nameSpace);         _rep->resolve(declContext, nameSpace);
     }     }
     /// operator  
     operator int() const { return _rep != 0; }      /** Returns zero if CIMMethod refers to a null pointer */
     /// method toXML - ATTN:      operator int() const
       {
           return _rep != 0;
       }
   
       /** method toXML - placing XML encoding of this object into out arguemnt. */
     void toXml(Array<Sint8>& out) const     void toXml(Array<Sint8>& out) const
     {     {
         _checkRep();         _checkRep();
         _rep->toXml(out);         _rep->toXml(out);
     }     }
     /// method print - ATTN:  
     void print(std::ostream &o=std::cout) const      /** method print - prints this method (in CIM encoded form). */
       void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const
     {     {
         _checkRep();         _checkRep();
         _rep->print(o);         _rep->print(o);
     }     }
     /// CIMMethod identical - ATTN  
       /** CIMMethod identical - Returns true if this method is identical to the
           one given by the argument x.
       */
     Boolean identical(const CIMConstMethod& x) const;     Boolean identical(const CIMConstMethod& x) const;
     /// CIMMethod clone - ATTN  
       /** CIMMethod clone - makes a distinct replica of this method */
     CIMMethod clone() const     CIMMethod clone() const
     {     {
         return CIMMethod(_rep->clone());         return CIMMethod(_rep->clone());
Line 359 
Line 365 
     {     {
     }     }
  
     explicit CIMMethod(const CIMConstMethod& x);      PEGASUS_EXPLICIT CIMMethod(const CIMConstMethod& x);
  
     void _checkRep() const     void _checkRep() const
     {     {
         if (!_rep)         if (!_rep)
             throw UnitializedHandle();              ThrowUnitializedHandle();
     }     }
  
     CIMMethodRep* _rep;     CIMMethodRep* _rep;
Line 372 
Line 378 
     friend class CIMClassRep;     friend class CIMClassRep;
 }; };
  
 ////////////////////////////////////////////////////////////////////////////////  
 //  
 // CIMConstMethod  
 //  
 ////////////////////////////////////////////////////////////////////////////////  
   
 class PEGASUS_COMMON_LINKAGE CIMConstMethod class PEGASUS_COMMON_LINKAGE CIMConstMethod
 { {
 public: public:
Line 501 
Line 501 
         _rep->toXml(out);         _rep->toXml(out);
     }     }
  
     void print(std::ostream &o=std::cout) const      void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const
     {     {
         _checkRep();         _checkRep();
         _rep->print(o);         _rep->print(o);
Line 524 
Line 524 
     void _checkRep() const     void _checkRep() const
     {     {
         if (!_rep)         if (!_rep)
             throw UnitializedHandle();              ThrowUnitializedHandle();
     }     }
  
     CIMMethodRep* _rep;     CIMMethodRep* _rep;
Line 533 
Line 533 
     friend class CIMMethodRep;     friend class CIMMethodRep;
 }; };
  
   #define PEGASUS_ARRAY_T CIMMethod
   # include "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.4  
changed lines
  Added in v.1.13

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2