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.30 #include <Pegasus/Common/Linkage.h>
|
37 kumpf 1.20 #include <Pegasus/Common/String.h>
|
38 kumpf 1.30 #include <Pegasus/Common/CIMName.h>
|
39 kumpf 1.20 #include <Pegasus/Common/CIMParameter.h>
40 #include <Pegasus/Common/CIMQualifier.h>
41 #include <Pegasus/Common/CIMType.h>
|
42 mike 1.17
43 PEGASUS_NAMESPACE_BEGIN
44
|
45 kumpf 1.28 class Resolver;
|
46 mike 1.17 class CIMConstMethod;
|
47 kumpf 1.20 class CIMMethodRep;
|
48 mike 1.17
|
49 kumpf 1.26 // ATTN: remove the classOrigin and propagated parameters.
|
50 mike 1.17 /** Class CIMMethod - This class defines the operations associated with
51 manipulation of the Pegasus implementation of the CIM CIMMethod. Within
52 this class, methods are provides for creation, deletion, and manipulation
53 of method declarations.
54 */
55 class PEGASUS_COMMON_LINKAGE CIMMethod
56 {
57 public:
58
59 /** Creates and instantiates a CIM method. */
|
60 kumpf 1.20 CIMMethod();
|
61 mike 1.17
62 /** Creates and instantiates a CIM method from another method instance
63 @return pointer to the new method instance
64 */
|
65 kumpf 1.20 CIMMethod(const CIMMethod& x);
|
66 mike 1.17
|
67 mike 1.18 /** Creates a CIM method with the specified name, type, and classOrigin
|
68 mike 1.17 @param name for the method
|
69 kumpf 1.26 @param type CIM data type of method to create
|
70 mike 1.17 @param classOrigin
71 @param propagated
72 */
73 CIMMethod(
|
74 kumpf 1.30 const CIMName& name,
|
75 mike 1.17 CIMType type,
|
76 kumpf 1.30 const CIMName& classOrigin = CIMName(),
|
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 kumpf 1.30 @return CIMName with the name of the method
|
87 mike 1.17 */
|
88 kumpf 1.30 const CIMName& getName() const;
|
89 mike 1.17
|
90 mike 1.18 /** setName - Set the method name
|
91 mike 1.17 @param name
92 */
|
93 kumpf 1.30 void setName(const CIMName& 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 kumpf 1.30 @return CIMName containing the classOrigin field.
|
108 mike 1.17 */
|
109 kumpf 1.30 const CIMName& 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 kumpf 1.30 @param classOrigin - CIMName parameter defining the name
|
114 kumpf 1.20 of the class origin
115 */
|
116 kumpf 1.30 void setClassOrigin(const CIMName& 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.30 Uint32 findQualifier(const CIMName& 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.30 Uint32 findParameter(const CIMName& 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 CIMConstMethod(
|
236 kumpf 1.30 const CIMName& name,
|
237 mike 1.17 CIMType type,
|
238 kumpf 1.30 const CIMName& classOrigin = CIMName(),
|
239 kumpf 1.20 Boolean propagated = false);
240
241 ~CIMConstMethod();
242
243 CIMConstMethod& operator=(const CIMConstMethod& x);
244
245 CIMConstMethod& operator=(const CIMMethod& x);
246
|
247 kumpf 1.30 const CIMName& getName() const;
|
248 kumpf 1.20
249 CIMType getType() const;
250
|
251 kumpf 1.30 const CIMName& getClassOrigin() const;
|
252 kumpf 1.20
253 Boolean getPropagated() const;
254
|
255 kumpf 1.30 Uint32 findQualifier(const CIMName& name) const;
|
256 kumpf 1.20
|
257 kumpf 1.21 CIMConstQualifier getQualifier(Uint32 pos) const;
|
258 kumpf 1.20
259 Uint32 getQualifierCount() const;
260
|
261 kumpf 1.30 Uint32 findParameter(const CIMName& name) const;
|
262 kumpf 1.20
263 CIMConstParameter getParameter(Uint32 pos) const;
264
265 Uint32 getParameterCount() const;
266
267 #ifdef PEGASUS_INTERNALONLY
|
268 kumpf 1.21 Boolean isNull() const;
|
269 kumpf 1.20 #endif
270
271 Boolean identical(const CIMConstMethod& x) const;
272
273 CIMMethod clone() const;
|
274 mike 1.17
275 private:
276
|
277 kumpf 1.20 void _checkRep() const;
|
278 mike 1.17
279 CIMMethodRep* _rep;
280
281 friend class CIMMethod;
282 friend class CIMMethodRep;
|
283 kumpf 1.22 friend class XmlWriter;
|
284 kumpf 1.23 friend class MofWriter;
|
285 mike 1.17 };
286
287 #define PEGASUS_ARRAY_T CIMMethod
|
288 kumpf 1.24 # include <Pegasus/Common/ArrayInter.h>
|
289 mike 1.17 #undef PEGASUS_ARRAY_T
290
291 PEGASUS_NAMESPACE_END
292
293 #endif /* Pegasus_Method_h */
|