version 1.20, 2002/05/06 23:21:58
|
version 1.37, 2003/10/22 14:26:02
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2003//////////////////////////////////////////////////////////////////////// |
// | // |
// 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. |
// | // |
// 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 |
|
|
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) | // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#define Pegasus_Method_h | #define Pegasus_Method_h |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
|
#include <Pegasus/Common/Linkage.h> |
#include <Pegasus/Common/String.h> | #include <Pegasus/Common/String.h> |
|
#include <Pegasus/Common/CIMName.h> |
#include <Pegasus/Common/CIMParameter.h> | #include <Pegasus/Common/CIMParameter.h> |
#include <Pegasus/Common/CIMQualifier.h> | #include <Pegasus/Common/CIMQualifier.h> |
#include <Pegasus/Common/CIMType.h> | #include <Pegasus/Common/CIMType.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class DeclContext; |
class Resolver; |
class CIMConstMethod; | class CIMConstMethod; |
class CIMMethodRep; | 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 |
|
this class, methods are provides for creation, deletion, and manipulation |
|
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 a new CIMMethod object. */ |
CIMMethod(); | CIMMethod(); |
| |
/** Creates and instantiates a CIM method from another method instance |
/** Creates a new CIMMethod object from another method instance. |
@return pointer to the new method instance |
@param x - CIMMethod instance from which to create CIMMethod object. |
*/ | */ |
CIMMethod(const CIMMethod& x); | CIMMethod(const CIMMethod& x); |
| |
/** Creates a CIM method with the specified name, type, and classOrigin |
/** Creates a CIMMethod with the specified name, type, and classOrigin. |
@param name for the method |
@param name - CIMName representing the name for the method. |
@param type ATTN |
@param type - CIMType representing data type of method to create. |
@param classOrigin |
@param classOrigin - CIMName representing the class origin. |
@param propagated |
@param propagated - Flag indicating whether the definition of the |
@return Throws IllegalName if name argument not legal CIM identifier. |
CIM Method is local to the CIM Class (respectively, Instance) in which |
|
it appears, or was propagated without modification from the underlying |
|
Subclass (respectively, Class). |
*/ | */ |
CIMMethod( | CIMMethod( |
const String& name, |
const CIMName& name, |
CIMType type, | CIMType type, |
const String& classOrigin = String::EMPTY, |
const CIMName& classOrigin = CIMName(), |
Boolean propagated = false); | Boolean propagated = false); |
| |
/** Desctructor. */ | /** Desctructor. */ |
|
|
/** Assignment operator */ | /** Assignment operator */ |
CIMMethod& operator=(const CIMMethod& x); | CIMMethod& operator=(const CIMMethod& x); |
| |
/** getName - Gets the name of the method |
/** Gets the name of the method. |
@return String with the name of the method |
@return CIMName with the name of the method. |
*/ | */ |
const String& getName() const; |
const CIMName& getName() const; |
| |
/** setName - Set the method name |
/** Sets the method name. |
@param name |
@param name - CIMName with method name. |
@exception IllegalName if name argument not legal CIM identifier. |
|
*/ | */ |
void setName(const String& name); |
void setName(const CIMName& name); |
| |
/** getType - gets the method type |
/** Gets the method type. |
@return The CIM method type for this method. |
@return The CIMType containing the method type for this method. |
*/ | */ |
CIMType getType() const; | CIMType getType() const; |
| |
/** setType - Sets the method type to the specified CIM method |
/** Sets the method type to the specified CIM method type |
type as defined in CIMType /Ref{TYPE} |
as defined in CIMType. |
*/ | */ |
void setType(CIMType type); | void setType(CIMType type); |
| |
/** getClassOrigin - Returns the class in which this method |
/** Gets the class in which this method was defined. |
was defined. |
@return CIMName containing the classOrigin field. |
@return String containing the classOrigin field. |
|
*/ | */ |
const String& getClassOrigin() const; |
const CIMName& getClassOrigin() const; |
| |
/** setClassOrigin - Set the ClassOrigin attribute with |
/** Sets the ClassOrigin attribute with the classname defined on |
the classname defined on input |
the input parameter. |
@param classOrigin - String parameter defining the name |
@param classOrigin - CIMName parameter defining the name |
of the class origin |
of the class origin. |
*/ | */ |
void setClassOrigin(const String& classOrigin); |
void setClassOrigin(const CIMName& classOrigin); |
| |
/** getPropagated - Tests the propogated qualifier |
/** Tests the propagated qualifier. |
@return - returns True if method is propogated |
@return true if method is propagated, false otherwise. |
*/ | */ |
Boolean getPropagated() const; | Boolean getPropagated() const; |
| |
/** setPropagated - Sets the Propagaged Qualifier */ |
/** Sets the Propagaged Qualifier |
|
@param propagated - Flag indicating propagation. |
|
*/ |
void setPropagated(Boolean propagated); | void setPropagated(Boolean propagated); |
| |
/** addQualifier - Adds a Qualifier to the method object. |
/** Adds the specified qualifier to the method and increments the |
@param CIMQualifier to be added |
qualifier count. |
@return Throws AlreadyExists excetpion if the qualifier already exists |
@param x - CIMQualifier object representing the qualifier |
in the method |
to be added. |
@exception AlreadyExists exception |
@return the CIMMethod object after adding the specified qualifier. |
|
@exception AlreadyExistsException if the qualifier already exists. |
*/ | */ |
CIMMethod& addQualifier(const CIMQualifier& x); | CIMMethod& addQualifier(const CIMQualifier& x); |
| |
/** findQualifier - returns the position of the qualifier with |
/** Searches for a qualifier with the specified input name. |
the given name. |
@param name - CIMName of the qualifier to be found. |
@param name Name of qualifier to be found. |
@return Index of the qualifier found or PEG_NOT_FOUND |
@return index of the parameter if found; otherwise PEG_NOT_FOUND. |
if not found. |
*/ |
*/ |
Uint32 findQualifier(const String& name) const; |
Uint32 findQualifier(const CIMName& name) const; |
|
|
/** existsQualifier - returns the position of the qualifier with |
/** Gets the CIMQualifier defined by the input parameter. |
the given name. |
@param index - Index of the qualifier requested. |
@param name Name of qualifier to be found. |
@return CIMQualifier object representing the qualifier found. |
@return index of the parameter if found; otherwise PEG_NOT_FOUND. |
@exception IndexOutOfBoundsException exception if the index is |
*/ |
outside the range of parameters available from the CIMMethod. |
Boolean existsQualifier(const String& name) const; |
*/ |
|
CIMQualifier getQualifier(Uint32 index); |
/** getQualifier - Gets the CIMQualifier defined by the index |
|
input as a parameter. |
/** Gets the CIMQualifier defined by the input parameter. |
@param Index of the qualifier requested. |
@param index - Index of the qualifier requested. |
@return CIMQualifier object or exception |
@return CIMConstQualifier object representing the qualifier found. |
@exception OutOfBounds exception if the index is outside the range of |
@exception IndexOutOfBoundsException exception if the index is |
parameters available from the CIMMethod. |
outside the range of parameters available from the CIMMethod. |
*/ |
*/ |
CIMQualifier getQualifier(Uint32 pos); |
CIMConstQualifier getQualifier(Uint32 index) const; |
|
|
CIMConstQualifier getQualifier(Uint32 pos) const; |
/** Removes the specified CIMQualifier from this method. |
|
@param index - Index of the qualifier to remove. |
/** removeQualifier - Removes the CIMQualifier defined by the |
@exception IndexOutOfBoundsException exception if the index is |
position input as a parameter. |
outside the range of parameters available from the CIMMethod. |
@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); |
|
|
|
/** getQualifierCount - Returns the number of Qualifiers attached |
|
to this CIMMethod object. |
|
@return integer representing number of Qualifiers. |
|
*/ | */ |
Uint32 getQualifierCount() const; |
void removeQualifier(Uint32 index); |
| |
/** addParameter - Adds the parameter defined by the input |
/** Returns the number of Qualifiers attached to this CIMMethod object. |
to the CIMMethod |
@return the number of qualifiers in the CIM Method. |
*/ | */ |
CIMMethod& addParameter(const CIMParameter& x); |
Uint32 getQualifierCount() const; |
|
|
/** 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) const; |
|
|
|
/** getParameter - ATTN: */ |
|
CIMParameter getParameter(Uint32 pos); |
|
|
|
/** getParameter - Gets the parameter defined by the index |
|
input as a parameter. |
|
@param index for the parameter to be returned. |
|
@return CIMParameter requested. |
|
@Exception OutOfBounds exception is thrown if the index is outside the |
|
range of available parameters |
|
*/ |
|
CIMConstParameter getParameter(Uint32 pos) const; |
|
|
|
/** getParameterCount - Gets the count of the numbeer of |
|
Parameters attached to the CIMMethod. |
|
@retrun - count of the number of parameters attached to the CIMMethod. |
|
*/ |
|
Uint32 getParameterCount() const; |
|
|
|
#ifdef PEGASUS_INTERNALONLY |
|
/** resolve - resolves and completes the CIMMethod */ |
|
void resolve( |
|
DeclContext* declContext, |
|
const String& nameSpace, |
|
const CIMConstMethod& method); |
|
|
|
/** resolve - Resolves and completes the CIMMethod */ |
|
void resolve( |
|
DeclContext* declContext, |
|
const String& nameSpace); |
|
|
|
/** Returns zero if CIMMethod refers to a null pointer */ |
|
operator int() const; |
|
#endif |
|
| |
/** toXML - puts XML encoding of this CIMMethod object into out |
/** Adds the parameter defined by the input to the CIMMethod. |
argument. |
@param x - CIMParameter to be added to the CIM Method. |
|
@return CIMMethod object after the specified parameter is added. |
*/ | */ |
void toXml(Array<Sint8>& out) const; |
CIMMethod& addParameter(const CIMParameter& x); |
| |
/** print - formats and prints this CIMmethod (in CIM XML encoded form). |
/** Finds the parameter with the specified name. |
|
@param name - Name of parameter to be found. |
|
@return Index of the parameter object found or PEG_NOT_FOUND |
|
if the property is not found. |
|
*/ |
|
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 if the index is outside |
|
the range of available parameters |
|
*/ |
|
CIMParameter getParameter(Uint32 index); |
|
|
|
/** Gets the parameter defined for the specified index. |
|
@param index - Index for the parameter to be returned. |
|
@return CIMConstParameter object requested. |
|
@exception IndexOutOfBoundsException if the index is outside |
|
the range of available parameters |
|
*/ |
|
CIMConstParameter getParameter(Uint32 index) const; |
|
|
|
/** Removes the CIMParameter defined by the specified index. |
|
@param index - Index of the parameter to be removed. |
|
@exception IndexOutOfBoundsException if the index is outside the |
|
range of parameters available from the CIMMethod. |
*/ | */ |
void print(PEGASUS_STD(ostream)& o=PEGASUS_STD(cout)) const; |
void removeParameter (Uint32 index); |
| |
/** toMof - puts MOF encoding of this object into out arguemnt. |
/** Gets the count of Parameters defined in the CIMMethod. |
|
@return - count of the number of parameters attached to the CIMMethod. |
*/ | */ |
void toMof(Array<Sint8>& out) const; |
Uint32 getParameterCount() const; |
| |
/** identical - Returns true if this method is identical to the |
/** Determines if the object has not been initialized. |
one given by the argument x. |
@return true if the object has not been initialized, |
|
false otherwise |
|
*/ |
|
Boolean isUninitialized() const; |
|
|
|
/** Compares with another CIMConstMethod. |
|
@param x - CIMConstMethod object for the method to be compared. |
|
@return true if this method is identical to the one specified. |
*/ | */ |
Boolean identical(const CIMConstMethod& x) const; | Boolean identical(const CIMConstMethod& x) const; |
| |
/** CIMMethod clone - makes a distinct replica of this method */ |
/** Makes a deep copy (clone) of this method. |
|
@return copy of the CIMMethod object. |
|
*/ |
CIMMethod clone() const; | CIMMethod clone() const; |
| |
private: | private: |
|
|
| |
CIMMethodRep* _rep; | CIMMethodRep* _rep; |
friend class CIMConstMethod; | friend class CIMConstMethod; |
|
friend class Resolver; |
|
friend class XmlWriter; |
|
friend class MofWriter; |
}; | }; |
| |
|
/// |
class PEGASUS_COMMON_LINKAGE CIMConstMethod | class PEGASUS_COMMON_LINKAGE CIMConstMethod |
{ | { |
public: | public: |
| |
|
/// |
CIMConstMethod(); | CIMConstMethod(); |
| |
|
/// |
CIMConstMethod(const CIMConstMethod& x); | CIMConstMethod(const CIMConstMethod& x); |
| |
|
/// |
CIMConstMethod(const CIMMethod& x); | CIMConstMethod(const CIMMethod& x); |
| |
// Throws IllegalName if name argument not legal CIM identifier. |
/// |
CIMConstMethod( | CIMConstMethod( |
const String& name, |
const CIMName& name, |
CIMType type, | CIMType type, |
const String& classOrigin = String::EMPTY, |
const CIMName& classOrigin = CIMName(), |
Boolean propagated = false); | Boolean propagated = false); |
| |
|
/// |
~CIMConstMethod(); | ~CIMConstMethod(); |
| |
|
/// |
CIMConstMethod& operator=(const CIMConstMethod& x); | CIMConstMethod& operator=(const CIMConstMethod& x); |
| |
|
/// |
CIMConstMethod& operator=(const CIMMethod& x); | CIMConstMethod& operator=(const CIMMethod& x); |
| |
const String& getName() const; |
/// |
|
const CIMName& getName() const; |
| |
|
/// |
CIMType getType() const; | CIMType getType() const; |
| |
const String& getClassOrigin() const; |
/// |
|
const CIMName& getClassOrigin() const; |
| |
|
/// |
Boolean getPropagated() const; | Boolean getPropagated() const; |
| |
Uint32 findQualifier(const String& name) const; |
/// |
|
Uint32 findQualifier(const CIMName& name) const; |
| |
Uint32 getQualifier(Uint32 pos) const; |
/// |
|
CIMConstQualifier getQualifier(Uint32 index) const; |
| |
|
/// |
Uint32 getQualifierCount() const; | Uint32 getQualifierCount() const; |
| |
Uint32 findParameter(const String& name) const; |
/// |
|
Uint32 findParameter(const CIMName& name) const; |
| |
CIMConstParameter getParameter(Uint32 pos) const; |
/// |
|
CIMConstParameter getParameter(Uint32 index) const; |
| |
|
/// |
Uint32 getParameterCount() const; | Uint32 getParameterCount() const; |
| |
#ifdef PEGASUS_INTERNALONLY |
/// |
operator int() const; |
Boolean isUninitialized() const; |
|
|
void toXml(Array<Sint8>& out) const; |
|
|
|
void print(PEGASUS_STD(ostream)& o=PEGASUS_STD(cout)) const; |
|
#endif |
|
| |
|
/// |
Boolean identical(const CIMConstMethod& x) const; | Boolean identical(const CIMConstMethod& x) const; |
| |
|
/// |
CIMMethod clone() const; | CIMMethod clone() const; |
| |
private: | private: |
|
|
| |
friend class CIMMethod; | friend class CIMMethod; |
friend class CIMMethodRep; | friend class CIMMethodRep; |
|
friend class XmlWriter; |
|
friend class MofWriter; |
}; | }; |
| |
#define PEGASUS_ARRAY_T CIMMethod | #define PEGASUS_ARRAY_T CIMMethod |
# include "ArrayInter.h" |
# include <Pegasus/Common/ArrayInter.h> |
#undef PEGASUS_ARRAY_T | #undef PEGASUS_ARRAY_T |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |