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

  1 mike  1.9 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3           // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
  4           //
  5           // Permission is hereby granted, free of charge, to any person obtaining a copy
  6           // of this software and associated documentation files (the "Software"), to 
  7           // deal in the Software without restriction, including without limitation the 
  8           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 
  9           // sell copies of the Software, and to permit persons to whom the Software is
 10           // furnished to do so, subject to the following conditions:
 11           // 
 12           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN 
 13           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 14           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 15           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
 16           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 17           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
 18           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 19           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 20           //
 21           //==============================================================================
 22 mike  1.9 //
 23           // Author: Mike Brasher (mbrasher@bmc.com)
 24           //
 25 kumpf 1.10 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 26 mike  1.9  //
 27            //%/////////////////////////////////////////////////////////////////////////////
 28            
 29            #include "CIMMethod.h"
 30 kumpf 1.10 #include "CIMMethodRep.h"
 31 mike  1.9  
 32            PEGASUS_NAMESPACE_BEGIN
 33            
 34            #define PEGASUS_ARRAY_T CIMMethod
 35            # include "ArrayImpl.h"
 36            #undef PEGASUS_ARRAY_T
 37            
 38 kumpf 1.10 ///////////////////////////////////////////////////////////////////////////////
 39            //
 40            // CIMMethod
 41            //
 42            ///////////////////////////////////////////////////////////////////////////////
 43            
 44            CIMMethod::CIMMethod()
 45                : _rep(0)
 46            {
 47            }
 48            
 49            CIMMethod::CIMMethod(const CIMMethod& x)
 50            {
 51                Inc(_rep = x._rep);
 52            }
 53            
 54            CIMMethod::CIMMethod(
 55                const String& name,
 56                CIMType type,
 57                const String& classOrigin,
 58                Boolean propagated)
 59 kumpf 1.10 {
 60                _rep = new CIMMethodRep(name, type, classOrigin, propagated);
 61            }
 62            
 63            CIMMethod::CIMMethod(CIMMethodRep* rep)
 64                : _rep(rep)
 65            {
 66            }
 67            
 68 mike  1.9  CIMMethod::CIMMethod(const CIMConstMethod& x)
 69            {
 70                Inc(_rep = x._rep);
 71            }
 72            
 73 kumpf 1.10 CIMMethod::~CIMMethod()
 74            {
 75                Dec(_rep);
 76            }
 77            
 78            CIMMethod& CIMMethod::operator=(const CIMMethod& x)
 79            {
 80                if (x._rep != _rep)
 81                {
 82                    Dec(_rep);
 83                    Inc(_rep = x._rep);
 84                }
 85                return *this;
 86            }
 87            
 88            const String& CIMMethod::getName() const
 89            {
 90                _checkRep();
 91                return _rep->getName();
 92            }
 93            
 94 kumpf 1.10 void CIMMethod::setName(const String& name)
 95            {
 96                _checkRep();
 97                _rep->setName(name);
 98            }
 99            
100            CIMType CIMMethod::getType() const
101            {
102                _checkRep();
103                return _rep->getType();
104            }
105            
106            void CIMMethod::setType(CIMType type)
107            {
108                _checkRep();
109                _rep->setType(type);
110            }
111            
112            const String& CIMMethod::getClassOrigin() const
113            {
114                _checkRep();
115 kumpf 1.10     return _rep->getClassOrigin();
116            }
117            
118            void CIMMethod::setClassOrigin(const String& classOrigin)
119            {
120                _checkRep();
121                _rep->setClassOrigin(classOrigin);
122            }
123            
124            Boolean CIMMethod::getPropagated() const
125            {
126                _checkRep();
127                return _rep->getPropagated();
128            }
129            
130            void CIMMethod::setPropagated(Boolean propagated)
131            {
132                _checkRep();
133                _rep->setPropagated(propagated);
134            }
135            
136 kumpf 1.10 CIMMethod& CIMMethod::addQualifier(const CIMQualifier& x)
137            {
138                _checkRep();
139                _rep->addQualifier(x);
140                return *this;
141            }
142            
143            Uint32 CIMMethod::findQualifier(const String& name) const
144            {
145                _checkRep();
146                return _rep->findQualifier(name);
147            }
148            
149            Boolean CIMMethod::existsQualifier(const String& name) const
150            {
151                _checkRep();
152                return _rep->existsQualifier(name);
153            }
154            
155            CIMQualifier CIMMethod::getQualifier(Uint32 pos)
156            {
157 kumpf 1.10     _checkRep();
158                return _rep->getQualifier(pos);
159            }
160            
161            CIMConstQualifier CIMMethod::getQualifier(Uint32 pos) const
162            {
163                _checkRep();
164                return _rep->getQualifier(pos);
165            }
166            
167            void CIMMethod::removeQualifier(Uint32 pos)
168            {
169                _checkRep();
170                _rep->removeQualifier(pos);
171            }
172            
173            Uint32 CIMMethod::getQualifierCount() const
174            {
175                _checkRep();
176                return _rep->getQualifierCount();
177            }
178 kumpf 1.10 
179            CIMMethod& CIMMethod::addParameter(const CIMParameter& x)
180            {
181                _checkRep();
182                _rep->addParameter(x);
183                return *this;
184            }
185            
186            Uint32 CIMMethod::findParameter(const String& name) const
187            {
188                _checkRep();
189                return _rep->findParameter(name);
190            }
191            
192            CIMParameter CIMMethod::getParameter(Uint32 pos)
193            {
194                _checkRep();
195                return _rep->getParameter(pos);
196            }
197            
198            CIMConstParameter CIMMethod::getParameter(Uint32 pos) const
199 kumpf 1.10 {
200                _checkRep();
201                return _rep->getParameter(pos);
202            }
203            
204            Uint32 CIMMethod::getParameterCount() const
205            {
206                _checkRep();
207                return _rep->getParameterCount();
208            }
209            
210            void CIMMethod::resolve(
211                DeclContext* declContext,
212                const String& nameSpace,
213                const CIMConstMethod& method)
214            {
215                _checkRep();
216                _rep->resolve(declContext, nameSpace, method);
217            }
218            
219            void CIMMethod::resolve(
220 kumpf 1.10     DeclContext* declContext,
221                const String& nameSpace)
222            {
223                _checkRep();
224                _rep->resolve(declContext, nameSpace);
225            }
226            
227 kumpf 1.12 Boolean CIMMethod::isNull() const
228 kumpf 1.10 {
229 kumpf 1.12     return (_rep == 0)? true : false;
230 kumpf 1.10 }
231            
232            void CIMMethod::toMof(Array<Sint8>& out) const
233            {
234                _checkRep();
235                _rep->toMof(out);
236            }
237            
238 mike  1.9  Boolean CIMMethod::identical(const CIMConstMethod& x) const
239            {
240                x._checkRep();
241                _checkRep();
242                return _rep->identical(x._rep);
243 kumpf 1.10 }
244            
245            CIMMethod CIMMethod::clone() const
246            {
247                return CIMMethod(_rep->clone());
248            }
249            
250            void CIMMethod::_checkRep() const
251            {
252                if (!_rep)
253 kumpf 1.11         ThrowUninitializedHandle();
254 kumpf 1.10 }
255            
256            
257            ///////////////////////////////////////////////////////////////////////////////
258            //
259            // CIMConstMethod
260            //
261            ///////////////////////////////////////////////////////////////////////////////
262            
263            CIMConstMethod::CIMConstMethod()
264                : _rep(0)
265            {
266            }
267            
268            CIMConstMethod::CIMConstMethod(const CIMConstMethod& x)
269            {
270                Inc(_rep = x._rep);
271            }
272            
273            CIMConstMethod::CIMConstMethod(const CIMMethod& x)
274            {
275 kumpf 1.10     Inc(_rep = x._rep);
276            }
277            
278            CIMConstMethod::CIMConstMethod(
279                const String& name,
280                CIMType type,
281                const String& classOrigin,
282                Boolean propagated)
283            {
284                _rep = new CIMMethodRep(name, type, classOrigin, propagated);
285            }
286            
287            CIMConstMethod::~CIMConstMethod()
288            {
289                Dec(_rep);
290            }
291            
292            CIMConstMethod& CIMConstMethod::operator=(const CIMConstMethod& x)
293            {
294                if (x._rep != _rep)
295                {
296 kumpf 1.10         Dec(_rep);
297                    Inc(_rep = x._rep);
298                }
299                return *this;
300            }
301            
302            CIMConstMethod& CIMConstMethod::operator=(const CIMMethod& x)
303            {
304                if (x._rep != _rep)
305                {
306                    Dec(_rep);
307                    Inc(_rep = x._rep);
308                }
309                return *this;
310            }
311            
312            const String& CIMConstMethod::getName() const
313            {
314                _checkRep();
315                return _rep->getName();
316            }
317 kumpf 1.10 
318            CIMType CIMConstMethod::getType() const
319            {
320                _checkRep();
321                return _rep->getType();
322            }
323            
324            const String& CIMConstMethod::getClassOrigin() const
325            {
326                _checkRep();
327                return _rep->getClassOrigin();
328            }
329            
330            Boolean CIMConstMethod::getPropagated() const
331            {
332                _checkRep();
333                return _rep->getPropagated();
334            }
335            
336            Uint32 CIMConstMethod::findQualifier(const String& name) const
337            {
338 kumpf 1.10     _checkRep();
339                return _rep->findQualifier(name);
340            }
341            
342 kumpf 1.12 CIMConstQualifier CIMConstMethod::getQualifier(Uint32 pos) const
343 kumpf 1.10 {
344                _checkRep();
345                return _rep->getQualifier(pos);
346            }
347            
348            Uint32 CIMConstMethod::getQualifierCount() const
349            {
350                _checkRep();
351                return _rep->getQualifierCount();
352            }
353            
354            Uint32 CIMConstMethod::findParameter(const String& name) const
355            {
356                _checkRep();
357                return _rep->findParameter(name);
358            }
359            
360            CIMConstParameter CIMConstMethod::getParameter(Uint32 pos) const
361            {
362                _checkRep();
363                return _rep->getParameter(pos);
364 kumpf 1.10 }
365            
366            Uint32 CIMConstMethod::getParameterCount() const
367            {
368                _checkRep();
369                return _rep->getParameterCount();
370            }
371            
372 kumpf 1.12 Boolean CIMConstMethod::isNull() const
373 kumpf 1.10 {
374 kumpf 1.12     return (_rep == 0)? true : false;
375 kumpf 1.10 }
376            
377            Boolean CIMConstMethod::identical(const CIMConstMethod& x) const
378            {
379                x._checkRep();
380                _checkRep();
381                return _rep->identical(x._rep);
382            }
383            
384            CIMMethod CIMConstMethod::clone() const
385            {
386                return CIMMethod(_rep->clone());
387            }
388            
389            void CIMConstMethod::_checkRep() const
390            {
391                if (!_rep)
392 kumpf 1.11         ThrowUninitializedHandle();
393 mike  1.9  }
394            
395            PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2