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 mike 1.17
41 PEGASUS_NAMESPACE_BEGIN
42
|
43 kumpf 1.20 class DeclContext;
|
44 mike 1.17 class CIMConstMethod;
|
45 kumpf 1.20 class CIMMethodRep;
|
46 mike 1.17
|
47 kumpf 1.26 // ATTN: remove the classOrigin and propagated parameters.
|
48 mike 1.17 /** Class CIMMethod - This class defines the operations associated with
49 manipulation of the Pegasus implementation of the CIM CIMMethod. Within
50 this class, methods are provides for creation, deletion, and manipulation
51 of method declarations.
52 */
53 class PEGASUS_COMMON_LINKAGE CIMMethod
54 {
55 public:
56
57 /** Creates and instantiates a CIM method. */
|
58 kumpf 1.20 CIMMethod();
|
59 mike 1.17
60 /** Creates and instantiates a CIM method from another method instance
61 @return pointer to the new method instance
62 */
|
63 kumpf 1.20 CIMMethod(const CIMMethod& x);
|
64 mike 1.17
|
65 mike 1.18 /** Creates a CIM method with the specified name, type, and classOrigin
|
66 mike 1.17 @param name for the method
|
67 kumpf 1.26 @param type CIM data type of method to create
|
68 mike 1.17 @param classOrigin
69 @param propagated
|
70 kumpf 1.26 @return Throws IllegalName if name argument not legal CIM identifier.
|
71 mike 1.17 */
72 CIMMethod(
73 const String& name,
74 CIMType type,
|
75 kumpf 1.20 const String& classOrigin = String::EMPTY,
76 Boolean propagated = false);
|
77 mike 1.17
78 /** Desctructor. */
|
79 kumpf 1.20 ~CIMMethod();
80
81 /** Assignment operator */
82 CIMMethod& operator=(const CIMMethod& x);
|
83 mike 1.17
|
84 mike 1.18 /** getName - Gets the name of the method
|
85 mike 1.17 @return String with the name of the method
86 */
|
87 kumpf 1.20 const String& getName() const;
|
88 mike 1.17
|
89 mike 1.18 /** setName - Set the method name
|
90 mike 1.17 @param name
91 @exception IllegalName if name argument not legal CIM identifier.
92 */
|
93 kumpf 1.20 void setName(const String& name);
|
94 mike 1.17
|
95 mike 1.18 /** getType - gets the method type
|
96 mike 1.17 @return The CIM method type for this method.
97 */
|
98 kumpf 1.20 CIMType getType() const;
|
99 mike 1.17
|
100 mike 1.18 /** setType - Sets the method type to the specified CIM method
|
101 mike 1.17 type as defined in CIMType /Ref{TYPE}
102 */
|
103 kumpf 1.20 void setType(CIMType type);
|
104 mike 1.17
|
105 mike 1.18 /** getClassOrigin - Returns the class in which this method
|
106 mike 1.17 was defined.
|
107 karl 1.19 @return String containing the classOrigin field.
|
108 mike 1.17 */
|
109 kumpf 1.20 const String& getClassOrigin() const;
|
110 mike 1.17
|
111 karl 1.19 /** setClassOrigin - Set the ClassOrigin attribute with
|
112 kumpf 1.20 the classname defined on input
113 @param classOrigin - String parameter defining the name
114 of the class origin
115 */
116 void setClassOrigin(const String& classOrigin);
|
117 mike 1.17
|
118 mike 1.18 /** getPropagated - Tests the propogated qualifier
119 @return - returns True if method is propogated
|
120 kumpf 1.20 */
121 Boolean getPropagated() const;
|
122 mike 1.17
|
123 mike 1.18 /** setPropagated - Sets the Propagaged Qualifier */
|
124 kumpf 1.20 void setPropagated(Boolean propagated);
|
125 mike 1.17
|
126 mike 1.18 /** addQualifier - Adds a Qualifier to the method object.
|
127 mike 1.17 @param CIMQualifier to be added
128 @return Throws AlreadyExists excetpion if the qualifier already exists
129 in the method
130 @exception AlreadyExists exception
131 */
|
132 kumpf 1.20 CIMMethod& addQualifier(const CIMQualifier& x);
|
133 mike 1.17
|
134 mike 1.18 /** findQualifier - returns the position of the qualifier with
|
135 mike 1.17 the given name.
136 @param name Name of qualifier to be found.
137 @return index of the parameter if found; otherwise PEG_NOT_FOUND.
138 */
|
139 kumpf 1.20 Uint32 findQualifier(const String& name) const;
|
140 mike 1.17
|
141 mike 1.18 /** getQualifier - Gets the CIMQualifier defined by the index
|
142 mike 1.17 input as a parameter.
143 @param Index of the qualifier requested.
144 @return CIMQualifier object or exception
145 @exception OutOfBounds exception if the index is outside the range of
146 parameters available from the CIMMethod.
147 */
|
148 kumpf 1.20 CIMQualifier getQualifier(Uint32 pos);
149
150 CIMConstQualifier getQualifier(Uint32 pos) const;
|
151 mike 1.17
152 /** removeQualifier - Removes the CIMQualifier defined by the
153 position input as a parameter.
154 @param Position of the qualifier requested.
155 @return CIMQualifier object or exception
156 @exception OutOfBounds exception if the index is outside the range of
157 parameters available from the CIMMethod.
158 */
|
159 kumpf 1.20 void removeQualifier(Uint32 pos);
|
160 mike 1.17
|
161 mike 1.18 /** getQualifierCount - Returns the number of Qualifiers attached
|
162 kumpf 1.20 to this CIMMethod object.
|
163 mike 1.17 @return integer representing number of Qualifiers.
164 */
|
165 kumpf 1.20 Uint32 getQualifierCount() const;
|
166 mike 1.17
|
167 mike 1.18 /** addParameter - Adds the parameter defined by the input
|
168 mike 1.17 to the CIMMethod
169 */
|
170 kumpf 1.20 CIMMethod& addParameter(const CIMParameter& x);
|
171 mike 1.17
|
172 mike 1.18 /** findParameter - Finds the parameter whose name is given
|
173 mike 1.17 by the name parameter.
174 @param name Name of parameter to be found.
175 @return index of the parameter if found; otherwise PEG_NOT_FOUND.
176 */
|
177 kumpf 1.20 Uint32 findParameter(const String& name) const;
|
178 mike 1.17
|
179 mike 1.18 /** getParameter - Gets the parameter defined by the index
|
180 mike 1.17 input as a parameter.
181 @param index for the parameter to be returned.
182 @return CIMParameter requested.
183 @Exception OutOfBounds exception is thrown if the index is outside the
184 range of available parameters
185 */
|
186 kumpf 1.26 CIMParameter getParameter(Uint32 pos);
187
188 /** getParameter - const form */
|
189 kumpf 1.20 CIMConstParameter getParameter(Uint32 pos) const;
|
190 mike 1.17
|
191 mike 1.18 /** getParameterCount - Gets the count of the numbeer of
|
192 mike 1.17 Parameters attached to the CIMMethod.
193 @retrun - count of the number of parameters attached to the CIMMethod.
194 */
|
195 kumpf 1.20 Uint32 getParameterCount() const;
|
196 mike 1.17
|
197 kumpf 1.20 #ifdef PEGASUS_INTERNALONLY
|
198 mike 1.18 /** resolve - resolves and completes the CIMMethod */
|
199 mike 1.17 void resolve(
200 DeclContext* declContext,
201 const String& nameSpace,
|
202 kumpf 1.20 const CIMConstMethod& method);
|
203 mike 1.17
|
204 mike 1.18 /** resolve - Resolves and completes the CIMMethod */
|
205 mike 1.17 void resolve(
206 DeclContext* declContext,
|
207 kumpf 1.20 const String& nameSpace);
|
208 mike 1.17
|
209 kumpf 1.21 /** Returns true if CIMMethod refers to a null pointer */
210 Boolean isNull() const;
|
211 kumpf 1.20 #endif
|
212 mike 1.17
|
213 mike 1.18 /** identical - Returns true if this method is identical to the
|
214 mike 1.17 one given by the argument x.
215 */
216 Boolean identical(const CIMConstMethod& x) const;
217
218 /** CIMMethod clone - makes a distinct replica of this method */
|
219 kumpf 1.20 CIMMethod clone() const;
|
220 mike 1.17
221 private:
222
|
223 kumpf 1.20 CIMMethod(CIMMethodRep* rep);
|
224 mike 1.17
225 PEGASUS_EXPLICIT CIMMethod(const CIMConstMethod& x);
226
|
227 kumpf 1.20 void _checkRep() const;
|
228 mike 1.17
229 CIMMethodRep* _rep;
230 friend class CIMConstMethod;
|
231 kumpf 1.22 friend class XmlWriter;
|
232 kumpf 1.23 friend class MofWriter;
|
233 mike 1.17 };
234
235 class PEGASUS_COMMON_LINKAGE CIMConstMethod
236 {
237 public:
238
|
239 kumpf 1.20 CIMConstMethod();
|
240 mike 1.17
|
241 kumpf 1.20 CIMConstMethod(const CIMConstMethod& x);
|
242 mike 1.17
|
243 kumpf 1.20 CIMConstMethod(const CIMMethod& x);
|
244 mike 1.17
245 // Throws IllegalName if name argument not legal CIM identifier.
246 CIMConstMethod(
247 const String& name,
248 CIMType type,
|
249 kumpf 1.20 const String& classOrigin = String::EMPTY,
250 Boolean propagated = false);
251
252 ~CIMConstMethod();
253
254 CIMConstMethod& operator=(const CIMConstMethod& x);
255
256 CIMConstMethod& operator=(const CIMMethod& x);
257
258 const String& getName() const;
259
260 CIMType getType() const;
261
262 const String& getClassOrigin() const;
263
264 Boolean getPropagated() const;
265
266 Uint32 findQualifier(const String& name) const;
267
|
268 kumpf 1.21 CIMConstQualifier getQualifier(Uint32 pos) const;
|
269 kumpf 1.20
270 Uint32 getQualifierCount() const;
271
272 Uint32 findParameter(const String& name) const;
273
274 CIMConstParameter getParameter(Uint32 pos) const;
275
276 Uint32 getParameterCount() const;
277
278 #ifdef PEGASUS_INTERNALONLY
|
279 kumpf 1.21 Boolean isNull() const;
|
280 kumpf 1.20 #endif
281
282 Boolean identical(const CIMConstMethod& x) const;
283
284 CIMMethod clone() const;
|
285 mike 1.17
286 private:
287
|
288 kumpf 1.20 void _checkRep() const;
|
289 mike 1.17
290 CIMMethodRep* _rep;
291
292 friend class CIMMethod;
293 friend class CIMMethodRep;
|
294 kumpf 1.22 friend class XmlWriter;
|
295 kumpf 1.23 friend class MofWriter;
|
296 mike 1.17 };
297
298 #define PEGASUS_ARRAY_T CIMMethod
|
299 kumpf 1.24 # include <Pegasus/Common/ArrayInter.h>
|
300 mike 1.17 #undef PEGASUS_ARRAY_T
301
302 PEGASUS_NAMESPACE_END
303
304 #endif /* Pegasus_Method_h */
|