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 // Author: Mike Brasher (mbrasher@bmc.com)
33 //
|
34 kumpf 1.10 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
35 kumpf 1.16 // Carol Ann Krug Graves, Hewlett-Packard Company
36 // (carolann_graves@hp.com)
|
37 mike 1.9 //
38 //%/////////////////////////////////////////////////////////////////////////////
39
40 #include "CIMParameter.h"
|
41 kumpf 1.10 #include "CIMParameterRep.h"
|
42 mike 1.9
43 PEGASUS_NAMESPACE_BEGIN
44
45 #define PEGASUS_ARRAY_T CIMParameter
46 # include "ArrayImpl.h"
47 #undef PEGASUS_ARRAY_T
48
|
49 kumpf 1.10 ////////////////////////////////////////////////////////////////////////////////
50 //
51 // CIMParameter
52 //
53 ////////////////////////////////////////////////////////////////////////////////
54
55 CIMParameter::CIMParameter()
56 : _rep(0)
57 {
58 }
59
60 CIMParameter::CIMParameter(const CIMParameter& x)
61 {
62 Inc(_rep = x._rep);
63 }
64
65 CIMParameter::CIMParameter(
|
66 kumpf 1.17 const CIMName& name,
|
67 kumpf 1.10 CIMType type,
68 Boolean isArray,
69 Uint32 arraySize,
|
70 kumpf 1.17 const CIMName& referenceClassName)
|
71 kumpf 1.10 {
72 _rep = new CIMParameterRep(
73 name, type, isArray, arraySize, referenceClassName);
74 }
75
76 CIMParameter::CIMParameter(CIMParameterRep* rep)
77 : _rep(rep)
78 {
79 }
80
81 CIMParameter::~CIMParameter()
82 {
83 Dec(_rep);
84 }
85
86 CIMParameter& CIMParameter::operator=(const CIMParameter& x)
87 {
88 if (x._rep != _rep)
89 {
90 Dec(_rep);
91 Inc(_rep = x._rep);
92 kumpf 1.10 }
93 return *this;
94 }
95
|
96 kumpf 1.17 const CIMName& CIMParameter::getName() const
|
97 kumpf 1.10 {
98 _checkRep();
99 return _rep->getName();
100 }
101
|
102 kumpf 1.17 void CIMParameter::setName(const CIMName& name)
|
103 kumpf 1.10 {
104 _checkRep();
105 _rep->setName(name);
106 }
107
108 Boolean CIMParameter::isArray() const
109 {
110 _checkRep();
111 return _rep->isArray();
112 }
113
114 Uint32 CIMParameter::getArraySize() const
115 {
116 _checkRep();
117 return _rep->getArraySize();
118 }
119
|
120 kumpf 1.17 const CIMName& CIMParameter::getReferenceClassName() const
|
121 kumpf 1.10 {
122 _checkRep();
123 return _rep->getReferenceClassName();
124 }
125
126 CIMType CIMParameter::getType() const
127 {
128 _checkRep();
129 return _rep->getType();
130 }
131
132 CIMParameter& CIMParameter::addQualifier(const CIMQualifier& x)
133 {
134 _checkRep();
135 _rep->addQualifier(x);
136 return *this;
137 }
138
|
139 kumpf 1.17 Uint32 CIMParameter::findQualifier(const CIMName& name) const
|
140 kumpf 1.10 {
141 _checkRep();
142 return _rep->findQualifier(name);
143 }
144
|
145 kumpf 1.22 CIMQualifier CIMParameter::getQualifier(Uint32 index)
|
146 kumpf 1.10 {
147 _checkRep();
|
148 kumpf 1.22 return _rep->getQualifier(index);
|
149 kumpf 1.10 }
150
|
151 kumpf 1.22 CIMConstQualifier CIMParameter::getQualifier(Uint32 index) const
|
152 kumpf 1.10 {
153 _checkRep();
|
154 kumpf 1.22 return _rep->getQualifier(index);
|
155 kumpf 1.10 }
156
|
157 kumpf 1.22 void CIMParameter::removeQualifier (Uint32 index)
|
158 kumpf 1.19 {
159 _checkRep ();
|
160 kumpf 1.22 _rep->removeQualifier (index);
|
161 kumpf 1.19 }
162
|
163 kumpf 1.10 Uint32 CIMParameter::getQualifierCount() const
164 {
165 _checkRep();
166 return _rep->getQualifierCount();
167 }
168
|
169 kumpf 1.18 Boolean CIMParameter::isUninitialized() const
|
170 kumpf 1.10 {
|
171 kumpf 1.12 return (_rep == 0)? true : false;
|
172 kumpf 1.10 }
173
|
174 mike 1.9 Boolean CIMParameter::identical(const CIMConstParameter& x) const
175 {
176 x._checkRep();
177 _checkRep();
178 return _rep->identical(x._rep);
|
179 kumpf 1.10 }
180
181 CIMParameter CIMParameter::clone() const
182 {
183 return CIMParameter(_rep->clone());
184 }
185
186 void CIMParameter::_checkRep() const
187 {
188 if (!_rep)
|
189 kumpf 1.21 throw UninitializedObjectException();
|
190 kumpf 1.10 }
191
192
193 ////////////////////////////////////////////////////////////////////////////////
194 //
195 // CIMConstParameter
196 //
197 ////////////////////////////////////////////////////////////////////////////////
198
199 CIMConstParameter::CIMConstParameter()
200 : _rep(0)
201 {
202 }
203
204 CIMConstParameter::CIMConstParameter(const CIMConstParameter& x)
205 {
206 Inc(_rep = x._rep);
207 }
208
209 CIMConstParameter::CIMConstParameter(const CIMParameter& x)
210 {
211 kumpf 1.10 Inc(_rep = x._rep);
212 }
213
214 CIMConstParameter::CIMConstParameter(
|
215 kumpf 1.17 const CIMName& name,
|
216 kumpf 1.10 CIMType type,
217 Boolean isArray,
218 Uint32 arraySize,
|
219 kumpf 1.17 const CIMName& referenceClassName)
|
220 kumpf 1.10 {
221 _rep = new CIMParameterRep(
222 name, type, isArray, arraySize, referenceClassName);
223 }
224
225 CIMConstParameter::~CIMConstParameter()
226 {
227 Dec(_rep);
228 }
229
230 CIMConstParameter& CIMConstParameter::operator=(const CIMConstParameter& x)
231 {
232 if (x._rep != _rep)
233 {
234 Dec(_rep);
235 Inc(_rep = x._rep);
236 }
237 return *this;
238 }
239
240 CIMConstParameter& CIMConstParameter::operator=(const CIMParameter& x)
241 kumpf 1.10 {
242 if (x._rep != _rep)
243 {
244 Dec(_rep);
245 Inc(_rep = x._rep);
246 }
247 return *this;
248 }
249
|
250 kumpf 1.17 const CIMName& CIMConstParameter::getName() const
|
251 kumpf 1.10 {
252 _checkRep();
253 return _rep->getName();
254 }
255
256 Boolean CIMConstParameter::isArray() const
257 {
258 _checkRep();
259 return _rep->isArray();
260 }
261
262 Uint32 CIMConstParameter::getArraySize() const
263 {
264 _checkRep();
265 return _rep->getArraySize();
266 }
267
|
268 kumpf 1.17 const CIMName& CIMConstParameter::getReferenceClassName() const
|
269 kumpf 1.10 {
270 _checkRep();
271 return _rep->getReferenceClassName();
272 }
273
274 CIMType CIMConstParameter::getType() const
275 {
276 _checkRep();
277 return _rep->getType();
278 }
279
|
280 kumpf 1.17 Uint32 CIMConstParameter::findQualifier(const CIMName& name) const
|
281 kumpf 1.10 {
282 _checkRep();
283 return _rep->findQualifier(name);
284 }
285
|
286 kumpf 1.22 CIMConstQualifier CIMConstParameter::getQualifier(Uint32 index) const
|
287 kumpf 1.10 {
288 _checkRep();
|
289 kumpf 1.22 return _rep->getQualifier(index);
|
290 kumpf 1.10 }
291
292 Uint32 CIMConstParameter::getQualifierCount() const
293 {
294 _checkRep();
295 return _rep->getQualifierCount();
296 }
297
|
298 kumpf 1.18 Boolean CIMConstParameter::isUninitialized() const
|
299 kumpf 1.10 {
|
300 kumpf 1.12 return (_rep == 0)? true : false;
|
301 kumpf 1.10 }
302
303 Boolean CIMConstParameter::identical(const CIMConstParameter& x) const
304 {
305 x._checkRep();
306 _checkRep();
307 return _rep->identical(x._rep);
308 }
309
310 CIMParameter CIMConstParameter::clone() const
311 {
312 return CIMParameter(_rep->clone());
313 }
314
315 void CIMConstParameter::_checkRep() const
316 {
317 if (!_rep)
|
318 kumpf 1.21 throw UninitializedObjectException();
|
319 mike 1.9 }
320
321 PEGASUS_NAMESPACE_END
|