1 martin 1.26 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.27 //
|
3 martin 1.26 // 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.27 //
|
10 martin 1.26 // 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.27 //
|
17 martin 1.26 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.27 //
|
20 martin 1.26 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.27 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.26 // 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.27 //
|
28 martin 1.26 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.2 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_ParamValue_h
33 #define Pegasus_ParamValue_h
34
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.8 #include <Pegasus/Common/String.h>
37 #include <Pegasus/Common/CIMValue.h>
|
38 kumpf 1.14 #include <Pegasus/Common/Linkage.h>
|
39 mike 1.2
40 PEGASUS_NAMESPACE_BEGIN
|
41 kumpf 1.8
42 class CIMParamValueRep;
|
43 mike 1.2
44 ////////////////////////////////////////////////////////////////////////////////
45 //
46 // CIMParamValue
47 //
48 ////////////////////////////////////////////////////////////////////////////////
49
|
50 kumpf 1.23 /**
51 The CIMParamValue class represents an extrinsic method parameter value,
52 as defined in the DMTF Specification for CIM Operations over HTTP.
53
54 <p>The CIMParamValue class uses a shared representation model, such that
55 multiple CIMParamValue objects may refer to the same data copy. Assignment
56 and copy operators create new references to the same data, not distinct
57 copies. An update to a CIMParamValue object affects all the CIMParamValue
58 objects that refer to the same data copy. The data remains valid until
59 all the CIMParamValue objects that refer to it are destructed. A separate
60 copy of the data may be created using the clone method.
61 */
|
62 mike 1.2 class PEGASUS_COMMON_LINKAGE CIMParamValue
63 {
64 public:
65
|
66 kumpf 1.23 /**
67 Constructs an uninitialized CIMParamValue object. A method
68 invocation on an uninitialized object will result in the throwing
69 of an UninitializedObjectException. An uninitialized object may
70 be converted into an initialized object only by using the assignment
71 operator with an initialized object.
72 */
|
73 kumpf 1.6 CIMParamValue();
|
74 mike 1.2
|
75 kumpf 1.23 /**
76 Constructs a CIMParamValue object from the value of a specified
77 CIMParamValue object, so that both objects refer to the same data
78 copy.
79 @param x The CIMParamValue object from which to construct a new
80 CIMParamValue object.
81 */
|
82 kumpf 1.6 CIMParamValue(const CIMParamValue& x);
|
83 mike 1.2
|
84 kumpf 1.23 /**
85 Assigns the value of the specified CIMParamValue object to this
86 object, so that both objects refer to the same data copy.
87 @param x The CIMParamValue object from which to assign this
88 CIMParamValue object.
89 @return A reference to this CIMParamValue object.
90 */
|
91 kumpf 1.6 CIMParamValue& operator=(const CIMParamValue& x);
|
92 mike 1.2
|
93 kumpf 1.23 /**
94 Constructs a parameter value with the specified attributes.
95 @param parameterName A String containing the name of this parameter.
96 @param value A CIMValue containing the value of this parameter.
97 @param isTyped A Boolean indicating whether the type indicated in
98 the value is correct. This is needed because the Specification
99 for the Representation of CIM in XML does not require type
100 information to be specified with a parameter value.
101 @exception UninitializedObjectException If the parameter name is an
102 empty String.
103 */
|
104 mike 1.2 CIMParamValue(
|
105 kumpf 1.24 String parameterName,
106 CIMValue value,
107 Boolean isTyped=true);
|
108 kumpf 1.6
|
109 kumpf 1.23 /**
110 Destructs the CIMParamValue object.
111 */
|
112 kumpf 1.6 ~CIMParamValue();
|
113 mike 1.2
|
114 kumpf 1.23 /**
115 Gets the parameter name for the parameter value.
116 @return A String containing the parameter name.
117 @exception UninitializedObjectException If the object is not
118 initialized.
119 */
|
120 kumpf 1.6 String getParameterName() const;
121
|
122 kumpf 1.23 /**
123 Gets the value for the parameter.
124 @return A CIMValue containing the parameter value.
125 @exception UninitializedObjectException If the object is not
126 initialized.
127 */
|
128 kumpf 1.6 CIMValue getValue() const;
|
129 mike 1.2
|
130 kumpf 1.23 /**
131 Checks whether the parameter value has the correct type.
132 @return True if the parameter value is known to have the correct
133 type, false otherwise.
134 @exception UninitializedObjectException If the object is not
135 initialized.
136 */
|
137 kumpf 1.6 Boolean isTyped() const;
|
138 mike 1.2
|
139 kumpf 1.23 /**
140 Sets the parameter name for the parameter value.
141 @param parameterName A String containing the parameter name.
142 @exception UninitializedObjectException If the object is not
143 initialized.
144 */
|
145 kumpf 1.6 void setParameterName(String& parameterName);
|
146 mike 1.2
|
147 kumpf 1.23 /**
148 Sets the value for the parameter.
149 @param value A CIMValue containing the parameter value.
150 @exception UninitializedObjectException If the object is not
151 initialized.
152 */
|
153 kumpf 1.6 void setValue(CIMValue& value);
|
154 mike 1.2
|
155 kumpf 1.23 /**
156 Sets a flag indicating whether the parameter value has the correct
157 type.
158 @param isTyped A Boolean indicating whether the parameter value is
159 known to have the correct type.
160 @exception UninitializedObjectException If the object is not
161 initialized.
162 */
|
163 kumpf 1.16 void setIsTyped(Boolean isTyped);
|
164 mike 1.2
|
165 kumpf 1.23 /**
166 Makes a deep copy of the object. This creates a new copy of all
167 the object attributes.
168 @return A new copy of the CIMParamValue object.
169 @exception UninitializedObjectException If the object is not
170 initialized.
171 */
|
172 kumpf 1.6 CIMParamValue clone() const;
|
173 mike 1.2
|
174 kumpf 1.23 /**
175 Determines whether the object has been initialized.
176 @return True if the object has not been initialized, false otherwise.
177 */
|
178 kumpf 1.15 Boolean isUninitialized() const;
|
179 mike 1.2
180 private:
181
|
182 kumpf 1.6 CIMParamValue(CIMParamValueRep* rep);
183
|
184 mike 1.2 CIMParamValueRep* _rep;
|
185 kumpf 1.11
186 friend class XmlWriter;
|
187 mike 1.2 };
188
189 #define PEGASUS_ARRAY_T CIMParamValue
|
190 kumpf 1.12 # include <Pegasus/Common/ArrayInter.h>
|
191 mike 1.2 #undef PEGASUS_ARRAY_T
192
193 PEGASUS_NAMESPACE_END
194
195 #endif /* Pegasus_ParamValue_h */
|