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

  1 karl  1.15 //%2005////////////////////////////////////////////////////////////////////////
  2 mike  1.2  //
  3 karl  1.14 // 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.13 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.14 // 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.15 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 mike  1.2  //
 12            // Permission is hereby granted, free of charge, to any person obtaining a copy
 13 kumpf 1.8  // 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.2  // 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.8  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20 mike  1.2  // 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.8  // 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.2  // 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: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
 31            //
 32 kumpf 1.3  // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 33 kumpf 1.9  //              Carol Ann Krug Graves, Hewlett-Packard Company
 34            //                (carolann_graves@hp.com)
 35 mike  1.2  //
 36            //%/////////////////////////////////////////////////////////////////////////////
 37            
 38 kumpf 1.4  #include "CIMParamValueRep.h"
 39 mike  1.2  #include "CIMParamValue.h"
 40            
 41            PEGASUS_NAMESPACE_BEGIN
 42            
 43            #define PEGASUS_ARRAY_T CIMParamValue
 44            # include "ArrayImpl.h"
 45            #undef PEGASUS_ARRAY_T
 46            
 47 kumpf 1.3  
 48            CIMParamValue::CIMParamValue()
 49                : _rep(0)
 50            {
 51            }
 52            
 53            CIMParamValue::CIMParamValue(const CIMParamValue& x)
 54            {
 55                Inc(_rep = x._rep);
 56            }
 57            
 58            CIMParamValue::CIMParamValue(CIMParamValueRep* rep)
 59                : _rep(rep)
 60            {
 61            }
 62            
 63            CIMParamValue& CIMParamValue::operator=(const CIMParamValue& x)
 64            {
 65                if (x._rep != _rep)
 66                {
 67                    Dec(_rep);
 68 kumpf 1.3          Inc(_rep = x._rep);
 69                }
 70                return *this;
 71            }
 72            
 73            CIMParamValue::CIMParamValue(
 74                String parameterName,
 75                CIMValue value,
 76                Boolean isTyped)
 77            {
 78                _rep = new CIMParamValueRep(parameterName, value, isTyped);
 79            }
 80            
 81            CIMParamValue::~CIMParamValue()
 82            {
 83                Dec(_rep);
 84            }
 85            
 86            String CIMParamValue::getParameterName() const 
 87            { 
 88                _checkRep();
 89 kumpf 1.3      return _rep->getParameterName();
 90            }
 91            
 92            CIMValue CIMParamValue::getValue() const 
 93            { 
 94                _checkRep();
 95                return _rep->getValue();
 96            }
 97            
 98            Boolean CIMParamValue::isTyped() const 
 99            { 
100                _checkRep();
101                return _rep->isTyped();
102            }
103            
104            void CIMParamValue::setParameterName(String& parameterName)
105            { 
106                _checkRep();
107                _rep->setParameterName(parameterName);
108            }
109            
110 kumpf 1.3  void CIMParamValue::setValue(CIMValue& value)
111            { 
112                _checkRep();
113                _rep->setValue(value);
114            }
115            
116            void CIMParamValue::setIsTyped(Boolean isTyped)
117            { 
118                _checkRep();
119                _rep->setIsTyped(isTyped);
120            }
121            
122 kumpf 1.9  Boolean CIMParamValue::isUninitialized() const
123 kumpf 1.3  {
124 kumpf 1.6      return (_rep == 0)? true : false;
125 kumpf 1.3  }
126            
127            CIMParamValue CIMParamValue::clone() const
128            {
129                return CIMParamValue(_rep->clone());
130            }
131            
132            void CIMParamValue::_checkRep() const
133            {
134                if (!_rep)
135 kumpf 1.11         throw UninitializedObjectException();
136 mike  1.2  }
137            
138            PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2