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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2