(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            void CIMParameter::setType(const CIMType type)
125            {
126                _checkRep();
127                _rep->setType(type);
128            }
129            
130            CIMParameter& CIMParameter::addQualifier(const CIMQualifier& x)
131            {
132                _checkRep();
133                _rep->addQualifier(x);
134 kumpf 1.10     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