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

  1 mike  1.7 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3 kumpf 1.13 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4            // The Open Group, Tivoli Systems
  5 mike  1.7  //
  6            // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 kumpf 1.13 // of this software and associated documentation files (the "Software"), to
  8            // deal in the Software without restriction, including without limitation the
  9            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10 mike  1.7  // sell copies of the Software, and to permit persons to whom the Software is
 11            // furnished to do so, subject to the following conditions:
 12            // 
 13 kumpf 1.13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mike  1.7  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16 kumpf 1.13 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19 mike  1.7  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21            //
 22            //==============================================================================
 23            //
 24            // Author: Mike Brasher (mbrasher@bmc.com)
 25            //
 26 karl  1.11 // Modified By:	 Karl Schopmeyer(k.schopmeyer@opengroup.org)
 27 kumpf 1.12 //               Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 28 kumpf 1.15 //              Carol Ann Krug Graves, Hewlett-Packard Company
 29            //                (carolann_graves@hp.com)
 30 mike  1.7  //
 31            //%/////////////////////////////////////////////////////////////////////////////
 32            
 33            #ifndef Pegasus_Flavor_h
 34            #define Pegasus_Flavor_h
 35            
 36            #include <Pegasus/Common/Config.h>
 37            #include <Pegasus/Common/String.h>
 38 kumpf 1.14 #include <Pegasus/Common/Linkage.h>
 39 mike  1.7  
 40            PEGASUS_NAMESPACE_BEGIN
 41 mike  1.9  
 42 kumpf 1.15 /**
 43                The CIMFlavor class implements the concept of the CIM qualifier flavor.
 44                The qualifier flavor concept encapsulates the propagation and override 
 45                rules for the qualifier.  The propagation rules define whether a qualifier
 46                may be propagated from classes to derived classes, or from classes to 
 47                instances.  The override rules define whether or not derived classes may
 48                override a qualifier value, or whether it must be fixed for an entire 
 49                class hierarchy.
 50            
 51                The possible values are: OVERRIDABLE, TOSUBCLASS, TOINSTANCE, 
 52                TRANSLATABLE, DISABLEOVERRIDE, RESTRICTED.
 53                The flavor is a set of zero or more of these possible values.
 54             */
 55            class PEGASUS_COMMON_LINKAGE CIMFlavor
 56 mike  1.7  {
 57 kumpf 1.15 public:
 58            
 59                /**
 60                    Constructs a CIMFlavor object with no flavor values set (default 
 61                    constructor).
 62                 */
 63                CIMFlavor ();
 64            
 65                /**
 66                    Constructs a CIMFlavor object from an existing CIMFlavor object (copy 
 67                    constructor).
 68            
 69                    @param   flavor                another CIMFlavor object
 70                 */
 71                CIMFlavor (const CIMFlavor & flavor);
 72            
 73                /**
 74                    Constructs a CIMFlavor object with the specified set of values.
 75            
 76                    @param   flavor                a Uint32 representing the set of flavor 
 77                                                   values
 78 kumpf 1.15 
 79                    @exception InvalidFlavor  if the set of flavor values is invalid
 80                 */
 81                CIMFlavor (const Uint32 flavor);
 82            
 83                /**
 84                    Assigns the value of one CIMFlavor object to another (assignment 
 85                    operator).
 86            
 87                    @param   flavor                a CIMFlavor object
 88            
 89                    @return  the CIMFlavor object
 90                 */
 91                CIMFlavor & operator= (const CIMFlavor & flavor);
 92            
 93                /**
 94                    Adds the specified set of flavor values to the CIMFlavor object.
 95            
 96                    @param   flavor                a Uint32 representing the set of flavor 
 97                                                   values
 98            
 99 kumpf 1.15         @exception InvalidFlavor  if the set of flavor values is invalid
100                 */
101                void addFlavor (const Uint32 flavor);
102            
103                /**
104                    Adds the set of flavor values of the specified CIMFlavor object to this
105                    CIMFlavor object.
106            
107                    @param   flavor                a CIMFlavor object
108                 */
109                void addFlavor (const CIMFlavor & flavor);
110            
111                /**
112                    Removes the specified set of flavor values from the CIMFlavor object.
113            
114                    @param   flavor                a Uint32 representing the set of flavor 
115                                                   values
116            
117                    @exception InvalidFlavor  if the set of flavor values is invalid
118                 */
119                void removeFlavor (const Uint32 flavor);
120 kumpf 1.15 
121                /**
122                    Determines if every value in the specified set of flavor values is 
123                    included in the CIMFlavor object.
124            
125                    @param   flavor                a Uint32 representing a set of flavor 
126                                                   values
127            
128                    @return  True if every value in the set of flavor values is included in
129                               the CIMFlavor object,
130                             False otherwise
131                 */
132                Boolean hasFlavor (const Uint32 flavor) const;
133            
134                /**
135                    Determines if every value in the specified CIMFlavor object is included 
136                    in this CIMFlavor object.
137            
138                    @param   flavor                a CIMFlavor object
139            
140                    @return  True if every value in the specified CIMFlavor object is 
141 kumpf 1.15                    included in the CIMFlavor object,
142                             False otherwise
143                 */
144                Boolean hasFlavor (const CIMFlavor & flavor) const;
145            
146                /** 
147                    Compares two CIMFlavor objects.
148            
149                    @param   flavor                a CIMFlavor object
150            
151                    @return True if the two CIMFlavor objects are equal, 
152                            False otherwise
153                 */
154                Boolean equal (const CIMFlavor & flavor) const;
155            
156                /** 
157                    Returns a String representation of the CIMFlavor object.
158                    This method is for diagnostic purposes.  The format of the output
159                    is subject to change.
160                 */
161                String toString () const;
162 kumpf 1.15 
163                /** 
164                    Indicates that the qualifier has no flavors
165                 */
166 mike  1.7      static const Uint32 NONE;
167 mike  1.9  
168 kumpf 1.15     /** 
169                    Indicates that the qualifier may be overridden
170                 */
171 mike  1.7      static const Uint32 OVERRIDABLE;
172 karl  1.11     static const Uint32 ENABLEOVERRIDE;
173            
174 kumpf 1.15     /** 
175                    Indicates that the qualifier may not be overridden
176                 */
177 karl  1.11     static const Uint32 DISABLEOVERRIDE;
178 mike  1.9  
179 kumpf 1.15     /** 
180                    Indicates that the qualifier is propagated to the qualifier in the
181            	subclass with the same name
182                 */
183 mike  1.7      static const Uint32 TOSUBCLASS;
184 mike  1.9  
185 kumpf 1.15     /** 
186                    Indicates that the qualifier is not propagated to the qualifier in the
187            	subclass with the same name; it applies only to the class in which it 
188                    is declared
189                 */
190                static const Uint32 RESTRICTED;
191            
192                /** 
193                    Indicates that the qualifier is propagated to the qualifier in the
194            	instance with the same name
195                 */
196 mike  1.7      static const Uint32 TOINSTANCE;
197 mike  1.9  
198 kumpf 1.15     /** 
199                    Indicates that the qualifier is translatable (for internationalization)
200                 */
201 mike  1.7      static const Uint32 TRANSLATABLE;
202            
203 kumpf 1.15     /** 
204                    Indicates default flavor setting (OVERRIDABLE | TOSUBCLASS)
205                 */
206 mike  1.7      static const Uint32 DEFAULTS;
207 karl  1.10 
208 kumpf 1.15     /** 
209                    Indicates both toSubclass and toInstance (TOSUBCLASS | TOINSTANCE)
210                 */
211 karl  1.10     static const Uint32 TOSUBELEMENTS;
212 karl  1.11 
213 kumpf 1.15     /** 
214                    Indicates the set of all possible flavor values: OVERRIDABLE, 
215                    TOSUBCLASS, TOINSTANCE, TRANSLATABLE, DISABLEOVERRIDE, RESTRICTED
216                    Note that some of these possible values are mutually exclusive, and 
217                    thus CIMFlavor:ALL does not represent a valid qualifier flavor object
218                    It may be used, for example, to clear the flavor settings
219                 */
220 karl  1.11     static const Uint32 ALL;
221            
222 kumpf 1.15 private:
223            
224                void _checkFlavor (Uint32 flavor);
225            
226                Uint32 cimFlavor;
227 mike  1.7  };
228            
229            PEGASUS_NAMESPACE_END
230            
231            #endif /* Pegasus_Flavor_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2