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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2