1 a.dunfey 1.38.10.1 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.12 //
|
3 karl 1.36 // 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.33 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.36 // 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.37 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 a.dunfey 1.38.10.1 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.12 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 kumpf 1.21 // 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.12 // 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 a.dunfey 1.38.10.1 //
|
21 kumpf 1.21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.12 // 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.21 // 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.12 // 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 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_Parameter_h
35 #define Pegasus_Parameter_h
36
37 #include <Pegasus/Common/Config.h>
|
38 kumpf 1.24 #include <Pegasus/Common/CIMName.h>
|
39 kumpf 1.16 #include <Pegasus/Common/CIMQualifier.h>
40 #include <Pegasus/Common/CIMType.h>
|
41 kumpf 1.23 #include <Pegasus/Common/Linkage.h>
|
42 mike 1.12
43 PEGASUS_NAMESPACE_BEGIN
44
45 ////////////////////////////////////////////////////////////////////////////////
46 //
47 // CIMParameter
48 //
49 ////////////////////////////////////////////////////////////////////////////////
50
|
51 kumpf 1.22 class Resolver;
|
52 mike 1.12 class CIMConstParameter;
|
53 kumpf 1.16 class CIMParameterRep;
|
54 mike 1.12
|
55 david.dillard 1.38 /** This class provides the interface to construct and manage CIM Parameters.
|
56 karl 1.32 CIM Parameters are the parameters attached to CIMMethods.
57 A CIM Parameter consists of:
58 <UL>
59 <LI> <B>qualifiers</B> - zero or more qualifiers.
60 <LI> <B>name</B> - The name of the parameter which must be a valid CIM name.
61 <LI> <B>type</B> - The type for the parameter, one of the inherent CIM types
|
62 david.dillard 1.38 <LI> <B>value</B> - Which is dependent on the type. The value can be
63 <UL>
64 <LI> a reference type. In this class the value is a Class reference. This must be
|
65 karl 1.32 a single value
66 <LI> an array (fixed or variable number of elements) or a single value
|
67 david.dillard 1.38 with any CIMType other than reference. The input parameters allow specifying
|
68 karl 1.32 these conditions.
|
69 david.dillard 1.38 </UL>
|
70 karl 1.32 </UL>
|
71 david.dillard 1.38
|
72 karl 1.32 ATTN: Define the form of this objec, the rep and what it means.
73 */
|
74 mike 1.12 class PEGASUS_COMMON_LINKAGE CIMParameter
75 {
76 public:
77
|
78 karl 1.32 /// Construct a NULL CIMParameter object.
|
79 kumpf 1.16 CIMParameter();
|
80 mike 1.12
|
81 karl 1.32 /** Construct a CIMParameter from another CIMParameter
|
82 david.dillard 1.38 @param CIMParameter from which the new object is to be constructed
83 */
|
84 kumpf 1.16 CIMParameter(const CIMParameter& x);
|
85 mike 1.12
|
86 david.dillard 1.38 /** Constructs a CIMParameter object with properties. The Properties
87 Must include name and type and may include the indicator whether
88 this is an array or not, the size of the array and a reference
89 class name.
90 @param name Name of the parameter, a legal CIMName.
91 @param type CIMType defining the CIM Type for this parameter
92 @param isArray Boolean indicating whether this parameter defines an
93 array.
94 @param arraySize Size of the array if this is to be a fixed size
95 array parameter. The default is zero which indicates a variable size array.
96 @param referenceClassName Optional property but required for reference
97 type parameters. This defines the class for the reference.
98 @exception TypeMismatchException Thrown if reference type and referenceClassname
99 is Null.
100 @exception TypeMismatchException Thrown if arraysize != zero and isArray true.
101 */
|
102 mike 1.12 CIMParameter(
|
103 david.dillard 1.38 const CIMName& name,
104 CIMType type,
105 Boolean isArray = false,
106 Uint32 arraySize = 0,
107 const CIMName& referenceClassName = CIMName());
|
108 kumpf 1.16
|
109 david.dillard 1.38 /** Destroys the object.
110 */
|
111 kumpf 1.16 ~CIMParameter();
112
|
113 david.dillard 1.38 /** Assignment operator. Assigns one CIMParameter to
114 another CIMParameter
115 */
|
116 kumpf 1.16 CIMParameter& operator=(const CIMParameter& x);
117
|
118 david.dillard 1.38 /** Get the name from the CIMParameter object.
119 @return CIMName containing the name from the object.
120 */
121 const CIMName& getName() const;
|
122 mike 1.12
|
123 karl 1.32 /** Set the name field in the object with a valid CIMName
|
124 david.dillard 1.38 @param name CIMName to set into the name field.
125 */
|
126 kumpf 1.24 void setName(const CIMName& name);
|
127 mike 1.12
|
128 karl 1.32 /** Test for Array type for this parameter object.
|
129 david.dillard 1.38 @return true if the value for this parameter is defined
130 as an array (is array = true).
131 */
|
132 kumpf 1.16 Boolean isArray() const;
|
133 kumpf 1.15
|
134 david.dillard 1.38 /** Get the array size for the parameter.
135 @return Uint32 array size.
136 */
|
137 kumpf 1.16 Uint32 getArraySize() const;
138
|
139 kumpf 1.31 ///
|
140 david.dillard 1.38 const CIMName& getReferenceClassName() const;
|
141 kumpf 1.16
|
142 david.dillard 1.38 /** Get the type (CIMTYPE) defined for this parameter.
143 If the parameter is not initialized the type returned is
144 TBD.
145 @return the type for this parameter defined as a CIMTYPE
146 object.
147 */
|
148 kumpf 1.16 CIMType getType() const ;
149
|
150 karl 1.32 /** Add a single qualifier object to the CIMParameter.
|
151 david.dillard 1.38 @param x CIMQualifier object to be added.
152 @exception AlreadyExistsException if a qualifier with the
153 same name already exists for this CIMParameter.
|
154 karl 1.32 */
|
155 kumpf 1.16 CIMParameter& addQualifier(const CIMQualifier& x);
156
|
157 david.dillard 1.38 /** Find a qualifier by name. Finds a single qualifier
158 based on the name input as parameter and returns an
159 index to the name.
160 @param name CIMName with the name of the qualifier to be found
161 @return Uint32 with either the index (zero origin) of
162 the parameter that was to be found or the value
163 PEG_NOT_FOUND if no parameter is found with the
164 defined name.
165 */
|
166 kumpf 1.24 Uint32 findQualifier(const CIMName& name) const;
|
167 mike 1.12
|
168 david.dillard 1.38 /** Get qualifier at index defined by input. Gets the
169 qualifier in the array of qualifiers for this parameter
170 defined by the index provided on input.
171 @param index Specifies the position in the qualifier array
172 of the qualifier to be retrieved
173 @return CIMQualifier object containing the qualifer defined
174 by the index
175 @exception IndexOutOfBoundsException thrown if index outside
176 the array of qualifiers.
177 */
|
178 kumpf 1.29 CIMQualifier getQualifier(Uint32 index);
|
179 kumpf 1.16
|
180 kumpf 1.31 /** Removes the CIMQualifier defined by the input parameter.
|
181 david.dillard 1.38 @param index Index of the qualifier to be removed.
|
182 kumpf 1.28 @exception IndexOutOfBoundsException if the index is outside
|
183 kumpf 1.31 the range of qualifiers available for the CIMParameter.
|
184 david.dillard 1.38 @exception IndexOutOfBoundsException thrown if index outside
185 the array of qualifiers.
|
186 kumpf 1.27 */
|
187 kumpf 1.29 void removeQualifier (Uint32 index);
|
188 kumpf 1.27
|
189 david.dillard 1.38 /** Get qualifier at index defined by input. Gets the
190 qualifier in the array of qualifiers for this parameter
191 defined by the index provided on input.
192 @param index Specifies the position in the qualifier array
193 of the qualifier to be retrieved
194 @return CIMQualifier object containing the qualifer defined
195 by the index
196 @exception IndexOutOfBoundsException thrown if index outside
197 the array of qualifiers.
198 */
|
199 kumpf 1.29 CIMConstQualifier getQualifier(Uint32 index) const;
|
200 kumpf 1.16
|
201 karl 1.32 /** Gets the count of qualifiers attached to this CIMParameter.
|
202 david.dillard 1.38 @return count of number of qualifiers that have been added
203 to this CIMparameter.
204 <pre>
205 // loop to access all qualifiers in a CIMparameter
206 CIMParameter parm;
207 .... // build the parameter
208 for (Uint32 i = 0 ; i < parm.getQualifierCount() ; i++
209 ....
210 </pre>
211 */
|
212 kumpf 1.16 Uint32 getQualifierCount() const;
213
|
214 karl 1.32 /** Determines if the object has not been initialized. A CIM parameter
|
215 david.dillard 1.38 is intialized only when the name and type fields have been set either
216 on construction or through the set functions.
|
217 kumpf 1.31 @return true if the object has not been initialized,
218 false otherwise.
|
219 kumpf 1.26 */
220 Boolean isUninitialized() const;
|
221 kumpf 1.16
|
222 kumpf 1.31 ///
|
223 mike 1.12 Boolean identical(const CIMConstParameter& x) const;
224
|
225 david.dillard 1.38 /** Creates a deep copy, i.e. a clone, of the associated object.
226 @return The deep copy of the associated object.
227 */
|
228 kumpf 1.16 CIMParameter clone() const;
|
229 mike 1.12
230 private:
231
|
232 kumpf 1.16 CIMParameter(CIMParameterRep* rep);
233
234 void _checkRep() const;
|
235 mike 1.12
236 CIMParameterRep* _rep;
|
237 kumpf 1.19
|
238 mike 1.12 friend class CIMConstParameter;
|
239 kumpf 1.22 friend class Resolver;
|
240 kumpf 1.18 friend class XmlWriter;
|
241 kumpf 1.19 friend class MofWriter;
|
242 schuur 1.34 friend class BinaryStreamer;
|
243 mike 1.12 };
244
245 ////////////////////////////////////////////////////////////////////////////////
246 //
247 // CIMConstParameter
248 //
249 ////////////////////////////////////////////////////////////////////////////////
250
|
251 kumpf 1.31 ///
|
252 mike 1.12 class PEGASUS_COMMON_LINKAGE CIMConstParameter
253 {
254 public:
255
|
256 kumpf 1.31 ///
|
257 kumpf 1.16 CIMConstParameter();
|
258 mike 1.12
|
259 kumpf 1.31 ///
|
260 kumpf 1.16 CIMConstParameter(const CIMConstParameter& x);
|
261 mike 1.12
|
262 kumpf 1.31 ///
|
263 kumpf 1.16 CIMConstParameter(const CIMParameter& x);
|
264 mike 1.12
|
265 kumpf 1.31 ///
|
266 mike 1.12 CIMConstParameter(
|
267 david.dillard 1.38 const CIMName& name,
268 CIMType type,
269 Boolean isArray = false,
270 Uint32 arraySize = 0,
271 const CIMName& referenceClassName = CIMName());
|
272 kumpf 1.16
|
273 kumpf 1.31 ///
|
274 kumpf 1.16 ~CIMConstParameter();
275
|
276 kumpf 1.31 ///
|
277 kumpf 1.16 CIMConstParameter& operator=(const CIMConstParameter& x);
278
|
279 kumpf 1.31 ///
|
280 kumpf 1.16 CIMConstParameter& operator=(const CIMParameter& x);
281
|
282 kumpf 1.31 ///
|
283 kumpf 1.24 const CIMName& getName() const;
|
284 kumpf 1.16
|
285 kumpf 1.31 ///
|
286 kumpf 1.16 Boolean isArray() const;
287
|
288 kumpf 1.31 ///
|
289 kumpf 1.16 Uint32 getArraySize() const;
290
|
291 kumpf 1.31 ///
|
292 kumpf 1.24 const CIMName& getReferenceClassName() const;
|
293 kumpf 1.16
|
294 kumpf 1.31 ///
|
295 kumpf 1.16 CIMType getType() const;
296
|
297 kumpf 1.31 ///
|
298 kumpf 1.24 Uint32 findQualifier(const CIMName& name) const;
|
299 kumpf 1.16
|
300 kumpf 1.31 ///
|
301 kumpf 1.29 CIMConstQualifier getQualifier(Uint32 index) const;
|
302 kumpf 1.16
|
303 kumpf 1.31 ///
|
304 kumpf 1.16 Uint32 getQualifierCount() const;
305
|
306 kumpf 1.31 ///
|
307 kumpf 1.26 Boolean isUninitialized() const;
|
308 kumpf 1.16
|
309 kumpf 1.31 ///
|
310 kumpf 1.16 Boolean identical(const CIMConstParameter& x) const;
311
|
312 kumpf 1.31 ///
|
313 kumpf 1.16 CIMParameter clone() const;
|
314 mike 1.12
315 private:
316
|
317 kumpf 1.16 void _checkRep() const;
|
318 mike 1.12
319 CIMParameterRep* _rep;
320 friend class CIMParameter;
|
321 kumpf 1.18 friend class XmlWriter;
|
322 kumpf 1.19 friend class MofWriter;
|
323 mike 1.12 };
324
325 #define PEGASUS_ARRAY_T CIMParameter
|
326 kumpf 1.20 # include <Pegasus/Common/ArrayInter.h>
|
327 mike 1.12 #undef PEGASUS_ARRAY_T
328
329 PEGASUS_NAMESPACE_END
330
331 #endif /* Pegasus_Parameter_h */
|