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

  1 karl  1.26 //%2005////////////////////////////////////////////////////////////////////////
  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 mike  1.9  //
 12            // Permission is hereby granted, free of charge, to any person obtaining a copy
 13 kumpf 1.15 // of this software and associated documentation files (the "Software"), to
 14            // deal in the Software without restriction, including without limitation the
 15            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16 mike  1.9  // sell copies of the Software, and to permit persons to whom the Software is
 17            // furnished to do so, subject to the following conditions:
 18            // 
 19 kumpf 1.15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20 mike  1.9  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22 kumpf 1.15 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25 mike  1.9  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27            //
 28            //==============================================================================
 29            //
 30            // Author: Mike Brasher (mbrasher@bmc.com)
 31            //
 32 kumpf 1.10 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 33 kumpf 1.16 //              Carol Ann Krug Graves, Hewlett-Packard Company
 34            //                (carolann_graves@hp.com)
 35 mike  1.9  //
 36            //%/////////////////////////////////////////////////////////////////////////////
 37            
 38            #include "CIMParameter.h"
 39 kumpf 1.10 #include "CIMParameterRep.h"
 40 mike  1.9  
 41            PEGASUS_NAMESPACE_BEGIN
 42            
 43            #define PEGASUS_ARRAY_T CIMParameter
 44            # include "ArrayImpl.h"
 45            #undef PEGASUS_ARRAY_T
 46            
 47 kumpf 1.10 ////////////////////////////////////////////////////////////////////////////////
 48            //
 49            // CIMParameter
 50            //
 51            ////////////////////////////////////////////////////////////////////////////////
 52            
 53            CIMParameter::CIMParameter()
 54                : _rep(0)
 55            {
 56            }
 57            
 58            CIMParameter::CIMParameter(const CIMParameter& x)
 59            {
 60                Inc(_rep = x._rep);
 61            }
 62            
 63            CIMParameter::CIMParameter(
 64 kumpf 1.17     const CIMName& name,
 65 kumpf 1.10     CIMType type,
 66                Boolean isArray,
 67                Uint32 arraySize,
 68 kumpf 1.17     const CIMName& referenceClassName)
 69 kumpf 1.10 {
 70                _rep = new CIMParameterRep(
 71                    name, type, isArray, arraySize, referenceClassName);
 72            }
 73            
 74            CIMParameter::CIMParameter(CIMParameterRep* rep)
 75                : _rep(rep)
 76            {
 77            }
 78            
 79            CIMParameter::~CIMParameter()
 80            {
 81                Dec(_rep);
 82            }
 83            
 84            CIMParameter& CIMParameter::operator=(const CIMParameter& x)
 85            {
 86                if (x._rep != _rep)
 87                {
 88                    Dec(_rep);
 89                    Inc(_rep = x._rep);
 90 kumpf 1.10     }
 91                return *this;
 92            }
 93            
 94 kumpf 1.17 const CIMName& CIMParameter::getName() const
 95 kumpf 1.10 {
 96                _checkRep();
 97                return _rep->getName();
 98            }
 99            
100 kumpf 1.17 void CIMParameter::setName(const CIMName& name)
101 kumpf 1.10 {
102                _checkRep();
103                _rep->setName(name);
104            }
105            
106            Boolean CIMParameter::isArray() const
107            {
108                _checkRep();
109                return _rep->isArray();
110            }
111            
112            Uint32 CIMParameter::getArraySize() const
113            {
114                _checkRep();
115                return _rep->getArraySize();
116            }
117            
118 kumpf 1.17 const CIMName& CIMParameter::getReferenceClassName() const
119 kumpf 1.10 {
120                _checkRep();
121                return _rep->getReferenceClassName();
122            }
123            
124            CIMType CIMParameter::getType() const
125            {
126                _checkRep();
127                return _rep->getType();
128            }
129            
130            CIMParameter& CIMParameter::addQualifier(const CIMQualifier& x)
131            {
132                _checkRep();
133                _rep->addQualifier(x);
134                return *this;
135            }
136            
137 kumpf 1.17 Uint32 CIMParameter::findQualifier(const CIMName& name) const
138 kumpf 1.10 {
139                _checkRep();
140                return _rep->findQualifier(name);
141            }
142            
143 kumpf 1.22 CIMQualifier CIMParameter::getQualifier(Uint32 index)
144 kumpf 1.10 {
145                _checkRep();
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                _checkRep();
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                _checkRep ();
158 kumpf 1.22     _rep->removeQualifier (index);
159 kumpf 1.19 }
160            
161 kumpf 1.10 Uint32 CIMParameter::getQualifierCount() const
162            {
163                _checkRep();
164                return _rep->getQualifierCount();
165            }
166            
167 kumpf 1.18 Boolean CIMParameter::isUninitialized() const
168 kumpf 1.10 {
169 kumpf 1.12     return (_rep == 0)? true : false;
170 kumpf 1.10 }
171            
172 mike  1.9  Boolean CIMParameter::identical(const CIMConstParameter& x) const
173            {
174                x._checkRep();
175                _checkRep();
176                return _rep->identical(x._rep);
177 kumpf 1.10 }
178            
179            CIMParameter CIMParameter::clone() const
180            {
181                return CIMParameter(_rep->clone());
182            }
183            
184            void CIMParameter::_checkRep() const
185            {
186                if (!_rep)
187 kumpf 1.21         throw UninitializedObjectException();
188 kumpf 1.10 }
189            
190            
191            ////////////////////////////////////////////////////////////////////////////////
192            //
193            // CIMConstParameter
194            //
195            ////////////////////////////////////////////////////////////////////////////////
196            
197            CIMConstParameter::CIMConstParameter()
198                : _rep(0)
199            {
200            }
201            
202            CIMConstParameter::CIMConstParameter(const CIMConstParameter& x)
203            {
204                Inc(_rep = x._rep);
205            }
206            
207            CIMConstParameter::CIMConstParameter(const CIMParameter& x)
208            {
209 kumpf 1.10     Inc(_rep = x._rep);
210            }
211            
212            CIMConstParameter::CIMConstParameter(
213 kumpf 1.17     const CIMName& name,
214 kumpf 1.10     CIMType type,
215                Boolean isArray,
216                Uint32 arraySize,
217 kumpf 1.17     const CIMName& referenceClassName)
218 kumpf 1.10 {
219                _rep = new CIMParameterRep(
220                    name, type, isArray, arraySize, referenceClassName);
221            }
222            
223            CIMConstParameter::~CIMConstParameter()
224            {
225                Dec(_rep);
226            }
227            
228            CIMConstParameter& CIMConstParameter::operator=(const CIMConstParameter& x)
229            {
230                if (x._rep != _rep)
231                {
232                    Dec(_rep);
233                    Inc(_rep = x._rep);
234                }
235                return *this;
236            }
237            
238            CIMConstParameter& CIMConstParameter::operator=(const CIMParameter& x)
239 kumpf 1.10 {
240                if (x._rep != _rep)
241                {
242                    Dec(_rep);
243                    Inc(_rep = x._rep);
244                }
245                return *this;
246            }
247            
248 kumpf 1.17 const CIMName& CIMConstParameter::getName() const
249 kumpf 1.10 {
250                _checkRep();
251                return _rep->getName();
252            }
253            
254            Boolean CIMConstParameter::isArray() const
255            {
256                _checkRep();
257                return _rep->isArray();
258            }
259            
260            Uint32 CIMConstParameter::getArraySize() const
261            {
262                _checkRep();
263                return _rep->getArraySize();
264            }
265            
266 kumpf 1.17 const CIMName& CIMConstParameter::getReferenceClassName() const
267 kumpf 1.10 {
268                _checkRep();
269                return _rep->getReferenceClassName();
270            }
271            
272            CIMType CIMConstParameter::getType() const
273            {
274                _checkRep();
275                return _rep->getType();
276            }
277            
278 kumpf 1.17 Uint32 CIMConstParameter::findQualifier(const CIMName& name) const
279 kumpf 1.10 {
280                _checkRep();
281                return _rep->findQualifier(name);
282            }
283            
284 kumpf 1.22 CIMConstQualifier CIMConstParameter::getQualifier(Uint32 index) const
285 kumpf 1.10 {
286                _checkRep();
287 kumpf 1.22     return _rep->getQualifier(index);
288 kumpf 1.10 }
289            
290            Uint32 CIMConstParameter::getQualifierCount() const
291            {
292                _checkRep();
293                return _rep->getQualifierCount();
294            }
295            
296 kumpf 1.18 Boolean CIMConstParameter::isUninitialized() const
297 kumpf 1.10 {
298 kumpf 1.12     return (_rep == 0)? true : false;
299 kumpf 1.10 }
300            
301            Boolean CIMConstParameter::identical(const CIMConstParameter& x) const
302            {
303                x._checkRep();
304                _checkRep();
305                return _rep->identical(x._rep);
306            }
307            
308            CIMParameter CIMConstParameter::clone() const
309            {
310                return CIMParameter(_rep->clone());
311            }
312            
313            void CIMConstParameter::_checkRep() const
314            {
315                if (!_rep)
316 kumpf 1.21         throw UninitializedObjectException();
317 mike  1.9  }
318            
319            PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2