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

  1 martin 1.28 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.29 //
  3 martin 1.28 // 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.29 //
 10 martin 1.28 // 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.29 //
 17 martin 1.28 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.29 //
 20 martin 1.28 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.29 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.28 // 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.29 //
 28 martin 1.28 //////////////////////////////////////////////////////////////////////////
 29 mike   1.7  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             #ifndef Pegasus_Flavor_h
 33             #define Pegasus_Flavor_h
 34             
 35             #include <Pegasus/Common/Config.h>
 36             #include <Pegasus/Common/String.h>
 37 kumpf  1.14 #include <Pegasus/Common/Linkage.h>
 38 mike   1.7  
 39             PEGASUS_NAMESPACE_BEGIN
 40 mike   1.9  
 41 kumpf  1.15 /**
 42 kumpf  1.26     The CIMFlavor class represents the DMTF standard CIM qualifier flavor
 43                 definition, which encapsulates the propagation and override rules for
 44                 qualifiers.  The propagation rules define whether a qualifier may be
 45                 propagated from classes to derived classes or from classes to instances.
 46                 The override rules define whether a derived class may override a
 47                 qualifier value.
 48             
 49                 A CIMFlavor contains one or more of these values: OVERRIDABLE,
 50                 TOSUBCLASS, TOINSTANCE, TRANSLATABLE, DISABLEOVERRIDE, ENABLEOVERRIDE,
 51                 RESTRICTED and DEFAULTS.
 52             */
 53 kumpf  1.15 class PEGASUS_COMMON_LINKAGE CIMFlavor
 54 mike   1.7  {
 55 kumpf  1.15 public:
 56             
 57                 /**
 58 kumpf  1.26         Constructs a CIMFlavor object with the value NONE.
 59                 */
 60                 CIMFlavor();
 61 kumpf  1.15 
 62                 /**
 63 kumpf  1.26         Constructs a CIMFlavor object from the value of a specified
 64 karl   1.20         CIMFlavor object.
 65 kumpf  1.26         @param flavor The CIMFlavor object from which to construct a new
 66                         CIMFlavor object.
 67                 */
 68                 CIMFlavor(const CIMFlavor & flavor);
 69             
 70                 /**
 71                     Assigns the value of the specified CIMFlavor object to this object.
 72 kumpf  1.27         @param flavor The CIMFlavor object from which to assign this
 73 kumpf  1.26             CIMFlavor object.
 74                     @return A reference to this CIMFlavor object.
 75                 */
 76                 CIMFlavor& operator=(const CIMFlavor& flavor);
 77             
 78                 /**
 79                     Adds flavor values to the CIMFlavor object.
 80                     @param flavor A CIMFlavor containing the flavor values to add.
 81                 */
 82                 void addFlavor(const CIMFlavor& flavor);
 83             
 84                 /**
 85                     Removes flavor values from the CIMFlavor object.
 86                     @param flavor A CIMFlavor containing the flavor values to remove.
 87                 */
 88                 void removeFlavor(const CIMFlavor& flavor);
 89             
 90                 /**
 91                     Checks whether the flavor contains specified flavor values.
 92                     @param flavor A CIMFlavor specifying the flavor values to check.
 93                     @return True if the flavor contains all the values in the specified
 94 kumpf  1.26             CIMFlavor object, false otherwise.
 95                 */
 96                 Boolean hasFlavor(const CIMFlavor& flavor) const;
 97             
 98                 /**
 99                     Compares the CIMFlavor with a specified CIMFlavor.
100                     @param flavor The CIMFlavor to be compared.
101                     @return True if this flavor has the same set of values as the
102                         specified flavor, false otherwise.
103                 */
104                 Boolean equal(const CIMFlavor& flavor) const;
105             
106                 /**
107                     Adds two flavor values.
108                     @param flavor A CIMFlavor containing the flavor value to add to this
109                         flavor.
110                     @return A new CIMFlavor object containing a union of the values in the
111                         two flavor objects.
112                 */
113                 CIMFlavor operator+(const CIMFlavor& flavor) const;
114 kumpf  1.16 
115 karl   1.20     /**
116 kumpf  1.15         Returns a String representation of the CIMFlavor object.
117 kumpf  1.26         This method is for diagnostic purposes. The format of the output
118                     is subject to change.
119                     @return A String containing a human-readable representation of the
120                         flavor value.
121                 */
122                 String toString() const;
123 kumpf  1.15 
124 karl   1.20     /**
125 kumpf  1.26         Indicates that the qualifier has no flavors.
126                 */
127 kumpf  1.16     static const CIMFlavor NONE;
128 mike   1.9  
129 karl   1.20     /**
130 kumpf  1.18         Indicates that the qualifier may be overridden.
131 kumpf  1.26     */
132 kumpf  1.16     static const CIMFlavor OVERRIDABLE;
133 kumpf  1.26 
134 karl   1.20     /**
135 kumpf  1.26         Indicates that the override feature is enabled for the qualifier.
136                     Thus, the qualifier may be overridden.
137                 */
138 kumpf  1.16     static const CIMFlavor ENABLEOVERRIDE;
139 karl   1.11 
140 karl   1.20     /**
141 kumpf  1.26         Indicates that the override feature is disabled for the qualifier.
142                     Thus, the qualifier may not be overridden.
143                 */
144 kumpf  1.16     static const CIMFlavor DISABLEOVERRIDE;
145 mike   1.9  
146 karl   1.20     /**
147 kumpf  1.26         Indicates that the qualifier is propagated to subclasses.
148                 */
149 kumpf  1.16     static const CIMFlavor TOSUBCLASS;
150 mike   1.9  
151 karl   1.20     /**
152 kumpf  1.26         Indicates that the qualifier is not propagated to subclasses.
153                 */
154 kumpf  1.16     static const CIMFlavor RESTRICTED;
155 kumpf  1.15 
156 karl   1.20     /**
157 kumpf  1.26         Indicates that the qualifier is propagated to instances.
158 kumpf  1.30         NOTE: This flavor is deprecated and should not be used.
159 kumpf  1.26     */
160 kumpf  1.16     static const CIMFlavor TOINSTANCE;
161 mike   1.9  
162 karl   1.20     /**
163 kumpf  1.26         Indicates that the qualifier is translatable (for
164                     internationalization).
165                 */
166 kumpf  1.16     static const CIMFlavor TRANSLATABLE;
167 mike   1.7  
168 karl   1.20     /**
169 kumpf  1.26         Indicates the default flavor settings (OVERRIDABLE | TOSUBCLASS).
170                 */
171 kumpf  1.16     static const CIMFlavor DEFAULTS;
172 karl   1.10 
173 karl   1.20     /**
174 kumpf  1.30         Indicates that the qualifier is propagated to subclasses.  This
175                     flavor is equivalent to TOSUBCLASSES.  The TOINSTANCE flavor is no
176                     longer included here since it is deprecated.
177 kumpf  1.26     */
178 kumpf  1.16     static const CIMFlavor TOSUBELEMENTS;
179 karl   1.11 
180 kumpf  1.15 private:
181             
182 karl   1.20     /*
183 kumpf  1.26         Constructs a CIMFlavor object with the specified values.
184                     @param flavor A Uint32 representing the set of flavor values.
185                 */
186                 CIMFlavor(const Uint32 flavor);
187 kumpf  1.15 
188                 Uint32 cimFlavor;
189 schuur 1.21 
190                 friend class BinaryStreamer;
191 thilo.boehm 1.30.2.1     friend class SCMOClass;
192 mike        1.7      };
193                      
194                      PEGASUS_NAMESPACE_END
195                      
196                      #endif /* Pegasus_Flavor_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2