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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2