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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2