(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 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                    @param name A CIMValue containing the new value of the qualifier.
166                    @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 mike  1.50.16.1     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                     void _checkRep() const;
249 mike  1.12      
250                     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 kumpf 1.23          friend class MofWriter;
257 schuur 1.44          friend class BinaryStreamer;
258 mike   1.12      };
259                  
260 kumpf  1.49      
261 mike   1.12      ////////////////////////////////////////////////////////////////////////////////
262                  //
263                  // CIMConstQualifier
264                  //
265                  ////////////////////////////////////////////////////////////////////////////////
266                  
267 kumpf  1.49      /**
268                      The CIMConstQualifier class provides a const interface to a CIMQualifier
269                      object.  This class is needed because the shared representation model
270                      used by CIMQualifier does not prevent modification to a const CIMQualifier
271                      object.  Note that the value of a CIMConstQualifier object could still be
272                      modified by a CIMQualifier object that refers to the same data copy.
273                  */
274 mike   1.12      class PEGASUS_COMMON_LINKAGE CIMConstQualifier
275                  {
276                  public:
277                  
278 kumpf  1.49          /**
279                          Constructs an uninitialized CIMConstQualifier object.  A method
280                          invocation on an uninitialized object will result in the throwing
281                          of an UninitializedObjectException.  An uninitialized object may
282                          be converted into an initialized object only by using the assignment
283                          operator with an initialized object.
284                      */
285 kumpf  1.20          CIMConstQualifier();
286 mike   1.12      
287 kumpf  1.49          /**
288                          Constructs a CIMConstQualifier object from the value of a specified
289                          CIMConstQualifier object, so that both objects refer to the same data
290                          copy.
291                          @param x The CIMConstQualifier object from which to construct a new
292                              CIMConstQualifier object.
293                      */
294 kumpf  1.20          CIMConstQualifier(const CIMConstQualifier& x);
295 mike   1.12      
296 kumpf  1.49          /**
297                          Constructs a CIMConstQualifier object from the value of a specified
298                          CIMQualifier object, so that both objects refer to the same data
299                          copy.
300                          @param x The CIMQualifier object from which to construct a new
301                              CIMConstQualifier object.
302                      */
303 kumpf  1.20          CIMConstQualifier(const CIMQualifier& x);
304 mike   1.12      
305 kumpf  1.49          /**
306                          Constructs a CIMConstQualifier object with the specified attributes.
307                          @param name A CIMName specifying the name of the qualifier.
308                          @param value A CIMValue specifying the qualifier value, and implicitly
309                              defining the qualifier type and whether the qualifier is an Array
310                              qualifier.
311                          @param flavor A CIMFlavor indicating the qualifier flavors.
312                          @param propagated A Boolean indicating whether the qualifier is local
313                              to the context in which it appears or was propagated
314                              (without modification) from other schema.
315                          @exception UninitializedObjectException If the qualifier name is null.
316                      */
317 mike   1.12          CIMConstQualifier(
318 kumpf  1.50              const CIMName& name,
319                          const CIMValue& value,
320                          const CIMFlavor & flavor = CIMFlavor (CIMFlavor::NONE),
321                          Boolean propagated = false);
322 kumpf  1.20      
323 kumpf  1.49          /**
324                          Destructs the CIMQualifier object.
325                      */
326 kumpf  1.20          ~CIMConstQualifier();
327                  
328 kumpf  1.49          /**
329                          Assigns the value of the specified CIMConstQualifier object to this
330                          object, so that both objects refer to the same data copy.
331                          @param x The CIMConstQualifier object from which to assign this
332                              CIMConstQualifier object.
333                          @return A reference to this CIMConstQualifier object.
334                      */
335 kumpf  1.20          CIMConstQualifier& operator=(const CIMConstQualifier& x);
336                  
337 kumpf  1.49          /**
338                          Assigns the value of the specified CIMQualifier object to this
339                          object, so that both objects refer to the same data copy.
340                          @param x The CIMQualifier object from which to assign this
341                              CIMConstQualifier object.
342                          @return A reference to this CIMConstQualifier object.
343                      */
344 kumpf  1.20          CIMConstQualifier& operator=(const CIMQualifier& x);
345                  
346 kumpf  1.49          /**
347                          Gets the name of the qualifier.
348                          @return A CIMName containing the name of the qualifier.
349                          @exception UninitializedObjectException If the object is not
350                              initialized.
351                      */
352 kumpf  1.32          const CIMName& getName() const;
353 kumpf  1.20      
354 kumpf  1.49          /**
355                          Gets the qualifier type.
356                          @return A CIMType containing the qualifier type.
357                          @exception UninitializedObjectException If the object is not
358                              initialized.
359                      */
360 kumpf  1.20          CIMType getType() const;
361                  
362 kumpf  1.49          /**
363                          Checks whether the qualifier is an Array qualifier.
364                          @return True if the qualifier is an Array qualifier, false otherwise.
365                          @exception UninitializedObjectException If the object is not
366                              initialized.
367                      */
368 kumpf  1.20          Boolean isArray() const;
369                  
370 kumpf  1.49          /**
371                          Gets the qualifier value.
372                          @return A CIMValue containing the qualifier value.
373                          @exception UninitializedObjectException If the object is not
374                              initialized.
375                      */
376 kumpf  1.20          const CIMValue& getValue() const;
377                  
378 kumpf  1.49          /**
379                          Gets the qualifier flavors.
380                          @return A CIMFlavor containing the qualifier flavor settings.
381                          @exception UninitializedObjectException If the object is not
382                              initialized.
383                      */
384 kumpf  1.35          const CIMFlavor & getFlavor() const;
385 kumpf  1.20      
386 kumpf  1.49          /**
387                          Tests the propagated attribute of the qualifier.  The propagated
388                          attribute indicates whether this qualifier was propagated from a
389                          higher-level class.  Normally this attribute is set as part of
390                          defining a qualifier in the context of a schema.  It is set in
391                          qualifiers retrieved from a CIM Server.
392                          (Note: Although this method is intended to return a Boolean value,
393                          changing the return type would break interface compatibility.)
394                          @return Non-zero if qualifier is propagated, otherwise zero.
395                          @exception UninitializedObjectException If the object is not
396                              initialized.
397                      */
398 mike   1.50.16.1     Uint32 getPropagated() const;
399 kumpf  1.20      
400 kumpf  1.49          /**
401                          Determines whether the object has been initialized.
402                          @return True if the object has not been initialized, false otherwise.
403                      */
404 kumpf  1.34          Boolean isUninitialized() const;
405 kumpf  1.20      
406 kumpf  1.49          /**
407                          Compares the qualifier with another qualifier.
408                          @param x The CIMConstQualifier to be compared.
409                          @return True if this qualifier is identical to the one specified,
410                              false otherwise.
411                          @exception UninitializedObjectException If either of the objects
412                              is not initialized.
413                      */
414 kumpf  1.20          Boolean identical(const CIMConstQualifier& x) const;
415                  
416 kumpf  1.49          /**
417                          Makes a deep copy of the qualifier.  This creates a new copy
418                          of all the qualifier attributes.
419                          @return A CIMQualifier object with a separate copy of the
420                              CIMConstQualifier object.
421                          @exception UninitializedObjectException If the object is not
422                              initialized.
423                      */
424 kumpf  1.20          CIMQualifier clone() const;
425 mike   1.12      
426                  private:
427                  
428 kumpf  1.20          void _checkRep() const;
429 mike   1.12      
430                      CIMQualifierRep* _rep;
431 kumpf  1.22      
432 mike   1.12          friend class CIMQualifier;
433 kumpf  1.22          friend class XmlWriter;
434 kumpf  1.23          friend class MofWriter;
435 mike   1.12      };
436                  
437                  #define PEGASUS_ARRAY_T CIMQualifier
438 kumpf  1.25      # include <Pegasus/Common/ArrayInter.h>
439 mike   1.12      #undef PEGASUS_ARRAY_T
440                  
441                  PEGASUS_NAMESPACE_END
442                  
443                  #endif /* Pegasus_Qualifier_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2