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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2