1 karl 1.27 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.9 //
|
3 karl 1.25 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.24 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.25 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.26 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.27 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.9 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 kumpf 1.15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
18 mike 1.9 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
|
21 kumpf 1.15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.9 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
24 kumpf 1.15 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
27 mike 1.9 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 #include "CIMMethod.h"
|
35 kumpf 1.10 #include "CIMMethodRep.h"
|
36 mike 1.9
37 PEGASUS_NAMESPACE_BEGIN
38
39 #define PEGASUS_ARRAY_T CIMMethod
40 # include "ArrayImpl.h"
41 #undef PEGASUS_ARRAY_T
42
|
43 kumpf 1.10 ///////////////////////////////////////////////////////////////////////////////
44 //
45 // CIMMethod
46 //
47 ///////////////////////////////////////////////////////////////////////////////
48
49 CIMMethod::CIMMethod()
50 : _rep(0)
51 {
52 }
53
54 CIMMethod::CIMMethod(const CIMMethod& x)
55 {
56 Inc(_rep = x._rep);
57 }
58
59 CIMMethod::CIMMethod(
|
60 kumpf 1.18 const CIMName& name,
|
61 kumpf 1.10 CIMType type,
|
62 kumpf 1.18 const CIMName& classOrigin,
|
63 kumpf 1.10 Boolean propagated)
64 {
65 _rep = new CIMMethodRep(name, type, classOrigin, propagated);
66 }
67
68 CIMMethod::CIMMethod(CIMMethodRep* rep)
69 : _rep(rep)
70 {
71 }
72
|
73 mike 1.9 CIMMethod::CIMMethod(const CIMConstMethod& x)
74 {
75 Inc(_rep = x._rep);
76 }
77
|
78 kumpf 1.10 CIMMethod::~CIMMethod()
79 {
80 Dec(_rep);
81 }
82
83 CIMMethod& CIMMethod::operator=(const CIMMethod& x)
84 {
85 if (x._rep != _rep)
86 {
87 Dec(_rep);
88 Inc(_rep = x._rep);
89 }
90 return *this;
91 }
92
|
93 kumpf 1.18 const CIMName& CIMMethod::getName() const
|
94 kumpf 1.10 {
95 _checkRep();
96 return _rep->getName();
97 }
98
|
99 kumpf 1.18 void CIMMethod::setName(const CIMName& name)
|
100 kumpf 1.10 {
101 _checkRep();
102 _rep->setName(name);
103 }
104
105 CIMType CIMMethod::getType() const
106 {
107 _checkRep();
108 return _rep->getType();
109 }
110
111 void CIMMethod::setType(CIMType type)
112 {
113 _checkRep();
114 _rep->setType(type);
115 }
116
|
117 kumpf 1.18 const CIMName& CIMMethod::getClassOrigin() const
|
118 kumpf 1.10 {
119 _checkRep();
120 return _rep->getClassOrigin();
121 }
122
|
123 kumpf 1.18 void CIMMethod::setClassOrigin(const CIMName& classOrigin)
|
124 kumpf 1.10 {
125 _checkRep();
126 _rep->setClassOrigin(classOrigin);
127 }
128
129 Boolean CIMMethod::getPropagated() const
130 {
131 _checkRep();
132 return _rep->getPropagated();
133 }
134
135 void CIMMethod::setPropagated(Boolean propagated)
136 {
137 _checkRep();
138 _rep->setPropagated(propagated);
139 }
140
141 CIMMethod& CIMMethod::addQualifier(const CIMQualifier& x)
142 {
143 _checkRep();
144 _rep->addQualifier(x);
145 kumpf 1.10 return *this;
146 }
147
|
148 kumpf 1.18 Uint32 CIMMethod::findQualifier(const CIMName& name) const
|
149 kumpf 1.10 {
150 _checkRep();
151 return _rep->findQualifier(name);
152 }
153
|
154 kumpf 1.23 CIMQualifier CIMMethod::getQualifier(Uint32 index)
|
155 kumpf 1.10 {
156 _checkRep();
|
157 kumpf 1.23 return _rep->getQualifier(index);
|
158 kumpf 1.10 }
159
|
160 kumpf 1.23 CIMConstQualifier CIMMethod::getQualifier(Uint32 index) const
|
161 kumpf 1.10 {
162 _checkRep();
|
163 kumpf 1.23 return _rep->getQualifier(index);
|
164 kumpf 1.10 }
165
|
166 kumpf 1.23 void CIMMethod::removeQualifier(Uint32 index)
|
167 kumpf 1.10 {
168 _checkRep();
|
169 kumpf 1.23 _rep->removeQualifier(index);
|
170 kumpf 1.10 }
171
172 Uint32 CIMMethod::getQualifierCount() const
173 {
174 _checkRep();
175 return _rep->getQualifierCount();
176 }
177
178 CIMMethod& CIMMethod::addParameter(const CIMParameter& x)
179 {
180 _checkRep();
181 _rep->addParameter(x);
182 return *this;
183 }
184
|
185 kumpf 1.18 Uint32 CIMMethod::findParameter(const CIMName& name) const
|
186 kumpf 1.10 {
187 _checkRep();
188 return _rep->findParameter(name);
189 }
190
|
191 kumpf 1.23 CIMParameter CIMMethod::getParameter(Uint32 index)
|
192 kumpf 1.10 {
193 _checkRep();
|
194 kumpf 1.23 return _rep->getParameter(index);
|
195 kumpf 1.10 }
196
|
197 kumpf 1.23 CIMConstParameter CIMMethod::getParameter(Uint32 index) const
|
198 kumpf 1.10 {
199 _checkRep();
|
200 kumpf 1.23 return _rep->getParameter(index);
|
201 kumpf 1.10 }
202
|
203 kumpf 1.23 void CIMMethod::removeParameter (Uint32 index)
|
204 kumpf 1.20 {
205 _checkRep ();
|
206 kumpf 1.23 _rep->removeParameter (index);
|
207 kumpf 1.20 }
208
|
209 kumpf 1.10 Uint32 CIMMethod::getParameterCount() const
210 {
211 _checkRep();
212 return _rep->getParameterCount();
213 }
214
|
215 kumpf 1.19 Boolean CIMMethod::isUninitialized() const
|
216 kumpf 1.10 {
|
217 kumpf 1.28 return _rep == 0;
|
218 kumpf 1.10 }
219
|
220 mike 1.9 Boolean CIMMethod::identical(const CIMConstMethod& x) const
221 {
222 x._checkRep();
223 _checkRep();
224 return _rep->identical(x._rep);
|
225 kumpf 1.10 }
226
227 CIMMethod CIMMethod::clone() const
228 {
229 return CIMMethod(_rep->clone());
230 }
231
232 void CIMMethod::_checkRep() const
233 {
234 if (!_rep)
|
235 kumpf 1.22 throw UninitializedObjectException();
|
236 kumpf 1.10 }
237
238
239 ///////////////////////////////////////////////////////////////////////////////
240 //
241 // CIMConstMethod
242 //
243 ///////////////////////////////////////////////////////////////////////////////
244
245 CIMConstMethod::CIMConstMethod()
246 : _rep(0)
247 {
248 }
249
250 CIMConstMethod::CIMConstMethod(const CIMConstMethod& x)
251 {
252 Inc(_rep = x._rep);
253 }
254
255 CIMConstMethod::CIMConstMethod(const CIMMethod& x)
256 {
257 kumpf 1.10 Inc(_rep = x._rep);
258 }
259
260 CIMConstMethod::CIMConstMethod(
|
261 kumpf 1.18 const CIMName& name,
|
262 kumpf 1.10 CIMType type,
|
263 kumpf 1.18 const CIMName& classOrigin,
|
264 kumpf 1.10 Boolean propagated)
265 {
266 _rep = new CIMMethodRep(name, type, classOrigin, propagated);
267 }
268
269 CIMConstMethod::~CIMConstMethod()
270 {
271 Dec(_rep);
272 }
273
274 CIMConstMethod& CIMConstMethod::operator=(const CIMConstMethod& x)
275 {
276 if (x._rep != _rep)
277 {
278 Dec(_rep);
279 Inc(_rep = x._rep);
280 }
281 return *this;
282 }
283
284 CIMConstMethod& CIMConstMethod::operator=(const CIMMethod& x)
285 kumpf 1.10 {
286 if (x._rep != _rep)
287 {
288 Dec(_rep);
289 Inc(_rep = x._rep);
290 }
291 return *this;
292 }
293
|
294 kumpf 1.18 const CIMName& CIMConstMethod::getName() const
|
295 kumpf 1.10 {
296 _checkRep();
297 return _rep->getName();
298 }
299
300 CIMType CIMConstMethod::getType() const
301 {
302 _checkRep();
303 return _rep->getType();
304 }
305
|
306 kumpf 1.18 const CIMName& CIMConstMethod::getClassOrigin() const
|
307 kumpf 1.10 {
308 _checkRep();
309 return _rep->getClassOrigin();
310 }
311
312 Boolean CIMConstMethod::getPropagated() const
313 {
314 _checkRep();
315 return _rep->getPropagated();
316 }
317
|
318 kumpf 1.18 Uint32 CIMConstMethod::findQualifier(const CIMName& name) const
|
319 kumpf 1.10 {
320 _checkRep();
321 return _rep->findQualifier(name);
322 }
323
|
324 kumpf 1.23 CIMConstQualifier CIMConstMethod::getQualifier(Uint32 index) const
|
325 kumpf 1.10 {
326 _checkRep();
|
327 kumpf 1.23 return _rep->getQualifier(index);
|
328 kumpf 1.10 }
329
330 Uint32 CIMConstMethod::getQualifierCount() const
331 {
332 _checkRep();
333 return _rep->getQualifierCount();
334 }
335
|
336 kumpf 1.18 Uint32 CIMConstMethod::findParameter(const CIMName& name) const
|
337 kumpf 1.10 {
338 _checkRep();
339 return _rep->findParameter(name);
340 }
341
|
342 kumpf 1.23 CIMConstParameter CIMConstMethod::getParameter(Uint32 index) const
|
343 kumpf 1.10 {
344 _checkRep();
|
345 kumpf 1.23 return _rep->getParameter(index);
|
346 kumpf 1.10 }
347
348 Uint32 CIMConstMethod::getParameterCount() const
349 {
350 _checkRep();
351 return _rep->getParameterCount();
352 }
353
|
354 kumpf 1.19 Boolean CIMConstMethod::isUninitialized() const
|
355 kumpf 1.10 {
|
356 kumpf 1.28 return _rep == 0;
|
357 kumpf 1.10 }
358
359 Boolean CIMConstMethod::identical(const CIMConstMethod& x) const
360 {
361 x._checkRep();
362 _checkRep();
363 return _rep->identical(x._rep);
364 }
365
366 CIMMethod CIMConstMethod::clone() const
367 {
368 return CIMMethod(_rep->clone());
369 }
370
371 void CIMConstMethod::_checkRep() const
372 {
373 if (!_rep)
|
374 kumpf 1.22 throw UninitializedObjectException();
|
375 mike 1.9 }
376
377 PEGASUS_NAMESPACE_END
|