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