1 martin 1.23 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.24 //
|
3 martin 1.23 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.24 //
|
10 martin 1.23 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.24 //
|
17 martin 1.23 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.24 //
|
20 martin 1.23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.24 //
|
28 martin 1.23 //////////////////////////////////////////////////////////////////////////
|
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 thilo.boehm 1.22 _rep = x._rep;
50 if (_rep)
51 _rep->Inc();
|
52 kumpf 1.3 }
53
54 CIMParamValue::CIMParamValue(CIMParamValueRep* rep)
55 : _rep(rep)
56 {
57 }
58
59 CIMParamValue& CIMParamValue::operator=(const CIMParamValue& x)
60 {
61 if (x._rep != _rep)
62 {
|
63 thilo.boehm 1.22 if (_rep)
64 _rep->Dec();
65 _rep = x._rep;
66 if (_rep)
67 _rep->Inc();
|
68 kumpf 1.3 }
69 return *this;
70 }
71
72 CIMParamValue::CIMParamValue(
73 String parameterName,
74 CIMValue value,
75 Boolean isTyped)
76 {
77 _rep = new CIMParamValueRep(parameterName, value, isTyped);
78 }
79
80 CIMParamValue::~CIMParamValue()
81 {
|
82 thilo.boehm 1.22 if (_rep)
83 _rep->Dec();
|
84 kumpf 1.3 }
85
|
86 kumpf 1.18 String CIMParamValue::getParameterName() const
87 {
|
88 marek 1.20 CheckRep(_rep);
|
89 kumpf 1.3 return _rep->getParameterName();
90 }
91
|
92 kumpf 1.18 CIMValue CIMParamValue::getValue() const
93 {
|
94 marek 1.20 CheckRep(_rep);
|
95 kumpf 1.3 return _rep->getValue();
96 }
97
|
98 kumpf 1.18 Boolean CIMParamValue::isTyped() const
99 {
|
100 marek 1.20 CheckRep(_rep);
|
101 kumpf 1.3 return _rep->isTyped();
102 }
103
104 void CIMParamValue::setParameterName(String& parameterName)
|
105 kumpf 1.18 {
|
106 marek 1.20 CheckRep(_rep);
|
107 kumpf 1.3 _rep->setParameterName(parameterName);
108 }
109
110 void CIMParamValue::setValue(CIMValue& value)
|
111 kumpf 1.18 {
|
112 marek 1.20 CheckRep(_rep);
|
113 kumpf 1.3 _rep->setValue(value);
114 }
115
116 void CIMParamValue::setIsTyped(Boolean isTyped)
|
117 kumpf 1.18 {
|
118 marek 1.20 CheckRep(_rep);
|
119 kumpf 1.3 _rep->setIsTyped(isTyped);
120 }
121
|
122 kumpf 1.9 Boolean CIMParamValue::isUninitialized() const
|
123 kumpf 1.3 {
|
124 kumpf 1.19 return _rep == 0;
|
125 kumpf 1.3 }
126
127 CIMParamValue CIMParamValue::clone() const
128 {
|
129 marek 1.20 CheckRep(_rep);
|
130 kumpf 1.3 return CIMParamValue(_rep->clone());
131 }
132
|
133 mike 1.2 PEGASUS_NAMESPACE_END
|