1 karl 1.31 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.10 //
|
3 karl 1.29 // 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.28 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.29 // 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.30 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.31 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.10 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 kumpf 1.18 // 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.10 // 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.18 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.10 // 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.18 // 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.10 // 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 kumpf 1.13 #include "CIMPropertyRep.h"
|
35 mike 1.10 #include "CIMProperty.h"
36
37 PEGASUS_NAMESPACE_BEGIN
38
39 #define PEGASUS_ARRAY_T CIMProperty
40 # include "ArrayImpl.h"
41 #undef PEGASUS_ARRAY_T
42
|
43 kumpf 1.11
44 ////////////////////////////////////////////////////////////////////////////////
45 //
46 // CIMProperty
47 //
48 ////////////////////////////////////////////////////////////////////////////////
49
50 CIMProperty::CIMProperty()
51 : _rep(0)
52 {
53 }
54
55 CIMProperty::CIMProperty(const CIMProperty& x)
56 {
57 Inc(_rep = x._rep);
58 }
59
60 CIMProperty::CIMProperty(
|
61 kumpf 1.21 const CIMName& name,
|
62 kumpf 1.11 const CIMValue& value,
63 Uint32 arraySize,
|
64 kumpf 1.21 const CIMName& referenceClassName,
65 const CIMName& classOrigin,
|
66 kumpf 1.11 Boolean propagated)
67 {
68 _rep = new CIMPropertyRep(name, value,
69 arraySize, referenceClassName, classOrigin, propagated);
70 }
71
72 CIMProperty::CIMProperty(CIMPropertyRep* rep)
73 : _rep(rep)
74 {
75 }
76
77 CIMProperty::~CIMProperty()
78 {
79 Dec(_rep);
80 }
81
82 CIMProperty& CIMProperty::operator=(const CIMProperty& x)
83 {
84 if (x._rep != _rep)
85 {
86 Dec(_rep);
87 kumpf 1.11 Inc(_rep = x._rep);
88 }
89 return *this;
90 }
91
|
92 kumpf 1.21 const CIMName& CIMProperty::getName() const
|
93 kumpf 1.11 {
|
94 marek 1.34 CheckRep(_rep);
|
95 kumpf 1.11 return _rep->getName();
96 }
97
|
98 kumpf 1.21 void CIMProperty::setName(const CIMName& name)
|
99 kumpf 1.11 {
|
100 marek 1.34 CheckRep(_rep);
|
101 kumpf 1.11 _rep->setName(name);
102 }
103
104 const CIMValue& CIMProperty::getValue() const
105 {
|
106 marek 1.34 CheckRep(_rep);
|
107 kumpf 1.11 return _rep->getValue();
108 }
109
110 CIMType CIMProperty::getType() const
111 {
|
112 marek 1.34 CheckRep(_rep);
|
113 kumpf 1.11 return _rep->getValue().getType();
114 }
115
116 Boolean CIMProperty::isArray() const
117 {
|
118 marek 1.34 CheckRep(_rep);
|
119 kumpf 1.11 return _rep->getValue().isArray();
120 }
121
122 void CIMProperty::setValue(const CIMValue& value)
123 {
|
124 marek 1.34 CheckRep(_rep);
|
125 kumpf 1.11 _rep->setValue(value);
126 }
127
128 Uint32 CIMProperty::getArraySize() const
129 {
|
130 marek 1.34 CheckRep(_rep);
|
131 kumpf 1.11 return _rep->getArraySize();
132 }
133
|
134 kumpf 1.21 const CIMName& CIMProperty::getReferenceClassName() const
|
135 kumpf 1.11 {
|
136 marek 1.34 CheckRep(_rep);
|
137 kumpf 1.11 return _rep->getReferenceClassName();
138 }
139
|
140 kumpf 1.21 const CIMName& CIMProperty::getClassOrigin() const
|
141 kumpf 1.11 {
|
142 marek 1.34 CheckRep(_rep);
|
143 kumpf 1.11 return _rep->getClassOrigin();
144 }
145
|
146 kumpf 1.21 void CIMProperty::setClassOrigin(const CIMName& classOrigin)
|
147 kumpf 1.11 {
|
148 marek 1.34 CheckRep(_rep);
|
149 kumpf 1.11 _rep->setClassOrigin(classOrigin);
150 }
151
152 Boolean CIMProperty::getPropagated() const
153 {
|
154 marek 1.34 CheckRep(_rep);
|
155 kumpf 1.11 return _rep->getPropagated();
156 }
157
158 void CIMProperty::setPropagated(Boolean propagated)
159 {
|
160 marek 1.34 CheckRep(_rep);
|
161 kumpf 1.11 _rep->setPropagated(propagated);
162 }
163
164 CIMProperty& CIMProperty::addQualifier(const CIMQualifier& x)
165 {
|
166 marek 1.34 CheckRep(_rep);
|
167 kumpf 1.11 _rep->addQualifier(x);
168 return *this;
169 }
170
|
171 kumpf 1.21 Uint32 CIMProperty::findQualifier(const CIMName& name) const
|
172 kumpf 1.11 {
|
173 marek 1.34 CheckRep(_rep);
|
174 kumpf 1.11 return _rep->findQualifier(name);
175 }
176
|
177 kumpf 1.27 CIMQualifier CIMProperty::getQualifier(Uint32 index)
|
178 kumpf 1.11 {
|
179 marek 1.34 CheckRep(_rep);
|
180 kumpf 1.27 return _rep->getQualifier(index);
|
181 kumpf 1.11 }
182
|
183 kumpf 1.27 CIMConstQualifier CIMProperty::getQualifier(Uint32 index) const
|
184 kumpf 1.11 {
|
185 marek 1.34 CheckRep(_rep);
|
186 kumpf 1.27 return _rep->getQualifier(index);
|
187 kumpf 1.11 }
188
|
189 kumpf 1.27 void CIMProperty::removeQualifier(Uint32 index)
|
190 kumpf 1.11 {
|
191 marek 1.34 CheckRep(_rep);
|
192 kumpf 1.27 _rep->removeQualifier(index);
|
193 kumpf 1.11 }
|
194 kumpf 1.33
|
195 kumpf 1.11 Uint32 CIMProperty::getQualifierCount() const
196 {
|
197 marek 1.34 CheckRep(_rep);
|
198 kumpf 1.11 return _rep->getQualifierCount();
199 }
200
|
201 kumpf 1.23 Boolean CIMProperty::isUninitialized() const
|
202 kumpf 1.11 {
|
203 kumpf 1.33 return _rep == 0;
|
204 kumpf 1.11 }
205
|
206 mike 1.10 Boolean CIMProperty::identical(const CIMConstProperty& x) const
207 {
|
208 marek 1.34 CheckRep(x._rep);
209 CheckRep(_rep);
|
210 mike 1.10 return _rep->identical(x._rep);
|
211 kumpf 1.11 }
212
|
213 kumpf 1.24 CIMProperty CIMProperty::clone() const
|
214 kumpf 1.11 {
|
215 kumpf 1.24 return CIMProperty(_rep->clone());
|
216 kumpf 1.11 }
217
218
219 ////////////////////////////////////////////////////////////////////////////////
220 //
221 // CIMConstProperty
222 //
223 ////////////////////////////////////////////////////////////////////////////////
224
225 CIMConstProperty::CIMConstProperty()
226 : _rep(0)
227 {
228 }
229
230 CIMConstProperty::CIMConstProperty(const CIMConstProperty& x)
231 {
232 Inc(_rep = x._rep);
233 }
234
235 CIMConstProperty::CIMConstProperty(const CIMProperty& x)
236 {
237 kumpf 1.11 Inc(_rep = x._rep);
238 }
239
240 CIMConstProperty::CIMConstProperty(
|
241 kumpf 1.21 const CIMName& name,
|
242 kumpf 1.11 const CIMValue& value,
243 Uint32 arraySize,
|
244 kumpf 1.21 const CIMName& referenceClassName,
245 const CIMName& classOrigin,
|
246 kumpf 1.11 Boolean propagated)
247 {
248 _rep = new CIMPropertyRep(name, value,
249 arraySize, referenceClassName, classOrigin, propagated);
250 }
251
252 CIMConstProperty::~CIMConstProperty()
253 {
254 Dec(_rep);
255 }
256
257 CIMConstProperty& CIMConstProperty::operator=(const CIMConstProperty& x)
258 {
259 if (x._rep != _rep)
260 {
261 Dec(_rep);
262 Inc(_rep = x._rep);
263 }
264 return *this;
265 }
266
267 kumpf 1.11 CIMConstProperty& CIMConstProperty::operator=(const CIMProperty& x)
268 {
269 if (x._rep != _rep)
270 {
271 Dec(_rep);
272 Inc(_rep = x._rep);
273 }
274 return *this;
275 }
276
|
277 kumpf 1.21 const CIMName& CIMConstProperty::getName() const
|
278 kumpf 1.11 {
|
279 marek 1.34 CheckRep(_rep);
|
280 kumpf 1.11 return _rep->getName();
281 }
282
283 const CIMValue& CIMConstProperty::getValue() const
284 {
|
285 marek 1.34 CheckRep(_rep);
|
286 kumpf 1.11 return _rep->getValue();
287 }
288
289 CIMType CIMConstProperty::getType() const
290 {
|
291 marek 1.34 CheckRep(_rep);
|
292 kumpf 1.11 return _rep->getValue().getType();
293 }
294
295 Boolean CIMConstProperty::isArray() const
296 {
|
297 marek 1.34 CheckRep(_rep);
|
298 kumpf 1.11 return _rep->getValue().isArray();
299 }
300
301 Uint32 CIMConstProperty::getArraySize() const
302 {
|
303 marek 1.34 CheckRep(_rep);
|
304 kumpf 1.11 return _rep->getArraySize();
305 }
306
|
307 kumpf 1.21 const CIMName& CIMConstProperty::getReferenceClassName() const
|
308 kumpf 1.11 {
|
309 marek 1.34 CheckRep(_rep);
|
310 kumpf 1.11 return _rep->getReferenceClassName();
311 }
312
|
313 kumpf 1.21 const CIMName& CIMConstProperty::getClassOrigin() const
|
314 kumpf 1.11 {
|
315 marek 1.34 CheckRep(_rep);
|
316 kumpf 1.11 return _rep->getClassOrigin();
317 }
318
319 Boolean CIMConstProperty::getPropagated() const
320 {
|
321 marek 1.34 CheckRep(_rep);
|
322 kumpf 1.11 return _rep->getPropagated();
323 }
324
|
325 kumpf 1.21 Uint32 CIMConstProperty::findQualifier(const CIMName& name) const
|
326 kumpf 1.11 {
|
327 marek 1.34 CheckRep(_rep);
|
328 kumpf 1.11 return _rep->findQualifier(name);
329 }
330
|
331 kumpf 1.27 CIMConstQualifier CIMConstProperty::getQualifier(Uint32 index) const
|
332 kumpf 1.11 {
|
333 marek 1.34 CheckRep(_rep);
|
334 kumpf 1.27 return _rep->getQualifier(index);
|
335 kumpf 1.11 }
336
337 Uint32 CIMConstProperty::getQualifierCount() const
338 {
|
339 marek 1.34 CheckRep(_rep);
|
340 kumpf 1.11 return _rep->getQualifierCount();
341 }
342
|
343 kumpf 1.23 Boolean CIMConstProperty::isUninitialized() const
|
344 kumpf 1.11 {
|
345 kumpf 1.33 return _rep == 0;
|
346 kumpf 1.11 }
347
348 Boolean CIMConstProperty::identical(const CIMConstProperty& x) const
349 {
|
350 marek 1.34 CheckRep(x._rep);
351 CheckRep(_rep);
|
352 kumpf 1.11 return _rep->identical(x._rep);
353 }
354
|
355 kumpf 1.24 CIMProperty CIMConstProperty::clone() const
|
356 kumpf 1.11 {
|
357 kumpf 1.24 return CIMProperty(_rep->clone());
|
358 kumpf 1.11 }
359
|
360 mike 1.10 PEGASUS_NAMESPACE_END
|