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

  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            // Author: Mike Brasher (mbrasher@bmc.com)
 33            //
 34 kumpf 1.10 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 35 kumpf 1.16 //              Carol Ann Krug Graves, Hewlett-Packard Company
 36            //                (carolann_graves@hp.com)
 37 mike  1.9  //
 38            //%/////////////////////////////////////////////////////////////////////////////
 39            
 40            #include "CIMMethod.h"
 41 kumpf 1.10 #include "CIMMethodRep.h"
 42 mike  1.9  
 43            PEGASUS_NAMESPACE_BEGIN
 44            
 45            #define PEGASUS_ARRAY_T CIMMethod
 46            # include "ArrayImpl.h"
 47            #undef PEGASUS_ARRAY_T
 48            
 49 kumpf 1.10 ///////////////////////////////////////////////////////////////////////////////
 50            //
 51            // CIMMethod
 52            //
 53            ///////////////////////////////////////////////////////////////////////////////
 54            
 55            CIMMethod::CIMMethod()
 56                : _rep(0)
 57            {
 58            }
 59            
 60            CIMMethod::CIMMethod(const CIMMethod& x)
 61            {
 62                Inc(_rep = x._rep);
 63            }
 64            
 65            CIMMethod::CIMMethod(
 66 kumpf 1.18     const CIMName& name,
 67 kumpf 1.10     CIMType type,
 68 kumpf 1.18     const CIMName& classOrigin,
 69 kumpf 1.10     Boolean propagated)
 70            {
 71                _rep = new CIMMethodRep(name, type, classOrigin, propagated);
 72            }
 73            
 74            CIMMethod::CIMMethod(CIMMethodRep* rep)
 75                : _rep(rep)
 76            {
 77            }
 78            
 79 mike  1.9  CIMMethod::CIMMethod(const CIMConstMethod& x)
 80            {
 81                Inc(_rep = x._rep);
 82            }
 83            
 84 kumpf 1.10 CIMMethod::~CIMMethod()
 85            {
 86                Dec(_rep);
 87            }
 88            
 89            CIMMethod& CIMMethod::operator=(const CIMMethod& x)
 90            {
 91                if (x._rep != _rep)
 92                {
 93                    Dec(_rep);
 94                    Inc(_rep = x._rep);
 95                }
 96                return *this;
 97            }
 98            
 99 kumpf 1.18 const CIMName& CIMMethod::getName() const
100 kumpf 1.10 {
101                _checkRep();
102                return _rep->getName();
103            }
104            
105 kumpf 1.18 void CIMMethod::setName(const CIMName& name)
106 kumpf 1.10 {
107                _checkRep();
108                _rep->setName(name);
109            }
110            
111            CIMType CIMMethod::getType() const
112            {
113                _checkRep();
114                return _rep->getType();
115            }
116            
117            void CIMMethod::setType(CIMType type)
118            {
119                _checkRep();
120                _rep->setType(type);
121            }
122            
123 kumpf 1.18 const CIMName& CIMMethod::getClassOrigin() const
124 kumpf 1.10 {
125                _checkRep();
126                return _rep->getClassOrigin();
127            }
128            
129 kumpf 1.18 void CIMMethod::setClassOrigin(const CIMName& classOrigin)
130 kumpf 1.10 {
131                _checkRep();
132                _rep->setClassOrigin(classOrigin);
133            }
134            
135            Boolean CIMMethod::getPropagated() const
136            {
137                _checkRep();
138                return _rep->getPropagated();
139            }
140            
141            void CIMMethod::setPropagated(Boolean propagated)
142            {
143                _checkRep();
144                _rep->setPropagated(propagated);
145            }
146            
147            CIMMethod& CIMMethod::addQualifier(const CIMQualifier& x)
148            {
149                _checkRep();
150                _rep->addQualifier(x);
151 kumpf 1.10     return *this;
152            }
153            
154 kumpf 1.18 Uint32 CIMMethod::findQualifier(const CIMName& name) const
155 kumpf 1.10 {
156                _checkRep();
157                return _rep->findQualifier(name);
158            }
159            
160 kumpf 1.23 CIMQualifier CIMMethod::getQualifier(Uint32 index)
161 kumpf 1.10 {
162                _checkRep();
163 kumpf 1.23     return _rep->getQualifier(index);
164 kumpf 1.10 }
165            
166 kumpf 1.23 CIMConstQualifier CIMMethod::getQualifier(Uint32 index) const
167 kumpf 1.10 {
168                _checkRep();
169 kumpf 1.23     return _rep->getQualifier(index);
170 kumpf 1.10 }
171            
172 kumpf 1.23 void CIMMethod::removeQualifier(Uint32 index)
173 kumpf 1.10 {
174                _checkRep();
175 kumpf 1.23     _rep->removeQualifier(index);
176 kumpf 1.10 }
177            
178            Uint32 CIMMethod::getQualifierCount() const
179            {
180                _checkRep();
181                return _rep->getQualifierCount();
182            }
183            
184            CIMMethod& CIMMethod::addParameter(const CIMParameter& x)
185            {
186                _checkRep();
187                _rep->addParameter(x);
188                return *this;
189            }
190            
191 kumpf 1.18 Uint32 CIMMethod::findParameter(const CIMName& name) const
192 kumpf 1.10 {
193                _checkRep();
194                return _rep->findParameter(name);
195            }
196            
197 kumpf 1.23 CIMParameter CIMMethod::getParameter(Uint32 index)
198 kumpf 1.10 {
199                _checkRep();
200 kumpf 1.23     return _rep->getParameter(index);
201 kumpf 1.10 }
202            
203 kumpf 1.23 CIMConstParameter CIMMethod::getParameter(Uint32 index) const
204 kumpf 1.10 {
205                _checkRep();
206 kumpf 1.23     return _rep->getParameter(index);
207 kumpf 1.10 }
208            
209 kumpf 1.23 void CIMMethod::removeParameter (Uint32 index)
210 kumpf 1.20 {
211                _checkRep ();
212 kumpf 1.23     _rep->removeParameter (index);
213 kumpf 1.20 }
214            
215 kumpf 1.10 Uint32 CIMMethod::getParameterCount() const
216            {
217                _checkRep();
218                return _rep->getParameterCount();
219            }
220            
221 kumpf 1.19 Boolean CIMMethod::isUninitialized() const
222 kumpf 1.10 {
223 kumpf 1.12     return (_rep == 0)? true : false;
224 kumpf 1.10 }
225            
226 mike  1.9  Boolean CIMMethod::identical(const CIMConstMethod& x) const
227            {
228                x._checkRep();
229                _checkRep();
230                return _rep->identical(x._rep);
231 kumpf 1.10 }
232            
233            CIMMethod CIMMethod::clone() const
234            {
235                return CIMMethod(_rep->clone());
236            }
237            
238            void CIMMethod::_checkRep() const
239            {
240                if (!_rep)
241 kumpf 1.22         throw UninitializedObjectException();
242 kumpf 1.10 }
243            
244            
245            ///////////////////////////////////////////////////////////////////////////////
246            //
247            // CIMConstMethod
248            //
249            ///////////////////////////////////////////////////////////////////////////////
250            
251            CIMConstMethod::CIMConstMethod()
252                : _rep(0)
253            {
254            }
255            
256            CIMConstMethod::CIMConstMethod(const CIMConstMethod& x)
257            {
258                Inc(_rep = x._rep);
259            }
260            
261            CIMConstMethod::CIMConstMethod(const CIMMethod& x)
262            {
263 kumpf 1.10     Inc(_rep = x._rep);
264            }
265            
266            CIMConstMethod::CIMConstMethod(
267 kumpf 1.18     const CIMName& name,
268 kumpf 1.10     CIMType type,
269 kumpf 1.18     const CIMName& classOrigin,
270 kumpf 1.10     Boolean propagated)
271            {
272                _rep = new CIMMethodRep(name, type, classOrigin, propagated);
273            }
274            
275            CIMConstMethod::~CIMConstMethod()
276            {
277                Dec(_rep);
278            }
279            
280            CIMConstMethod& CIMConstMethod::operator=(const CIMConstMethod& x)
281            {
282                if (x._rep != _rep)
283                {
284                    Dec(_rep);
285                    Inc(_rep = x._rep);
286                }
287                return *this;
288            }
289            
290            CIMConstMethod& CIMConstMethod::operator=(const CIMMethod& x)
291 kumpf 1.10 {
292                if (x._rep != _rep)
293                {
294                    Dec(_rep);
295                    Inc(_rep = x._rep);
296                }
297                return *this;
298            }
299            
300 kumpf 1.18 const CIMName& CIMConstMethod::getName() const
301 kumpf 1.10 {
302                _checkRep();
303                return _rep->getName();
304            }
305            
306            CIMType CIMConstMethod::getType() const
307            {
308                _checkRep();
309                return _rep->getType();
310            }
311            
312 kumpf 1.18 const CIMName& CIMConstMethod::getClassOrigin() const
313 kumpf 1.10 {
314                _checkRep();
315                return _rep->getClassOrigin();
316            }
317            
318            Boolean CIMConstMethod::getPropagated() const
319            {
320                _checkRep();
321                return _rep->getPropagated();
322            }
323            
324 kumpf 1.18 Uint32 CIMConstMethod::findQualifier(const CIMName& name) const
325 kumpf 1.10 {
326                _checkRep();
327                return _rep->findQualifier(name);
328            }
329            
330 kumpf 1.23 CIMConstQualifier CIMConstMethod::getQualifier(Uint32 index) const
331 kumpf 1.10 {
332                _checkRep();
333 kumpf 1.23     return _rep->getQualifier(index);
334 kumpf 1.10 }
335            
336            Uint32 CIMConstMethod::getQualifierCount() const
337            {
338                _checkRep();
339                return _rep->getQualifierCount();
340            }
341            
342 kumpf 1.18 Uint32 CIMConstMethod::findParameter(const CIMName& name) const
343 kumpf 1.10 {
344                _checkRep();
345                return _rep->findParameter(name);
346            }
347            
348 kumpf 1.23 CIMConstParameter CIMConstMethod::getParameter(Uint32 index) const
349 kumpf 1.10 {
350                _checkRep();
351 kumpf 1.23     return _rep->getParameter(index);
352 kumpf 1.10 }
353            
354            Uint32 CIMConstMethod::getParameterCount() const
355            {
356                _checkRep();
357                return _rep->getParameterCount();
358            }
359            
360 kumpf 1.19 Boolean CIMConstMethod::isUninitialized() const
361 kumpf 1.10 {
362 kumpf 1.12     return (_rep == 0)? true : false;
363 kumpf 1.10 }
364            
365            Boolean CIMConstMethod::identical(const CIMConstMethod& x) const
366            {
367                x._checkRep();
368                _checkRep();
369                return _rep->identical(x._rep);
370            }
371            
372            CIMMethod CIMConstMethod::clone() const
373            {
374                return CIMMethod(_rep->clone());
375            }
376            
377            void CIMConstMethod::_checkRep() const
378            {
379                if (!_rep)
380 kumpf 1.22         throw UninitializedObjectException();
381 mike  1.9  }
382            
383            PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2