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