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