1 martin 1.34 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.35 //
|
3 martin 1.34 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.35 //
|
10 martin 1.34 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.35 //
|
17 martin 1.34 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.35 //
|
20 martin 1.34 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.35 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.34 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.35 //
|
28 martin 1.34 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.9 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #include "CIMQualifier.h"
|
33 kumpf 1.10 #include "CIMQualifierRep.h"
|
34 mike 1.9
35 PEGASUS_NAMESPACE_BEGIN
36
37 #define PEGASUS_ARRAY_T CIMQualifier
38 # include "ArrayImpl.h"
39 #undef PEGASUS_ARRAY_T
40
|
41 kumpf 1.10 ////////////////////////////////////////////////////////////////////////////////
42 //
43 // CIMQualifier
44 //
45 ////////////////////////////////////////////////////////////////////////////////
46
47 CIMQualifier::CIMQualifier()
48 : _rep(0)
49 {
50 }
51
52 CIMQualifier::CIMQualifier(const CIMQualifier& x)
53 {
|
54 thilo.boehm 1.33 _rep = x._rep;
55 if (_rep)
56 _rep->Inc();
|
57 kumpf 1.10 }
58
59 CIMQualifier::CIMQualifier(
|
60 kumpf 1.17 const CIMName& name,
|
61 kumpf 1.10 const CIMValue& value,
|
62 kumpf 1.19 const CIMFlavor & flavor,
|
63 kumpf 1.10 Boolean propagated)
64 {
65 _rep = new CIMQualifierRep(name, value, flavor, propagated);
66 }
67
68 CIMQualifier::CIMQualifier(CIMQualifierRep* rep)
69 : _rep(rep)
70 {
71 }
72
73 CIMQualifier::~CIMQualifier()
74 {
|
75 thilo.boehm 1.33 if(_rep)
76 _rep->Dec();
|
77 kumpf 1.10 }
78
79 CIMQualifier& CIMQualifier::operator=(const CIMQualifier& x)
80 {
81 if (x._rep != _rep)
82 {
|
83 thilo.boehm 1.33 if (_rep)
84 _rep->Dec();
85 _rep = x._rep;
86 if (_rep)
87 _rep->Inc();
|
88 kumpf 1.10 }
89
90 return *this;
91 }
92
|
93 kumpf 1.17 const CIMName& CIMQualifier::getName() const
|
94 kumpf 1.10 {
|
95 marek 1.30 CheckRep(_rep);
|
96 kumpf 1.10 return _rep->getName();
97 }
98
|
99 kumpf 1.17 void CIMQualifier::setName(const CIMName& name)
|
100 kumpf 1.10 {
|
101 marek 1.30 CheckRep(_rep);
|
102 kumpf 1.10 _rep->setName(name);
103 }
104
105 CIMType CIMQualifier::getType() const
106 {
|
107 marek 1.30 CheckRep(_rep);
|
108 kumpf 1.10 return _rep->getType();
109 }
110
111 Boolean CIMQualifier::isArray() const
112 {
|
113 marek 1.30 CheckRep(_rep);
|
114 kumpf 1.10 return _rep->isArray();
115 }
116
117 const CIMValue& CIMQualifier::getValue() const
118 {
|
119 marek 1.30 CheckRep(_rep);
|
120 kumpf 1.10 return _rep->getValue();
121 }
122
123 void CIMQualifier::setValue(const CIMValue& value)
124 {
|
125 marek 1.30 CheckRep(_rep);
|
126 kumpf 1.10 _rep->setValue(value);
127 }
128
|
129 kumpf 1.19 void CIMQualifier::setFlavor(const CIMFlavor & flavor)
|
130 kumpf 1.10 {
|
131 marek 1.30 CheckRep(_rep);
|
132 kumpf 1.10 _rep->setFlavor(flavor);
133 }
134
|
135 kumpf 1.20 void CIMQualifier::unsetFlavor(const CIMFlavor & flavor)
|
136 kumpf 1.10 {
|
137 marek 1.30 CheckRep(_rep);
|
138 kumpf 1.10 _rep->unsetFlavor(flavor);
139 }
140
|
141 kumpf 1.19 const CIMFlavor & CIMQualifier::getFlavor() const
|
142 kumpf 1.10 {
|
143 marek 1.30 CheckRep(_rep);
|
144 kumpf 1.10 return _rep->getFlavor();
145 }
146
|
147 kumpf 1.31 Uint32 CIMQualifier::getPropagated() const
|
148 kumpf 1.10 {
|
149 marek 1.30 CheckRep(_rep);
|
150 kumpf 1.24 return (_rep->getPropagated()) ? 1 : 0;
|
151 kumpf 1.10 }
152
153 void CIMQualifier::setPropagated(Boolean propagated)
154 {
|
155 marek 1.30 CheckRep(_rep);
|
156 kumpf 1.10 _rep->setPropagated(propagated);
157 }
158
|
159 kumpf 1.18 Boolean CIMQualifier::isUninitialized() const
|
160 kumpf 1.10 {
|
161 kumpf 1.29 return _rep == 0;
|
162 kumpf 1.10 }
163
|
164 mike 1.9 Boolean CIMQualifier::identical(const CIMConstQualifier& x) const
165 {
|
166 marek 1.30 CheckRep(x._rep);
167 CheckRep(_rep);
|
168 mike 1.9 return _rep->identical(x._rep);
|
169 kumpf 1.10 }
170
171 CIMQualifier CIMQualifier::clone() const
172 {
173 return CIMQualifier(_rep->clone());
174 }
175
176
177 ////////////////////////////////////////////////////////////////////////////////
178 //
179 // CIMConstQualifier
180 //
181 ////////////////////////////////////////////////////////////////////////////////
182
183 CIMConstQualifier::CIMConstQualifier()
184 : _rep(0)
185 {
186 }
187
188 CIMConstQualifier::CIMConstQualifier(const CIMConstQualifier& x)
189 {
|
190 thilo.boehm 1.33 _rep = x._rep;
191 if (_rep)
192 _rep->Inc();
|
193 kumpf 1.10 }
194
195 CIMConstQualifier::CIMConstQualifier(const CIMQualifier& x)
196 {
|
197 thilo.boehm 1.33 _rep = x._rep;
198 if (_rep)
199 _rep->Inc();
|
200 kumpf 1.10 }
201
202 CIMConstQualifier::CIMConstQualifier(
|
203 kumpf 1.17 const CIMName& name,
|
204 kumpf 1.10 const CIMValue& value,
|
205 kumpf 1.19 const CIMFlavor & flavor,
|
206 kumpf 1.10 Boolean propagated)
207 {
208 _rep = new CIMQualifierRep(name, value, flavor, propagated);
209 }
210
211 CIMConstQualifier::~CIMConstQualifier()
212 {
|
213 thilo.boehm 1.33 if (_rep)
214 _rep->Dec();
|
215 kumpf 1.10 }
216
217 CIMConstQualifier& CIMConstQualifier::operator=(const CIMConstQualifier& x)
218 {
219 if (x._rep != _rep)
220 {
|
221 thilo.boehm 1.33 if (_rep)
222 _rep->Dec();
223 _rep = x._rep;
224 if (_rep)
225 _rep->Inc();
|
226 kumpf 1.10 }
227
228 return *this;
229 }
230
231 CIMConstQualifier& CIMConstQualifier::operator=(const CIMQualifier& x)
232 {
233 if (x._rep != _rep)
234 {
|
235 thilo.boehm 1.33 if (_rep)
236 _rep->Dec();
237 _rep = x._rep;
238 if (_rep)
239 _rep->Inc();
|
240 kumpf 1.10 }
241
242 return *this;
243 }
244
|
245 kumpf 1.17 const CIMName& CIMConstQualifier::getName() const
|
246 kumpf 1.10 {
|
247 marek 1.30 CheckRep(_rep);
|
248 kumpf 1.10 return _rep->getName();
249 }
250
251 CIMType CIMConstQualifier::getType() const
252 {
|
253 marek 1.30 CheckRep(_rep);
|
254 kumpf 1.10 return _rep->getType();
255 }
256
257 Boolean CIMConstQualifier::isArray() const
258 {
|
259 marek 1.30 CheckRep(_rep);
|
260 kumpf 1.10 return _rep->isArray();
261 }
262
263 const CIMValue& CIMConstQualifier::getValue() const
264 {
|
265 marek 1.30 CheckRep(_rep);
|
266 kumpf 1.10 return _rep->getValue();
267 }
268
|
269 kumpf 1.19 const CIMFlavor & CIMConstQualifier::getFlavor() const
|
270 kumpf 1.10 {
|
271 marek 1.30 CheckRep(_rep);
|
272 kumpf 1.10 return _rep->getFlavor();
273 }
274
|
275 kumpf 1.31 Uint32 CIMConstQualifier::getPropagated() const
|
276 kumpf 1.10 {
|
277 marek 1.30 CheckRep(_rep);
|
278 kumpf 1.24 return (_rep->getPropagated()) ? 1 : 0;
|
279 kumpf 1.10 }
280
|
281 kumpf 1.18 Boolean CIMConstQualifier::isUninitialized() const
|
282 kumpf 1.10 {
|
283 kumpf 1.29 return _rep == 0;
|
284 kumpf 1.10 }
285
286 Boolean CIMConstQualifier::identical(const CIMConstQualifier& x) const
287 {
|
288 marek 1.30 CheckRep(x._rep);
289 CheckRep(_rep);
|
290 kumpf 1.10 return _rep->identical(x._rep);
291 }
292
293 CIMQualifier CIMConstQualifier::clone() const
294 {
295 return CIMQualifier(_rep->clone());
296 }
297
|
298 mike 1.9 PEGASUS_NAMESPACE_END
|