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

  1 mike  1.17 //%/////////////////////////////////////////////////////////////////////////////
  2            //
  3 kumpf 1.25 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4            // The Open Group, Tivoli Systems
  5 mike  1.17 //
  6            // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 kumpf 1.25 // of this software and associated documentation files (the "Software"), to
  8            // deal in the Software without restriction, including without limitation the
  9            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10 mike  1.17 // sell copies of the Software, and to permit persons to whom the Software is
 11            // furnished to do so, subject to the following conditions:
 12            // 
 13 kumpf 1.25 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mike  1.17 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16 kumpf 1.25 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19 mike  1.17 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21            //
 22            //==============================================================================
 23            //
 24            // Author: Mike Brasher (mbrasher@bmc.com)
 25            //
 26 kumpf 1.20 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 27 kumpf 1.27 //              Carol Ann Krug Graves, Hewlett-Packard Company
 28            //                (carolann_graves@hp.com)
 29 mike  1.17 //
 30            //%/////////////////////////////////////////////////////////////////////////////
 31            
 32            #ifndef Pegasus_Method_h
 33            #define Pegasus_Method_h
 34            
 35            #include <Pegasus/Common/Config.h>
 36 kumpf 1.20 #include <Pegasus/Common/String.h>
 37            #include <Pegasus/Common/CIMParameter.h>
 38            #include <Pegasus/Common/CIMQualifier.h>
 39            #include <Pegasus/Common/CIMType.h>
 40 mday  1.35.2.1 #include <Pegasus/Common/Linkage.h>
 41 mike  1.17     
 42                PEGASUS_NAMESPACE_BEGIN
 43                
 44 kumpf 1.28     class Resolver;
 45 mike  1.17     class CIMConstMethod;
 46 kumpf 1.20     class CIMMethodRep;
 47 mike  1.17     
 48 kumpf 1.26         // ATTN: remove the classOrigin and propagated parameters.
 49 mike  1.17     /** Class CIMMethod - This class defines the operations associated with
 50                    manipulation of the Pegasus implementation of the CIM CIMMethod. Within
 51                    this class, methods are provides for creation, deletion, and manipulation
 52                    of method declarations.
 53                */
 54                class PEGASUS_COMMON_LINKAGE CIMMethod
 55                {
 56                public:
 57                
 58                    /** Creates and instantiates a CIM method. */
 59 kumpf 1.20         CIMMethod();
 60 mike  1.17     
 61                    /** Creates and instantiates a CIM method from another method instance
 62                	@return pointer to the new method instance
 63                    */
 64 kumpf 1.20         CIMMethod(const CIMMethod& x);
 65 mike  1.17     
 66 mike  1.18         /**	Creates a CIM method with the specified name, type, and classOrigin
 67 mike  1.17     	@param name for the method
 68 kumpf 1.26     	@param type CIM data type of method to create
 69 mike  1.17     	@param classOrigin
 70                	@param propagated
 71 mday  1.35.2.1 	@return Throws IllegalName if name argument not legal CIM identifier.
 72 mike  1.17         */
 73                    CIMMethod(
 74 mday  1.35.2.1 	const String& name,
 75 mike  1.17     	CIMType type,
 76 mday  1.35.2.1 	const String& classOrigin = String::EMPTY,
 77 kumpf 1.20     	Boolean propagated = false);
 78 mike  1.17     
 79                    /** Desctructor. */
 80 kumpf 1.20         ~CIMMethod();
 81                
 82                    /** Assignment operator */
 83                    CIMMethod& operator=(const CIMMethod& x);
 84 mike  1.17     
 85 mike  1.18         /** getName - Gets the name of the method
 86 mday  1.35.2.1 	@return String with the name of the method
 87 mike  1.17         */
 88 mday  1.35.2.1     const String& getName() const;
 89 mike  1.17     
 90 mike  1.18         /** setName - Set the method name
 91 mike  1.17     	@param name
 92 mday  1.35.2.1 	@exception IllegalName if name argument not legal CIM identifier.
 93 mike  1.17         */
 94 mday  1.35.2.1     void setName(const String& name);
 95 mike  1.17     
 96 mike  1.18         /** getType - gets the method type
 97 mike  1.17     	@return The CIM method type for this method.
 98                    */
 99 kumpf 1.20         CIMType getType() const;
100 mike  1.17     
101 mike  1.18         /** setType - Sets the method type to the specified CIM method
102 mike  1.17     	type as defined in CIMType /Ref{TYPE}
103                    */
104 kumpf 1.20         void setType(CIMType type);
105 mike  1.17     
106 mike  1.18         /** getClassOrigin - Returns the class in which this method
107 mike  1.17     	was defined.
108 mday  1.35.2.1 	@return String containing the classOrigin field. 
109 mike  1.17         */
110 mday  1.35.2.1     const String& getClassOrigin() const;
111 mike  1.17     
112 karl  1.19         /** setClassOrigin - Set the ClassOrigin attribute with
113 kumpf 1.20     	the classname defined on input
114 mday  1.35.2.1 	@param classOrigin - String parameter defining the name
115 kumpf 1.20     	of the class origin
116                    */
117 mday  1.35.2.1     void setClassOrigin(const String& classOrigin);
118 mike  1.17     
119 mday  1.35.2.1     /** getPropagated - Tests the propogated qualifier
120                        @return - returns True if method is propogated
121 kumpf 1.20         */
122                    Boolean getPropagated() const;
123 mike  1.17     
124 mike  1.18         /** setPropagated - Sets the Propagaged Qualifier */
125 kumpf 1.20         void setPropagated(Boolean propagated);
126 mike  1.17     
127 mike  1.18         /** addQualifier - Adds a Qualifier to the method object.
128 mike  1.17     	@param CIMQualifier to be added
129 mday  1.35.2.1 	@return Throws AlreadyExists excetpion if the qualifier already exists
130                	in the method
131                	@exception AlreadyExists exception
132 mike  1.17         */
133 kumpf 1.20         CIMMethod& addQualifier(const CIMQualifier& x);
134 mike  1.17     
135 mday  1.35.2.1     /** findQualifier - returns the position of the qualifier with
136 mike  1.17     	the given name.
137                	@param name Name of qualifier to be found.
138                	@return index of the parameter if found; otherwise PEG_NOT_FOUND.
139                    */
140 mday  1.35.2.1     Uint32 findQualifier(const String& name) const;
141 mike  1.17     
142 mike  1.18         /** getQualifier - Gets the CIMQualifier defined by the index
143 mike  1.17     	input as a parameter.
144 mday  1.35.2.1 	@param Index of the qualifier requested.
145 mike  1.17     	@return CIMQualifier object or exception
146 mday  1.35.2.1 	@exception OutOfBounds exception if the index is outside the range of
147                	parameters available from the CIMMethod.
148 mike  1.17         */
149 mday  1.35.2.1     CIMQualifier getQualifier(Uint32 pos);
150 kumpf 1.20     
151 mday  1.35.2.1     CIMConstQualifier getQualifier(Uint32 pos) const;
152 mike  1.17     
153 mday  1.35.2.1     /** removeQualifier - Removes the CIMQualifier defined by the
154                	position input as a parameter.
155                	@param Position of the qualifier requested.
156 mike  1.17     	@return CIMQualifier object or exception
157 mday  1.35.2.1 	@exception OutOfBounds exception if the index is outside the range of
158                	parameters available from the CIMMethod.
159 mike  1.17         */
160 mday  1.35.2.1     void removeQualifier(Uint32 pos);
161 mike  1.17     
162 mike  1.18         /** getQualifierCount - Returns the number of Qualifiers attached
163 kumpf 1.20     	to this CIMMethod object.
164 mike  1.17     	@return integer representing number of Qualifiers.
165                    */
166 kumpf 1.20         Uint32 getQualifierCount() const;
167 mike  1.17     
168 mike  1.18         /** addParameter - Adds the parameter defined by the input
169 mike  1.17     	to the CIMMethod
170                    */
171 kumpf 1.20         CIMMethod& addParameter(const CIMParameter& x);
172 mike  1.17     
173 mike  1.18         /** findParameter - Finds the parameter whose name is given
174 mike  1.17     	by the name parameter.
175                	@param name Name of parameter to be found.
176                	@return index of the parameter if found; otherwise PEG_NOT_FOUND.
177                    */
178 mday  1.35.2.1     Uint32 findParameter(const String& name) const;
179 mike  1.17     
180 mike  1.18         /** getParameter - Gets the parameter defined by the index
181 mike  1.17     	input as a parameter.
182                	@param index for the parameter to be returned.
183                	@return CIMParameter requested.
184 mday  1.35.2.1 	@Exception OutOfBounds exception is thrown if the index is outside the
185                	range of available parameters
186 mike  1.17         */
187 mday  1.35.2.1     CIMParameter getParameter(Uint32 pos);
188 kumpf 1.26     
189                    /** getParameter - const form */
190 mday  1.35.2.1     CIMConstParameter getParameter(Uint32 pos) const;
191 mike  1.17     
192 mike  1.18         /** getParameterCount - Gets the count of the numbeer of
193 mike  1.17     	Parameters attached to the CIMMethod.
194                	@retrun - count of the number of parameters attached to the CIMMethod.
195                    */
196 kumpf 1.20         Uint32 getParameterCount() const;
197 mike  1.17     
198 mday  1.35.2.1 #ifdef PEGASUS_INTERNALONLY
199                    /** Returns true if CIMMethod refers to a null pointer */
200                    Boolean isNull() const;
201                #endif
202 mike  1.17     
203 mike  1.18         /** identical - Returns true if this method is identical to the
204 mike  1.17     	one given by the argument x.
205                    */
206                    Boolean identical(const CIMConstMethod& x) const;
207                
208                    /** CIMMethod clone - makes a distinct replica of this method */
209 kumpf 1.20         CIMMethod clone() const;
210 mike  1.17     
211                private:
212                
213 kumpf 1.20         CIMMethod(CIMMethodRep* rep);
214 mike  1.17     
215                    PEGASUS_EXPLICIT CIMMethod(const CIMConstMethod& x);
216                
217 kumpf 1.20         void _checkRep() const;
218 mike  1.17     
219                    CIMMethodRep* _rep;
220                    friend class CIMConstMethod;
221 kumpf 1.28         friend class Resolver;
222 kumpf 1.22         friend class XmlWriter;
223 kumpf 1.23         friend class MofWriter;
224 mike  1.17     };
225                
226                class PEGASUS_COMMON_LINKAGE CIMConstMethod
227                {
228                public:
229                
230 kumpf 1.20         CIMConstMethod();
231 mike  1.17     
232 kumpf 1.20         CIMConstMethod(const CIMConstMethod& x);
233 mike  1.17     
234 kumpf 1.20         CIMConstMethod(const CIMMethod& x);
235 mike  1.17     
236 mday  1.35.2.1     // Throws IllegalName if name argument not legal CIM identifier.
237 mike  1.17         CIMConstMethod(
238 mday  1.35.2.1 	const String& name,
239 mike  1.17     	CIMType type,
240 mday  1.35.2.1 	const String& classOrigin = String::EMPTY,
241 kumpf 1.20     	Boolean propagated = false);
242                
243                    ~CIMConstMethod();
244                
245                    CIMConstMethod& operator=(const CIMConstMethod& x);
246                
247                    CIMConstMethod& operator=(const CIMMethod& x);
248                
249 mday  1.35.2.1     const String& getName() const;
250 kumpf 1.20     
251                    CIMType getType() const;
252                
253 mday  1.35.2.1     const String& getClassOrigin() const;
254 kumpf 1.20     
255                    Boolean getPropagated() const;
256                
257 mday  1.35.2.1     Uint32 findQualifier(const String& name) const;
258 kumpf 1.20     
259 mday  1.35.2.1     CIMConstQualifier getQualifier(Uint32 pos) const;
260 kumpf 1.20     
261                    Uint32 getQualifierCount() const;
262                
263 mday  1.35.2.1     Uint32 findParameter(const String& name) const;
264 kumpf 1.20     
265 mday  1.35.2.1     CIMConstParameter getParameter(Uint32 pos) const;
266 kumpf 1.20     
267                    Uint32 getParameterCount() const;
268                
269 mday  1.35.2.1 #ifdef PEGASUS_INTERNALONLY
270                    Boolean isNull() const;
271                #endif
272 kumpf 1.20     
273                    Boolean identical(const CIMConstMethod& x) const;
274                
275                    CIMMethod clone() const;
276 mike  1.17     
277                private:
278                
279 kumpf 1.20         void _checkRep() const;
280 mike  1.17     
281                    CIMMethodRep* _rep;
282                
283                    friend class CIMMethod;
284                    friend class CIMMethodRep;
285 kumpf 1.22         friend class XmlWriter;
286 kumpf 1.23         friend class MofWriter;
287 mike  1.17     };
288                
289                #define PEGASUS_ARRAY_T CIMMethod
290 kumpf 1.24     # include <Pegasus/Common/ArrayInter.h>
291 mike  1.17     #undef PEGASUS_ARRAY_T
292                
293                PEGASUS_NAMESPACE_END
294                
295                #endif /* Pegasus_Method_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2