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

  1 a.dunfey 1.15.18.1 //%2006////////////////////////////////////////////////////////////////////////
  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 a.dunfey 1.15.18.1 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12                    // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike     1.2       //
 14                    // Permission is hereby granted, free of charge, to any person obtaining a copy
 15 kumpf    1.8       // of this software and associated documentation files (the "Software"), to
 16                    // deal in the Software without restriction, including without limitation the
 17                    // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 18 mike     1.2       // sell copies of the Software, and to permit persons to whom the Software is
 19                    // furnished to do so, subject to the following conditions:
 20                    // 
 21 kumpf    1.8       // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 mike     1.2       // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 23                    // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 24 kumpf    1.8       // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 25                    // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 26                    // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 27 mike     1.2       // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 28                    // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 29                    //
 30                    //==============================================================================
 31                    //
 32                    // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
 33                    //
 34 kumpf    1.3       // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 35 kumpf    1.9       //              Carol Ann Krug Graves, Hewlett-Packard Company
 36                    //                (carolann_graves@hp.com)
 37 mike     1.2       //
 38                    //%/////////////////////////////////////////////////////////////////////////////
 39                    
 40 kumpf    1.4       #include "CIMParamValueRep.h"
 41 mike     1.2       #include "CIMParamValue.h"
 42                    
 43                    PEGASUS_NAMESPACE_BEGIN
 44                    
 45                    #define PEGASUS_ARRAY_T CIMParamValue
 46                    # include "ArrayImpl.h"
 47                    #undef PEGASUS_ARRAY_T
 48                    
 49 kumpf    1.3       
 50                    CIMParamValue::CIMParamValue()
 51                        : _rep(0)
 52                    {
 53                    }
 54                    
 55                    CIMParamValue::CIMParamValue(const CIMParamValue& x)
 56                    {
 57                        Inc(_rep = x._rep);
 58                    }
 59                    
 60                    CIMParamValue::CIMParamValue(CIMParamValueRep* rep)
 61                        : _rep(rep)
 62                    {
 63                    }
 64                    
 65                    CIMParamValue& CIMParamValue::operator=(const CIMParamValue& x)
 66                    {
 67                        if (x._rep != _rep)
 68                        {
 69                            Dec(_rep);
 70 kumpf    1.3               Inc(_rep = x._rep);
 71                        }
 72                        return *this;
 73                    }
 74                    
 75                    CIMParamValue::CIMParamValue(
 76                        String parameterName,
 77                        CIMValue value,
 78                        Boolean isTyped)
 79                    {
 80                        _rep = new CIMParamValueRep(parameterName, value, isTyped);
 81                    }
 82                    
 83                    CIMParamValue::~CIMParamValue()
 84                    {
 85                        Dec(_rep);
 86                    }
 87                    
 88                    String CIMParamValue::getParameterName() const 
 89                    { 
 90                        _checkRep();
 91 kumpf    1.3           return _rep->getParameterName();
 92                    }
 93                    
 94                    CIMValue CIMParamValue::getValue() const 
 95                    { 
 96                        _checkRep();
 97                        return _rep->getValue();
 98                    }
 99                    
100                    Boolean CIMParamValue::isTyped() const 
101                    { 
102                        _checkRep();
103                        return _rep->isTyped();
104                    }
105                    
106                    void CIMParamValue::setParameterName(String& parameterName)
107                    { 
108                        _checkRep();
109                        _rep->setParameterName(parameterName);
110                    }
111                    
112 kumpf    1.3       void CIMParamValue::setValue(CIMValue& value)
113                    { 
114                        _checkRep();
115                        _rep->setValue(value);
116                    }
117                    
118                    void CIMParamValue::setIsTyped(Boolean isTyped)
119                    { 
120                        _checkRep();
121                        _rep->setIsTyped(isTyped);
122                    }
123                    
124 kumpf    1.9       Boolean CIMParamValue::isUninitialized() const
125 kumpf    1.3       {
126 kumpf    1.6           return (_rep == 0)? true : false;
127 kumpf    1.3       }
128                    
129                    CIMParamValue CIMParamValue::clone() const
130                    {
131                        return CIMParamValue(_rep->clone());
132                    }
133                    
134                    void CIMParamValue::_checkRep() const
135                    {
136                        if (!_rep)
137 kumpf    1.11              throw UninitializedObjectException();
138 mike     1.2       }
139                    
140                    PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2