1 mike 1.12 //%/////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to
7 // deal in the Software without restriction, including without limitation the
8 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 // sell copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
13 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
14 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 //
21 //==============================================================================
22 mike 1.12 //
23 // Author: Mike Brasher (mbrasher@bmc.com)
24 //
|
25 karl 1.16 // Modified By: Karl Schopmeyer (k.schopmeyer@opengroup.org)
|
26 kumpf 1.20 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
27 mike 1.12 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30 /*
31 CIMQualifier.h - Defines the CIM qualifiers class.
32
33 */
34
35 #ifndef Pegasus_Qualifier_h
36 #define Pegasus_Qualifier_h
37
38 #include <Pegasus/Common/Config.h>
|
39 karl 1.15 #include <Pegasus/Common/CIMFlavor.h>
|
40 kumpf 1.20 #include <Pegasus/Common/CIMType.h>
41 #include <Pegasus/Common/CIMValue.h>
|
42 mike 1.12
43 PEGASUS_NAMESPACE_BEGIN
44
45 ////////////////////////////////////////////////////////////////////////////////
46 //
47 // CIMQualifier
48 //
49 ////////////////////////////////////////////////////////////////////////////////
50
51 class CIMConstQualifier;
52 class CIMClassRep;
53
54 /** Class CIMQualifier - This class defines the Pegasus implementation of the
|
55 kumpf 1.20 CIM Qualifier \Ref{QUALIFIER}. It is almost identical to
56 CIMQualifierDecl except that it has no scope member. \Ref{CIMQualifierDecl}
|
57 karl 1.18 This includes functions to create qualifiers and manipulate/test
58 the individual components of the CIMQualifier.
|
59 kumpf 1.20 CIMQualifiers are accumulated into lists for use in CIMClasses and CIM
60 Properties using the CIMQualifierList Class and its
61 functions. \Ref{CIMQualifierList}
|
62 mike 1.12 */
63 class PEGASUS_COMMON_LINKAGE CIMQualifier
64 {
65 public:
66
67 /** Constructor instantiates a CIM qualifier with empty name value
68 fields.Constructor
69 @return instantiated empty qualifier object
70 */
|
71 kumpf 1.20 CIMQualifier();
|
72 mike 1.12
|
73 kumpf 1.20 /** Constructor - instantiates a CIM qualifier object from another
74 qualifier object.
75 @param CIM CIMQualifier object
76 @return - Instantiated qualifier object
77 */
78 CIMQualifier(const CIMQualifier& x);
|
79 mike 1.12
80 /** Constructor - Instantiates a CIM qualifier object with the parameters
|
81 kumpf 1.20 defined on input.
82 @param String representing CIMName for the new qualifier
83 @param value
84 @param flavor - Flavor defined for this qualifier definition. Default
85 for this parameter is CIMFlavor::NONE.
86 @param propoagated - Boolean defining whether this is a propagated
87 qualifier. This is an optional parameter with default = false
88 @return -Returns the instantiated qualifier object or throws an
89 exception if the name argument is illegal
|
90 mike 1.12
|
91 kumpf 1.20 @exception Throws IllegalName if name argument not legal CIM
92 identifier.
93 */
|
94 mike 1.12 CIMQualifier(
95 const String& name,
96 const CIMValue& value,
|
97 karl 1.17 Uint32 flavor = CIMFlavor::NONE,
|
98 kumpf 1.20 Boolean propagated = false);
99
|
100 mike 1.12 /// destructor
|
101 kumpf 1.20 ~CIMQualifier();
102
|
103 mike 1.12 /// operator
|
104 kumpf 1.20 CIMQualifier& operator=(const CIMQualifier& x);
|
105 mike 1.12
|
106 karl 1.18 /** getName - Returns the name field from the qualifier
|
107 kumpf 1.20 @return String containing the qualifier name.
|
108 mike 1.12 */
|
109 kumpf 1.20 const String& getName() const;
|
110 mike 1.12
|
111 karl 1.15 /** setName - Sets the qualifier name field in the qualifier object.
112 @param name - String containing the name for the qualifier
|
113 kumpf 1.20 @exception Throws IllegalName if name argument not legal CIM identifier.
|
114 mike 1.12 */
|
115 kumpf 1.20 void setName(const String& name);
|
116 mike 1.12
|
117 karl 1.18 /** getType - Gets the type field from the qualifier object.
|
118 kumpf 1.20 @return CIMType containing the type for this qualifier /Ref{CIMType}.
|
119 mike 1.12 */
|
120 kumpf 1.20 CIMType getType() const;
|
121 mike 1.12
|
122 karl 1.15 /** isArray - Returns true if the qualifier is an array
|
123 karl 1.18 @return Boolean true if array qualifier.
|
124 mike 1.12 */
|
125 kumpf 1.20 Boolean isArray() const;
|
126 mike 1.12
|
127 karl 1.15 /** getValue - Gets the value component of the qualifier object
128 @return CIMValue containing the value component
|
129 mike 1.12 */
|
130 kumpf 1.20 const CIMValue& getValue() const;
|
131 mike 1.12
|
132 karl 1.15 /** setValue - Puts a CIMValue object into a CIMQualifier object
133 @param value - The CIMValue object to install
|
134 mike 1.12 */
|
135 kumpf 1.20 void setValue(const CIMValue& value);
136
137 /** setFlavor - Sets the bits defined on input into the Flavor variable
138 for the Qualifier Object.
139 @param flavor - Uint32 defines the flavor bits to be set.
140 */
141 void setFlavor(Uint32 flavor);
142
143 /** unsetFlavor - Resets the bits defined for the flavor
144 for the Qualifier Object with the input.
145 @param flavor - Uint32 defines the flavor bits to be set.
146 */
147 void unsetFlavor(Uint32 flavor);
|
148 karl 1.16
|
149 karl 1.15 /** getFlavor - Gets the Flavor field from a Qualifier
|
150 karl 1.18 @return - Uint32 with the Flavor flags that can be tested
|
151 karl 1.16 against the CIMFlavor constants.
|
152 mike 1.12 */
|
153 kumpf 1.20 Uint32 getFlavor() const;
154
|
155 karl 1.18 /** isFlavor - Boolean function that determines if particular flavor
|
156 karl 1.16 flags are set in the flavor variable of a qualifier.
157 @param flavor - The flavor bits to test.
158 Return True if the defined flavor is set.
159 <pre>
160 if (q.isFlavor(CIMType::TOSUBCLASS)
161 do something based on TOSUBCLASS being true
162 </pre>
|
163 karl 1.18 */
|
164 kumpf 1.20 Boolean isFlavor(Uint32 flavor) const;
165
166 /** resolveFlavor - Function used only in object creation to
167 resolve the combination of a qualifer flavor input and
168 the corresponding inherited flavor from declaration or
169 superclass and set the current qualifier to that
170 definition. The functions changes the current flavor based
171 on the characteristics of the inheritance.
172 @param inheritedFlavor - The flavor inherited from higher level
173 @param inherited - True if inherited from definition. False if this
174 is definition that inherits from the declaration
175 */
176 void resolveFlavor(Uint32 inheritedFlavor, Boolean inherited);
177
|
178 karl 1.17 /** getPropagated returns the propagated indicator
179 @return Uint32 - TBD
|
180 karl 1.18 */
|
181 kumpf 1.20 const Uint32 getPropagated() const;
|
182 mike 1.12
|
183 karl 1.18 /** setPropagated - Sets the Propagated flag for the object.
|
184 mike 1.12 */
|
185 kumpf 1.20 void setPropagated(Boolean propagated);
|
186 mike 1.12
|
187 kumpf 1.20 #ifdef PEGASUS_INTERNALONLY
|
188 mike 1.12 /** CIMMethod
189 */
|
190 kumpf 1.21 Boolean isNull() const;
|
191 kumpf 1.20 #endif
|
192 mike 1.12
|
193 mike 1.13 /** identical - compares two CIMQualifier objects.
194 @return - True if the objects are identical.
|
195 kumpf 1.20 */
|
196 mike 1.12 Boolean identical(const CIMConstQualifier& x) const;
197
|
198 karl 1.18 /** clone Creates an exact copy of the qualifier and returns the
199 new object.
200 @return CIMQualifier New Qualifier object.
|
201 mike 1.12 */
|
202 kumpf 1.20 CIMQualifier clone() const;
|
203 mike 1.12
204 private:
205
|
206 kumpf 1.20 CIMQualifier(CIMQualifierRep* rep);
207
208 void _checkRep() const;
|
209 mike 1.12
210 CIMQualifierRep* _rep;
|
211 kumpf 1.22
|
212 mike 1.12 friend class CIMConstQualifier;
213 friend class CIMClassRep;
|
214 kumpf 1.22 friend class XmlWriter;
|
215 kumpf 1.23 friend class MofWriter;
|
216 mike 1.12 };
217
218 ////////////////////////////////////////////////////////////////////////////////
219 //
220 // CIMConstQualifier
221 //
222 ////////////////////////////////////////////////////////////////////////////////
223
224 class PEGASUS_COMMON_LINKAGE CIMConstQualifier
225 {
226 public:
227
|
228 kumpf 1.20 CIMConstQualifier();
|
229 mike 1.12
|
230 kumpf 1.20 CIMConstQualifier(const CIMConstQualifier& x);
|
231 mike 1.12
|
232 kumpf 1.20 CIMConstQualifier(const CIMQualifier& x);
|
233 mike 1.12
234 // Throws IllegalName if name argument not legal CIM identifier.
235
236 CIMConstQualifier(
237 const String& name,
238 const CIMValue& value,
|
239 kumpf 1.20 Uint32 flavor = CIMFlavor::NONE,
240 Boolean propagated = false);
241
242 ~CIMConstQualifier();
243
244 CIMConstQualifier& operator=(const CIMConstQualifier& x);
245
246 CIMConstQualifier& operator=(const CIMQualifier& x);
247
248 const String& getName() const;
249
250 CIMType getType() const;
251
252 Boolean isArray() const;
253
254 const CIMValue& getValue() const;
255
256 const Uint32 getFlavor() const;
257
258 Boolean isFlavor(Uint32 flavor) const;
|
259 karl 1.15
|
260 kumpf 1.20 Boolean isFlavorToSubclass() const;
261
262 Boolean isFlavorToInstance() const;
263
264 Boolean isFlavorOverridable() const;
265
266 const Uint32 getPropagated() const;
267
268 #ifdef PEGASUS_INTERNALONLY
|
269 kumpf 1.21 Boolean isNull() const;
|
270 kumpf 1.20 #endif
271
272 Boolean identical(const CIMConstQualifier& x) const;
273
274 CIMQualifier clone() const;
|
275 mike 1.12
276 private:
277
|
278 kumpf 1.20 void _checkRep() const;
|
279 mike 1.12
280 CIMQualifierRep* _rep;
|
281 kumpf 1.22
|
282 mike 1.12 friend class CIMQualifier;
|
283 kumpf 1.22 friend class XmlWriter;
|
284 kumpf 1.23 friend class MofWriter;
|
285 mike 1.12 };
286
287 PEGASUS_MEMORY_FUNCTIONS(CIMQualifier)
288 PEGASUS_MEMORY_FUNCTIONS(CIMQualifier*)
289
290 #define PEGASUS_ARRAY_T CIMQualifier
291 # include "ArrayInter.h"
292 #undef PEGASUS_ARRAY_T
293
294 PEGASUS_NAMESPACE_END
295
296 #endif /* Pegasus_Qualifier_h */
|