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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2