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.28 class Resolver;
|
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 kumpf 1.21 /** Returns true if CIMMethod refers to a null pointer */
199 Boolean isNull() const;
|
200 kumpf 1.20 #endif
|
201 mike 1.17
|
202 mike 1.18 /** identical - Returns true if this method is identical to the
|
203 mike 1.17 one given by the argument x.
204 */
205 Boolean identical(const CIMConstMethod& x) const;
206
207 /** CIMMethod clone - makes a distinct replica of this method */
|
208 kumpf 1.20 CIMMethod clone() const;
|
209 mike 1.17
210 private:
211
|
212 kumpf 1.20 CIMMethod(CIMMethodRep* rep);
|
213 mike 1.17
214 PEGASUS_EXPLICIT CIMMethod(const CIMConstMethod& x);
215
|
216 kumpf 1.20 void _checkRep() const;
|
217 mike 1.17
218 CIMMethodRep* _rep;
219 friend class CIMConstMethod;
|
220 kumpf 1.28 friend class Resolver;
|
221 kumpf 1.22 friend class XmlWriter;
|
222 kumpf 1.23 friend class MofWriter;
|
223 mike 1.17 };
224
225 class PEGASUS_COMMON_LINKAGE CIMConstMethod
226 {
227 public:
228
|
229 kumpf 1.20 CIMConstMethod();
|
230 mike 1.17
|
231 kumpf 1.20 CIMConstMethod(const CIMConstMethod& x);
|
232 mike 1.17
|
233 kumpf 1.20 CIMConstMethod(const CIMMethod& x);
|
234 mike 1.17
235 // Throws IllegalName if name argument not legal CIM identifier.
236 CIMConstMethod(
237 const String& name,
238 CIMType type,
|
239 kumpf 1.20 const String& classOrigin = String::EMPTY,
240 Boolean propagated = false);
241
242 ~CIMConstMethod();
243
244 CIMConstMethod& operator=(const CIMConstMethod& x);
245
246 CIMConstMethod& operator=(const CIMMethod& x);
247
248 const String& getName() const;
249
250 CIMType getType() const;
251
252 const String& getClassOrigin() const;
253
254 Boolean getPropagated() const;
255
256 Uint32 findQualifier(const String& name) const;
257
|
258 kumpf 1.21 CIMConstQualifier getQualifier(Uint32 pos) const;
|
259 kumpf 1.20
260 Uint32 getQualifierCount() const;
261
262 Uint32 findParameter(const String& name) const;
263
264 CIMConstParameter getParameter(Uint32 pos) const;
265
266 Uint32 getParameterCount() const;
267
268 #ifdef PEGASUS_INTERNALONLY
|
269 kumpf 1.21 Boolean isNull() const;
|
270 kumpf 1.20 #endif
271
272 Boolean identical(const CIMConstMethod& x) const;
273
274 CIMMethod clone() const;
|
275 mike 1.17
276 private:
277
|
278 kumpf 1.20 void _checkRep() const;
|
279 mike 1.17
280 CIMMethodRep* _rep;
281
282 friend class CIMMethod;
283 friend class CIMMethodRep;
|
284 kumpf 1.22 friend class XmlWriter;
|
285 kumpf 1.23 friend class MofWriter;
|
286 mike 1.17 };
287
288 #define PEGASUS_ARRAY_T CIMMethod
|
289 kumpf 1.24 # include <Pegasus/Common/ArrayInter.h>
|
290 mike 1.17 #undef PEGASUS_ARRAY_T
291
292 PEGASUS_NAMESPACE_END
293
294 #endif /* Pegasus_Method_h */
|