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