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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2