(file) Return to CIMParameter.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 martin 1.32 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.33 //
  3 martin 1.32 // 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.33 //
 10 martin 1.32 // 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.33 //
 17 martin 1.32 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.33 //
 20 martin 1.32 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.33 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.32 // 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.33 //
 28 martin 1.32 //////////////////////////////////////////////////////////////////////////
 29 mike   1.9  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             #include "CIMParameter.h"
 33 kumpf  1.10 #include "CIMParameterRep.h"
 34 mike   1.9  
 35             PEGASUS_NAMESPACE_BEGIN
 36             
 37             #define PEGASUS_ARRAY_T CIMParameter
 38             # include "ArrayImpl.h"
 39             #undef PEGASUS_ARRAY_T
 40             
 41 kumpf  1.10 ////////////////////////////////////////////////////////////////////////////////
 42             //
 43             // CIMParameter
 44             //
 45             ////////////////////////////////////////////////////////////////////////////////
 46             
 47             CIMParameter::CIMParameter()
 48                 : _rep(0)
 49             {
 50             }
 51             
 52             CIMParameter::CIMParameter(const CIMParameter& x)
 53             {
 54 thilo.boehm 1.31     _rep = x._rep;
 55                      if (_rep)
 56                          _rep->Inc();
 57 kumpf       1.10 }
 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 thilo.boehm 1.31     if (_rep)
 78                          _rep->Dec();
 79 kumpf       1.10 }
 80                  
 81                  CIMParameter& CIMParameter::operator=(const CIMParameter& x)
 82                  {
 83                      if (x._rep != _rep)
 84                      {
 85 thilo.boehm 1.31         if (_rep)
 86                              _rep->Dec();
 87                          _rep = x._rep;
 88                          if (_rep)
 89                              _rep->Inc();
 90 kumpf       1.10     }
 91                      return *this;
 92                  }
 93                  
 94 kumpf       1.17 const CIMName& CIMParameter::getName() const
 95 kumpf       1.10 {
 96 marek       1.29     CheckRep(_rep);
 97 kumpf       1.10     return _rep->getName();
 98                  }
 99                  
100 kumpf       1.17 void CIMParameter::setName(const CIMName& name)
101 kumpf       1.10 {
102 marek       1.29     CheckRep(_rep);
103 kumpf       1.10     _rep->setName(name);
104                  }
105                  
106                  Boolean CIMParameter::isArray() const
107                  {
108 marek       1.29     CheckRep(_rep);
109 kumpf       1.10     return _rep->isArray();
110                  }
111                  
112                  Uint32 CIMParameter::getArraySize() const
113                  {
114 marek       1.29     CheckRep(_rep);
115 kumpf       1.10     return _rep->getArraySize();
116                  }
117                  
118 kumpf       1.17 const CIMName& CIMParameter::getReferenceClassName() const
119 kumpf       1.10 {
120 marek       1.29     CheckRep(_rep);
121 kumpf       1.10     return _rep->getReferenceClassName();
122                  }
123                  
124                  CIMType CIMParameter::getType() const
125                  {
126 marek       1.29     CheckRep(_rep);
127 kumpf       1.10     return _rep->getType();
128                  }
129                  
130                  CIMParameter& CIMParameter::addQualifier(const CIMQualifier& x)
131                  {
132 marek       1.29     CheckRep(_rep);
133 kumpf       1.10     _rep->addQualifier(x);
134                      return *this;
135                  }
136                  
137 kumpf       1.17 Uint32 CIMParameter::findQualifier(const CIMName& name) const
138 kumpf       1.10 {
139 marek       1.29     CheckRep(_rep);
140 kumpf       1.10     return _rep->findQualifier(name);
141                  }
142                  
143 kumpf       1.22 CIMQualifier CIMParameter::getQualifier(Uint32 index)
144 kumpf       1.10 {
145 marek       1.29     CheckRep(_rep);
146 kumpf       1.22     return _rep->getQualifier(index);
147 kumpf       1.10 }
148                  
149 kumpf       1.22 CIMConstQualifier CIMParameter::getQualifier(Uint32 index) const
150 kumpf       1.10 {
151 marek       1.29     CheckRep(_rep);
152 kumpf       1.22     return _rep->getQualifier(index);
153 kumpf       1.10 }
154                  
155 kumpf       1.22 void CIMParameter::removeQualifier (Uint32 index)
156 kumpf       1.19 {
157 marek       1.29     CheckRep(_rep);
158 kumpf       1.22     _rep->removeQualifier (index);
159 kumpf       1.19 }
160                  
161 kumpf       1.10 Uint32 CIMParameter::getQualifierCount() const
162                  {
163 marek       1.29     CheckRep(_rep);
164 kumpf       1.10     return _rep->getQualifierCount();
165                  }
166                  
167 kumpf       1.18 Boolean CIMParameter::isUninitialized() const
168 kumpf       1.10 {
169 kumpf       1.28     return _rep == 0;
170 kumpf       1.10 }
171                  
172 mike        1.9  Boolean CIMParameter::identical(const CIMConstParameter& x) const
173                  {
174 marek       1.29     CheckRep(x._rep);
175                      CheckRep(_rep);
176 mike        1.9      return _rep->identical(x._rep);
177 kumpf       1.10 }
178                  
179                  CIMParameter CIMParameter::clone() const
180                  {
181                      return CIMParameter(_rep->clone());
182                  }
183                  
184                  
185                  ////////////////////////////////////////////////////////////////////////////////
186                  //
187                  // CIMConstParameter
188                  //
189                  ////////////////////////////////////////////////////////////////////////////////
190                  
191                  CIMConstParameter::CIMConstParameter()
192                      : _rep(0)
193                  {
194                  }
195                  
196                  CIMConstParameter::CIMConstParameter(const CIMConstParameter& x)
197                  {
198 thilo.boehm 1.31     _rep = x._rep;
199                      if (_rep)
200                          _rep->Inc();
201 kumpf       1.10 }
202                  
203                  CIMConstParameter::CIMConstParameter(const CIMParameter& x)
204                  {
205 thilo.boehm 1.31     _rep = x._rep;
206                      if (_rep)
207                          _rep->Inc();
208 kumpf       1.10 }
209                  
210                  CIMConstParameter::CIMConstParameter(
211 kumpf       1.17     const CIMName& name,
212 kumpf       1.10     CIMType type,
213                      Boolean isArray,
214                      Uint32 arraySize,
215 kumpf       1.17     const CIMName& referenceClassName)
216 kumpf       1.10 {
217                      _rep = new CIMParameterRep(
218                          name, type, isArray, arraySize, referenceClassName);
219                  }
220                  
221                  CIMConstParameter::~CIMConstParameter()
222                  {
223 thilo.boehm 1.31     if (_rep)
224                          _rep->Dec();
225 kumpf       1.10 }
226                  
227                  CIMConstParameter& CIMConstParameter::operator=(const CIMConstParameter& x)
228                  {
229                      if (x._rep != _rep)
230                      {
231 thilo.boehm 1.31         if (_rep)
232                              _rep->Dec();
233                          _rep = x._rep;
234                          if (_rep)
235                              _rep->Inc();
236                  
237 kumpf       1.10     }
238                      return *this;
239                  }
240                  
241                  CIMConstParameter& CIMConstParameter::operator=(const CIMParameter& x)
242                  {
243                      if (x._rep != _rep)
244                      {
245 thilo.boehm 1.31         if (_rep)
246                              _rep->Dec();
247                          _rep = x._rep;
248                          if (_rep)
249                              _rep->Inc();
250 kumpf       1.10     }
251                      return *this;
252                  }
253                  
254 kumpf       1.17 const CIMName& CIMConstParameter::getName() const
255 kumpf       1.10 {
256 marek       1.29     CheckRep(_rep);
257 kumpf       1.10     return _rep->getName();
258                  }
259                  
260                  Boolean CIMConstParameter::isArray() const
261                  {
262 marek       1.29     CheckRep(_rep);
263 kumpf       1.10     return _rep->isArray();
264                  }
265                  
266                  Uint32 CIMConstParameter::getArraySize() const
267                  {
268 marek       1.29     CheckRep(_rep);
269 kumpf       1.10     return _rep->getArraySize();
270                  }
271                  
272 kumpf       1.17 const CIMName& CIMConstParameter::getReferenceClassName() const
273 kumpf       1.10 {
274 marek       1.29     CheckRep(_rep);
275 kumpf       1.10     return _rep->getReferenceClassName();
276                  }
277                  
278                  CIMType CIMConstParameter::getType() const
279                  {
280 marek       1.29     CheckRep(_rep);
281 kumpf       1.10     return _rep->getType();
282                  }
283                  
284 kumpf       1.17 Uint32 CIMConstParameter::findQualifier(const CIMName& name) const
285 kumpf       1.10 {
286 marek       1.29     CheckRep(_rep);
287 kumpf       1.10     return _rep->findQualifier(name);
288                  }
289                  
290 kumpf       1.22 CIMConstQualifier CIMConstParameter::getQualifier(Uint32 index) const
291 kumpf       1.10 {
292 marek       1.29     CheckRep(_rep);
293 kumpf       1.22     return _rep->getQualifier(index);
294 kumpf       1.10 }
295                  
296                  Uint32 CIMConstParameter::getQualifierCount() const
297                  {
298 marek       1.29     CheckRep(_rep);
299 kumpf       1.10     return _rep->getQualifierCount();
300                  }
301                  
302 kumpf       1.18 Boolean CIMConstParameter::isUninitialized() const
303 kumpf       1.10 {
304 kumpf       1.28     return _rep == 0;
305 kumpf       1.10 }
306                  
307                  Boolean CIMConstParameter::identical(const CIMConstParameter& x) const
308                  {
309 marek       1.29     CheckRep(x._rep);
310                      CheckRep(_rep);
311 kumpf       1.10     return _rep->identical(x._rep);
312                  }
313                  
314                  CIMParameter CIMConstParameter::clone() const
315                  {
316                      return CIMParameter(_rep->clone());
317                  }
318                  
319 mike        1.9  PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2