1 martin 1.45 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.46 //
|
3 martin 1.45 // 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.46 //
|
10 martin 1.45 // 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.46 //
|
17 martin 1.45 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.46 //
|
20 martin 1.45 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.46 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.45 // 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.46 //
|
28 martin 1.45 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.12 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_QualifierDecl_h
33 #define Pegasus_QualifierDecl_h
34
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.28 #include <Pegasus/Common/Linkage.h>
37 #include <Pegasus/Common/CIMName.h>
|
38 kumpf 1.17 #include <Pegasus/Common/Array.h>
39 #include <Pegasus/Common/CIMQualifierDecl.h>
40 #include <Pegasus/Common/CIMFlavor.h>
41 #include <Pegasus/Common/CIMScope.h>
42 #include <Pegasus/Common/CIMType.h>
43 #include <Pegasus/Common/CIMValue.h>
|
44 mike 1.12
45 PEGASUS_NAMESPACE_BEGIN
46
47 ////////////////////////////////////////////////////////////////////////////////
48 //
49 // CIMQualifierDecl
50 //
51 ////////////////////////////////////////////////////////////////////////////////
52
53 class CIMConstQualifierDecl;
54 class CIMClassRep;
|
55 sage 1.24 class CIMQualifierDeclRep;
|
56 kumpf 1.34
|
57 kumpf 1.41 /**
58 A CIMQualifierDecl represents a DMTF standard CIM qualifier declaration.
59 A CIMQualifierDecl differs from a CIMQualifier in that it has a scope
60 attribute. A CIMQualifierDecl defines a qualifier, whereas a CIMQualifier
61 applies the qualifier.
62
63 <p>The CIMQualifierDecl class uses a shared representation model, such
64 that multiple CIMQualifierDecl objects may refer to the same data copy.
65 Assignment and copy operators create new references to the same data, not
66 distinct copies. An update to a CIMQualifierDecl object affects all the
67 CIMQualifierDecl objects that refer to the same data copy. The data
68 remains valid until all the CIMQualifierDecl objects that refer to it are
69 destructed. A separate copy of the data may be created using the clone
70 method.
|
71 mike 1.12 */
72 class PEGASUS_COMMON_LINKAGE CIMQualifierDecl
73 {
74 public:
|
75 kumpf 1.41
76 /**
77 Constructs an uninitialized CIMQualifierDecl object. A method
78 invocation on an uninitialized object will result in the throwing
79 of an UninitializedObjectException. An uninitialized object may
80 be converted into an initialized object only by using the assignment
81 operator with an initialized object.
82 */
|
83 kumpf 1.17 CIMQualifierDecl();
|
84 mike 1.12
|
85 kumpf 1.41 /**
86 Constructs a CIMQualifierDecl object from the value of a specified
87 CIMQualifierDecl object, so that both objects refer to the same data
88 copy.
89 @param x The CIMQualifierDecl object from which to construct a new
90 CIMQualifierDecl object.
91 */
|
92 kumpf 1.17 CIMQualifierDecl(const CIMQualifierDecl& x);
|
93 mike 1.12
|
94 kumpf 1.41 /**
95 Constructs a CIMQualifierDecl object with the specified attributes.
96 @param name A CIMName specifying the name of the qualifier.
97 @param value A CIMValue specifying the default qualifier value, and
98 implicitly defining the qualifier type and whether the qualifier
99 is an Array qualifier.
100 @param scope A CIMScope indicating the qualifier scope.
101 @param flavor A CIMFlavor indicating the qualifier flavors.
102 @param arraySize A Uint32 indicating the size of the Array, if the
103 qualifier is an Array qualifier. The default value of zero
104 indicates a variable size array.
105 @exception UninitializedObjectException If the qualifier name is null.
|
106 mike 1.12 */
107 CIMQualifierDecl(
|
108 kumpf 1.42 const CIMName& name,
109 const CIMValue& value,
|
110 kumpf 1.32 const CIMScope & scope,
111 const CIMFlavor & flavor = CIMFlavor (CIMFlavor::DEFAULTS),
|
112 kumpf 1.17 Uint32 arraySize = 0);
113
|
114 kumpf 1.41 /**
115 Destructs the CIMQualifierDecl object.
116 */
|
117 kumpf 1.17 ~CIMQualifierDecl();
118
|
119 kumpf 1.41 /**
120 Assigns the value of the specified CIMQualifierDecl object to this
121 object, so that both objects refer to the same data copy.
122 @param x The CIMQualifierDecl object from which to assign this
123 CIMQualifierDecl object.
124 @return A reference to this CIMQualifierDecl object.
125 */
|
126 kumpf 1.17 CIMQualifierDecl& operator=(const CIMQualifierDecl& x);
|
127 mike 1.12
|
128 kumpf 1.41 /**
129 Gets the name of the qualifier.
130 @return A CIMName containing the name of the qualifier.
131 @exception UninitializedObjectException If the object is not
132 initialized.
|
133 kumpf 1.17 */
|
134 kumpf 1.28 const CIMName& getName() const;
|
135 mike 1.12
|
136 kumpf 1.41 /**
137 Sets the qualifier name.
138 @param name A CIMName containing the new name of the qualifier.
139 @exception UninitializedObjectException If the object is not
140 initialized.
|
141 mike 1.12 */
|
142 kumpf 1.28 void setName(const CIMName& name);
|
143 mike 1.12
|
144 kumpf 1.41 /**
145 Gets the qualifier type.
146 @return A CIMType containing the qualifier type.
147 @exception UninitializedObjectException If the object is not
148 initialized.
|
149 mike 1.12 */
|
150 kumpf 1.17 CIMType getType() const;
151
|
152 kumpf 1.41 /**
153 Checks whether the qualifier is an Array qualifier.
154 @return True if the qualifier is an Array qualifier, false otherwise.
155 @exception UninitializedObjectException If the object is not
156 initialized.
|
157 mike 1.12 */
|
158 kumpf 1.17 Boolean isArray() const;
159
|
160 kumpf 1.41 /**
161 Gets the qualifier default value.
162 @return A CIMValue containing the qualifier default value.
163 @exception UninitializedObjectException If the object is not
164 initialized.
165 */
|
166 kumpf 1.17 const CIMValue& getValue() const;
167
|
168 kumpf 1.41 /**
169 Sets the qualifier default value.
|
170 kumpf 1.44 @param value A CIMValue containing the new default value of the
|
171 kumpf 1.41 qualifier.
172 @exception UninitializedObjectException If the object is not
173 initialized.
174 */
|
175 kumpf 1.17 void setValue(const CIMValue& value);
176
|
177 kumpf 1.41 /**
178 Gets the qualifier scope.
179 @return A CIMScope containing the qualifier scope.
180 @exception UninitializedObjectException If the object is not
181 initialized.
182 */
|
183 kumpf 1.31 const CIMScope & getScope() const;
|
184 kumpf 1.17
|
185 kumpf 1.41 /**
186 Gets the qualifier flavors.
187 @return A CIMFlavor containing the qualifier flavor settings.
188 @exception UninitializedObjectException If the object is not
189 initialized.
|
190 kumpf 1.17 */
|
191 kumpf 1.32 const CIMFlavor & getFlavor() const;
|
192 karl 1.14
|
193 kumpf 1.41 /**
194 Gets the array size for the qualifier.
195 @return Uint32 array size.
196 @exception UninitializedObjectException If the object is not
197 initialized.
198 */
|
199 kumpf 1.17 Uint32 getArraySize() const;
|
200 mike 1.12
|
201 kumpf 1.41 /**
202 Determines whether the object has been initialized.
203 @return True if the object has not been initialized, false otherwise.
|
204 kumpf 1.35 */
|
205 kumpf 1.30 Boolean isUninitialized() const;
|
206 kumpf 1.42
|
207 kumpf 1.41 /**
208 Compares the qualifier declaration with another qualifier declaration.
209 @param x The CIMConstQualifierDecl to be compared.
210 @return True if this qualifier declaration is identical to the one
211 specified, false otherwise.
212 @exception UninitializedObjectException If either of the objects
213 is not initialized.
214 */
|
215 mike 1.12 Boolean identical(const CIMConstQualifierDecl& x) const;
|
216 kumpf 1.17
|
217 kumpf 1.41 /**
218 Makes a deep copy of the qualifier declaration. This creates a new
219 copy of all the qualifier declaration attributes.
220 @return A new copy of the CIMQualifierDecl object.
221 @exception UninitializedObjectException If the object is not
222 initialized.
223 */
|
224 kumpf 1.17 CIMQualifierDecl clone() const;
|
225 mike 1.12
|
226 kumpf 1.17 private:
|
227 mike 1.12
|
228 kumpf 1.17 CIMQualifierDecl(CIMQualifierDeclRep* rep);
|
229 mike 1.12
230 CIMQualifierDeclRep* _rep;
|
231 kumpf 1.19
|
232 mike 1.12 friend class CIMConstQualifierDecl;
233 friend class CIMClassRep;
|
234 kumpf 1.19 friend class XmlWriter;
|
235 kumpf 1.20 friend class MofWriter;
|
236 mike 1.12 };
237
238 ////////////////////////////////////////////////////////////////////////////////
239 //
240 // CIMConstQualifierDecl
241 //
242 ////////////////////////////////////////////////////////////////////////////////
243
|
244 kumpf 1.41 /**
245 The CIMConstQualifierDecl class provides a const interface to a
246 CIMQualifierDecl object. This class is needed because the shared
247 representation model used by CIMQualifierDecl does not prevent
248 modification to a const CIMQualifierDecl object. Note that the value
249 of a CIMConstQualifierDecl object could still be modified by a
250 CIMQualifierDecl object that refers to the same data copy.
251 */
|
252 mike 1.12 class PEGASUS_COMMON_LINKAGE CIMConstQualifierDecl
253 {
254 public:
|
255 kumpf 1.41
256 /**
257 Constructs an uninitialized CIMConstQualifierDecl object. A method
258 invocation on an uninitialized object will result in the throwing
259 of an UninitializedObjectException. An uninitialized object may
260 be converted into an initialized object only by using the assignment
261 operator with an initialized object.
262 */
|
263 kumpf 1.17 CIMConstQualifierDecl();
264
|
265 kumpf 1.41 /**
266 Constructs a CIMConstQualifierDecl object from the value of a
267 specified CIMConstQualifierDecl object, so that both objects refer
268 to the same data copy.
269 @param x The CIMConstQualifierDecl object from which to construct a
270 new CIMConstQualifierDecl object.
271 */
|
272 kumpf 1.17 CIMConstQualifierDecl(const CIMConstQualifierDecl& x);
273
|
274 kumpf 1.41 /**
275 Constructs a CIMConstQualifierDecl object from the value of a
276 specified CIMQualifierDecl object, so that both objects refer
277 to the same data copy.
278 @param x The CIMQualifierDecl object from which to construct a
279 new CIMConstQualifierDecl object.
280 */
|
281 kumpf 1.17 CIMConstQualifierDecl(const CIMQualifierDecl& x);
282
|
283 kumpf 1.41 /**
284 Constructs a CIMConstQualifierDecl object with the specified
285 attributes.
286 @param name A CIMName specifying the name of the qualifier.
287 @param value A CIMValue specifying the default qualifier value, and
288 implicitly defining the qualifier type and whether the qualifier
289 is an Array qualifier.
290 @param scope A CIMScope indicating the qualifier scope.
291 @param flavor A CIMFlavor indicating the qualifier flavors.
292 @param arraySize A Uint32 indicating the size of the Array, if the
293 qualifier is an Array qualifier. The default value of zero
294 indicates a variable size array.
295 @exception UninitializedObjectException If the qualifier name is null.
|
296 kumpf 1.17 */
|
297 mike 1.12 CIMConstQualifierDecl(
|
298 kumpf 1.42 const CIMName& name,
299 const CIMValue& value,
|
300 kumpf 1.32 const CIMScope & scope,
301 const CIMFlavor & flavor = CIMFlavor (CIMFlavor::DEFAULTS),
|
302 kumpf 1.17 Uint32 arraySize = 0);
303
|
304 kumpf 1.41 /**
305 Destructs the CIMConstQualifierDecl object.
306 */
|
307 kumpf 1.17 ~CIMConstQualifierDecl();
308
|
309 kumpf 1.41 /**
310 Assigns the value of the specified CIMConstQualifierDecl object to
311 this object, so that both objects refer to the same data copy.
312 @param x The CIMConstQualifierDecl object from which to assign this
313 CIMConstQualifierDecl object.
314 @return A reference to this CIMConstQualifierDecl object.
315 */
|
316 kumpf 1.17 CIMConstQualifierDecl& operator=(const CIMConstQualifierDecl& x);
317
|
318 kumpf 1.41 /**
319 Assigns the value of the specified CIMQualifierDecl object to
320 this object, so that both objects refer to the same data copy.
321 @param x The CIMQualifierDecl object from which to assign this
322 CIMConstQualifierDecl object.
323 @return A reference to this CIMConstQualifierDecl object.
324 */
|
325 kumpf 1.17 CIMConstQualifierDecl& operator=(const CIMQualifierDecl& x);
326
|
327 kumpf 1.41 /**
328 Gets the name of the qualifier.
329 @return A CIMName containing the name of the qualifier.
330 @exception UninitializedObjectException If the object is not
331 initialized.
332 */
|
333 kumpf 1.28 const CIMName& getName() const;
|
334 kumpf 1.17
|
335 kumpf 1.41 /**
336 Gets the qualifier type.
337 @return A CIMType containing the qualifier type.
338 @exception UninitializedObjectException If the object is not
339 initialized.
340 */
|
341 kumpf 1.17 CIMType getType() const;
342
|
343 kumpf 1.41 /**
344 Checks whether the qualifier is an Array qualifier.
345 @return True if the qualifier is an Array qualifier, false otherwise.
346 @exception UninitializedObjectException If the object is not
347 initialized.
348 */
|
349 kumpf 1.17 Boolean isArray() const;
350
|
351 kumpf 1.41 /**
352 Gets the qualifier default value.
353 @return A CIMValue containing the qualifier default value.
354 @exception UninitializedObjectException If the object is not
355 initialized.
356 */
|
357 kumpf 1.17 const CIMValue& getValue() const;
358
|
359 kumpf 1.41 /**
360 Gets the qualifier scope.
361 @return A CIMScope containing the qualifier scope.
362 @exception UninitializedObjectException If the object is not
363 initialized.
364 */
|
365 kumpf 1.31 const CIMScope & getScope() const;
|
366 kumpf 1.17
|
367 kumpf 1.41 /**
368 Gets the qualifier flavors.
369 @return A CIMFlavor containing the qualifier flavor settings.
370 @exception UninitializedObjectException If the object is not
371 initialized.
372 */
|
373 kumpf 1.32 const CIMFlavor & getFlavor() const;
|
374 kumpf 1.17
|
375 kumpf 1.41 /**
376 Gets the array size for the qualifier.
377 @return Uint32 array size.
378 @exception UninitializedObjectException If the object is not
379 initialized.
380 */
|
381 kumpf 1.17 Uint32 getArraySize() const;
382
|
383 kumpf 1.41 /**
384 Determines whether the object has been initialized.
385 @return True if the object has not been initialized, false otherwise.
386 */
|
387 kumpf 1.30 Boolean isUninitialized() const;
|
388 kumpf 1.17
|
389 kumpf 1.41 /**
390 Compares the qualifier declaration with another qualifier declaration.
391 @param x The CIMConstQualifierDecl to be compared.
392 @return True if this qualifier declaration is identical to the one
393 specified, false otherwise.
394 @exception UninitializedObjectException If either of the objects
395 is not initialized.
396 */
|
397 kumpf 1.17 Boolean identical(const CIMConstQualifierDecl& x) const;
398
|
399 kumpf 1.41 /**
400 Makes a deep copy of the qualifier declaration. This creates a new
401 copy of all the qualifier declaration attributes.
402 @return A CIMQualifierDecl object with a separate copy of the
403 CIMConstQualifierDecl object.
404 @exception UninitializedObjectException If the object is not
405 initialized.
406 */
|
407 kumpf 1.17 CIMQualifierDecl clone() const;
|
408 mike 1.12
409 private:
410
411 CIMQualifierDeclRep* _rep;
|
412 kumpf 1.19
|
413 mike 1.12 friend class CIMQualifierDecl;
|
414 kumpf 1.19 friend class XmlWriter;
|
415 kumpf 1.20 friend class MofWriter;
|
416 mike 1.12 };
417
418 #define PEGASUS_ARRAY_T CIMQualifierDecl
|
419 kumpf 1.21 # include <Pegasus/Common/ArrayInter.h>
|
420 mike 1.12 #undef PEGASUS_ARRAY_T
421
422 PEGASUS_NAMESPACE_END
423
424 #endif /* Pegasus_QualifierDecl_h */
|