(file) Return to CIMQualifier.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2