1 mike 1.9 //%/////////////////////////////////////////////////////////////////////////////
2 //
|
3 kumpf 1.15 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
|
5 mike 1.9 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 kumpf 1.15 // 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.9 // 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.15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
14 mike 1.9 // 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.15 // 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.9 // 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.10 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
27 mike 1.9 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30 #include "CIMMethod.h"
|
31 kumpf 1.10 #include "CIMMethodRep.h"
|
32 mike 1.9
33 PEGASUS_NAMESPACE_BEGIN
34
35 #define PEGASUS_ARRAY_T CIMMethod
36 # include "ArrayImpl.h"
37 #undef PEGASUS_ARRAY_T
38
|
39 kumpf 1.10 ///////////////////////////////////////////////////////////////////////////////
40 //
41 // CIMMethod
42 //
43 ///////////////////////////////////////////////////////////////////////////////
44
45 CIMMethod::CIMMethod()
46 : _rep(0)
47 {
48 }
49
50 CIMMethod::CIMMethod(const CIMMethod& x)
51 {
52 Inc(_rep = x._rep);
53 }
54
55 CIMMethod::CIMMethod(
56 const String& name,
57 CIMType type,
58 const String& classOrigin,
59 Boolean propagated)
60 kumpf 1.10 {
61 _rep = new CIMMethodRep(name, type, classOrigin, propagated);
62 }
63
64 CIMMethod::CIMMethod(CIMMethodRep* rep)
65 : _rep(rep)
66 {
67 }
68
|
69 mike 1.9 CIMMethod::CIMMethod(const CIMConstMethod& x)
70 {
71 Inc(_rep = x._rep);
72 }
73
|
74 kumpf 1.10 CIMMethod::~CIMMethod()
75 {
76 Dec(_rep);
77 }
78
79 CIMMethod& CIMMethod::operator=(const CIMMethod& x)
80 {
81 if (x._rep != _rep)
82 {
83 Dec(_rep);
84 Inc(_rep = x._rep);
85 }
86 return *this;
87 }
88
89 const String& CIMMethod::getName() const
90 {
91 _checkRep();
92 return _rep->getName();
93 }
94
95 kumpf 1.10 void CIMMethod::setName(const String& name)
96 {
97 _checkRep();
98 _rep->setName(name);
99 }
100
101 CIMType CIMMethod::getType() const
102 {
103 _checkRep();
104 return _rep->getType();
105 }
106
107 void CIMMethod::setType(CIMType type)
108 {
109 _checkRep();
110 _rep->setType(type);
111 }
112
113 const String& CIMMethod::getClassOrigin() const
114 {
115 _checkRep();
116 kumpf 1.10 return _rep->getClassOrigin();
117 }
118
119 void CIMMethod::setClassOrigin(const String& classOrigin)
120 {
121 _checkRep();
122 _rep->setClassOrigin(classOrigin);
123 }
124
125 Boolean CIMMethod::getPropagated() const
126 {
127 _checkRep();
128 return _rep->getPropagated();
129 }
130
131 void CIMMethod::setPropagated(Boolean propagated)
132 {
133 _checkRep();
134 _rep->setPropagated(propagated);
135 }
136
137 kumpf 1.10 CIMMethod& CIMMethod::addQualifier(const CIMQualifier& x)
138 {
139 _checkRep();
140 _rep->addQualifier(x);
141 return *this;
142 }
143
144 Uint32 CIMMethod::findQualifier(const String& name) const
145 {
146 _checkRep();
147 return _rep->findQualifier(name);
148 }
149
150 Boolean CIMMethod::existsQualifier(const String& name) const
151 {
152 _checkRep();
153 return _rep->existsQualifier(name);
154 }
155
156 CIMQualifier CIMMethod::getQualifier(Uint32 pos)
157 {
158 kumpf 1.10 _checkRep();
159 return _rep->getQualifier(pos);
160 }
161
162 CIMConstQualifier CIMMethod::getQualifier(Uint32 pos) const
163 {
164 _checkRep();
165 return _rep->getQualifier(pos);
166 }
167
168 void CIMMethod::removeQualifier(Uint32 pos)
169 {
170 _checkRep();
171 _rep->removeQualifier(pos);
172 }
173
174 Uint32 CIMMethod::getQualifierCount() const
175 {
176 _checkRep();
177 return _rep->getQualifierCount();
178 }
179 kumpf 1.10
180 CIMMethod& CIMMethod::addParameter(const CIMParameter& x)
181 {
182 _checkRep();
183 _rep->addParameter(x);
184 return *this;
185 }
186
187 Uint32 CIMMethod::findParameter(const String& name) const
188 {
189 _checkRep();
190 return _rep->findParameter(name);
191 }
192
193 CIMParameter CIMMethod::getParameter(Uint32 pos)
194 {
195 _checkRep();
196 return _rep->getParameter(pos);
197 }
198
199 CIMConstParameter CIMMethod::getParameter(Uint32 pos) const
200 kumpf 1.10 {
201 _checkRep();
202 return _rep->getParameter(pos);
203 }
204
205 Uint32 CIMMethod::getParameterCount() const
206 {
207 _checkRep();
208 return _rep->getParameterCount();
209 }
210
211 void CIMMethod::resolve(
212 DeclContext* declContext,
213 const String& nameSpace,
214 const CIMConstMethod& method)
215 {
216 _checkRep();
217 _rep->resolve(declContext, nameSpace, method);
218 }
219
220 void CIMMethod::resolve(
221 kumpf 1.10 DeclContext* declContext,
222 const String& nameSpace)
223 {
224 _checkRep();
225 _rep->resolve(declContext, nameSpace);
226 }
227
|
228 kumpf 1.12 Boolean CIMMethod::isNull() const
|
229 kumpf 1.10 {
|
230 kumpf 1.12 return (_rep == 0)? true : false;
|
231 kumpf 1.10 }
232
|
233 mike 1.9 Boolean CIMMethod::identical(const CIMConstMethod& x) const
234 {
235 x._checkRep();
236 _checkRep();
237 return _rep->identical(x._rep);
|
238 kumpf 1.10 }
239
240 CIMMethod CIMMethod::clone() const
241 {
242 return CIMMethod(_rep->clone());
243 }
244
245 void CIMMethod::_checkRep() const
246 {
247 if (!_rep)
|
248 kumpf 1.11 ThrowUninitializedHandle();
|
249 kumpf 1.10 }
250
251
252 ///////////////////////////////////////////////////////////////////////////////
253 //
254 // CIMConstMethod
255 //
256 ///////////////////////////////////////////////////////////////////////////////
257
258 CIMConstMethod::CIMConstMethod()
259 : _rep(0)
260 {
261 }
262
263 CIMConstMethod::CIMConstMethod(const CIMConstMethod& x)
264 {
265 Inc(_rep = x._rep);
266 }
267
268 CIMConstMethod::CIMConstMethod(const CIMMethod& x)
269 {
270 kumpf 1.10 Inc(_rep = x._rep);
271 }
272
273 CIMConstMethod::CIMConstMethod(
274 const String& name,
275 CIMType type,
276 const String& classOrigin,
277 Boolean propagated)
278 {
279 _rep = new CIMMethodRep(name, type, classOrigin, propagated);
280 }
281
282 CIMConstMethod::~CIMConstMethod()
283 {
284 Dec(_rep);
285 }
286
287 CIMConstMethod& CIMConstMethod::operator=(const CIMConstMethod& x)
288 {
289 if (x._rep != _rep)
290 {
291 kumpf 1.10 Dec(_rep);
292 Inc(_rep = x._rep);
293 }
294 return *this;
295 }
296
297 CIMConstMethod& CIMConstMethod::operator=(const CIMMethod& x)
298 {
299 if (x._rep != _rep)
300 {
301 Dec(_rep);
302 Inc(_rep = x._rep);
303 }
304 return *this;
305 }
306
307 const String& CIMConstMethod::getName() const
308 {
309 _checkRep();
310 return _rep->getName();
311 }
312 kumpf 1.10
313 CIMType CIMConstMethod::getType() const
314 {
315 _checkRep();
316 return _rep->getType();
317 }
318
319 const String& CIMConstMethod::getClassOrigin() const
320 {
321 _checkRep();
322 return _rep->getClassOrigin();
323 }
324
325 Boolean CIMConstMethod::getPropagated() const
326 {
327 _checkRep();
328 return _rep->getPropagated();
329 }
330
331 Uint32 CIMConstMethod::findQualifier(const String& name) const
332 {
333 kumpf 1.10 _checkRep();
334 return _rep->findQualifier(name);
335 }
336
|
337 kumpf 1.12 CIMConstQualifier CIMConstMethod::getQualifier(Uint32 pos) const
|
338 kumpf 1.10 {
339 _checkRep();
340 return _rep->getQualifier(pos);
341 }
342
343 Uint32 CIMConstMethod::getQualifierCount() const
344 {
345 _checkRep();
346 return _rep->getQualifierCount();
347 }
348
349 Uint32 CIMConstMethod::findParameter(const String& name) const
350 {
351 _checkRep();
352 return _rep->findParameter(name);
353 }
354
355 CIMConstParameter CIMConstMethod::getParameter(Uint32 pos) const
356 {
357 _checkRep();
358 return _rep->getParameter(pos);
359 kumpf 1.10 }
360
361 Uint32 CIMConstMethod::getParameterCount() const
362 {
363 _checkRep();
364 return _rep->getParameterCount();
365 }
366
|
367 kumpf 1.12 Boolean CIMConstMethod::isNull() const
|
368 kumpf 1.10 {
|
369 kumpf 1.12 return (_rep == 0)? true : false;
|
370 kumpf 1.10 }
371
372 Boolean CIMConstMethod::identical(const CIMConstMethod& x) const
373 {
374 x._checkRep();
375 _checkRep();
376 return _rep->identical(x._rep);
377 }
378
379 CIMMethod CIMConstMethod::clone() const
380 {
381 return CIMMethod(_rep->clone());
382 }
383
384 void CIMConstMethod::_checkRep() const
385 {
386 if (!_rep)
|
387 kumpf 1.11 ThrowUninitializedHandle();
|
388 mike 1.9 }
389
390 PEGASUS_NAMESPACE_END
|