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

  1 mike  1.12 //%/////////////////////////////////////////////////////////////////////////////
  2            //
  3 kumpf 1.26 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4            // The Open Group, Tivoli Systems
  5 mike  1.12 //
  6            // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 kumpf 1.26 // 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.12 // 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.26 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mike  1.12 // 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.26 // 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.12 // 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.16 // Modified By:	Karl Schopmeyer (k.schopmeyer@opengroup.org)
 27 kumpf 1.20 //             	Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 28 kumpf 1.30 //              Carol Ann Krug Graves, Hewlett-Packard Company
 29            //                (carolann_graves@hp.com)
 30 mike  1.12 //
 31            //%/////////////////////////////////////////////////////////////////////////////
 32            
 33            /*
 34             CIMQualifier.h - Defines the CIM qualifiers class.
 35            
 36            */
 37            
 38            #ifndef Pegasus_Qualifier_h
 39            #define Pegasus_Qualifier_h
 40            
 41            #include <Pegasus/Common/Config.h>
 42 karl  1.15 #include <Pegasus/Common/CIMFlavor.h>
 43 kumpf 1.20 #include <Pegasus/Common/CIMType.h>
 44            #include <Pegasus/Common/CIMValue.h>
 45 kumpf 1.31 #include <Pegasus/Common/Linkage.h>
 46 mike  1.12 
 47            PEGASUS_NAMESPACE_BEGIN
 48            
 49            ////////////////////////////////////////////////////////////////////////////////
 50            //
 51            // CIMQualifier
 52            //
 53            ////////////////////////////////////////////////////////////////////////////////
 54            
 55            class CIMConstQualifier;
 56            class CIMClassRep;
 57 kumpf 1.30 class Resolver;
 58 sage  1.29 #if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
 59 sage  1.27 class CIMQualifierRep;
 60 sage  1.28 #endif
 61 mike  1.12 
 62            /** Class CIMQualifier - This class defines the Pegasus implementation of the 
 63 kumpf 1.20     CIM Qualifier \Ref{QUALIFIER}.  It is almost identical to
 64                CIMQualifierDecl except that it has no scope member. \Ref{CIMQualifierDecl}
 65 karl  1.18     This includes functions to create qualifiers and manipulate/test
 66                the individual components of the CIMQualifier.
 67 kumpf 1.20     CIMQualifiers are accumulated into lists for use in CIMClasses and CIM
 68                Properties using the CIMQualifierList Class and its
 69                functions. \Ref{CIMQualifierList}
 70 mike  1.12 */
 71            class PEGASUS_COMMON_LINKAGE CIMQualifier
 72            {
 73            public:
 74            
 75                /** Constructor instantiates a CIM qualifier with empty name value 
 76            	fields.Constructor 
 77            	@return instantiated empty qualifier object
 78                */
 79 kumpf 1.20     CIMQualifier();
 80 mike  1.12 
 81 kumpf 1.20     /** Constructor - instantiates a CIM qualifier object from another 
 82                    qualifier object. 
 83                    @param CIM CIMQualifier object
 84                    @return - Instantiated qualifier object
 85                */
 86                CIMQualifier(const CIMQualifier& x);
 87 mike  1.12 
 88                /** Constructor - Instantiates a CIM qualifier object with the parameters 
 89 kumpf 1.20         defined on input.
 90                    @param String representing CIMName for the new qualifier
 91                    @param value
 92                    @param flavor - Flavor defined for this qualifier definition. Default
 93                    for this parameter is CIMFlavor::NONE.
 94                    @param propoagated - Boolean defining whether this is a propagated
 95                    qualifier.  This is an optional parameter with default = false
 96                    @return -Returns the instantiated qualifier object or throws an
 97                    exception if the name argument is illegal
 98 mike  1.12     
 99 kumpf 1.20         @exception Throws IllegalName if name argument not legal CIM 
100                    identifier.
101                */
102 mike  1.12     CIMQualifier(
103            	const String& name, 
104            	const CIMValue& value, 
105 karl  1.17 	Uint32 flavor = CIMFlavor::NONE,
106 kumpf 1.20 	Boolean propagated = false);
107            
108 mike  1.12     /// destructor
109 kumpf 1.20     ~CIMQualifier();
110            
111 mike  1.12     /// operator
112 kumpf 1.20     CIMQualifier& operator=(const CIMQualifier& x);
113 mike  1.12 
114 karl  1.18     /**	getName - Returns the name field from the qualifier
115 kumpf 1.20         @return String containing the qualifier name.
116 mike  1.12     */
117 kumpf 1.20     const String& getName() const;
118 mike  1.12 
119 karl  1.15     /**	setName - Sets the qualifier name field in the qualifier object.
120            	@param name - String containing the name for the qualifier
121 kumpf 1.20 	@exception Throws IllegalName if name argument not legal CIM identifier.
122 mike  1.12     */
123 kumpf 1.20     void setName(const String& name);
124 mike  1.12 
125 karl  1.18     /** getType - Gets the type field from the qualifier object.
126 kumpf 1.20         @return CIMType containing the type for this qualifier /Ref{CIMType}.
127 mike  1.12     */
128 kumpf 1.20     CIMType getType() const;
129 mike  1.12 
130 karl  1.15     /**	isArray - Returns true if the qualifier is an array
131 karl  1.18 	@return Boolean true if array qualifier.
132 mike  1.12     */
133 kumpf 1.20     Boolean isArray() const;
134 mike  1.12 
135 karl  1.15     /**	getValue - Gets the value component of the qualifier object
136            	@return CIMValue containing the value component
137 mike  1.12     */
138 kumpf 1.20     const CIMValue& getValue() const;
139 mike  1.12 
140 karl  1.15     /**	setValue - Puts a CIMValue object into a CIMQualifier object
141            	@param value - The CIMValue object to install
142 mike  1.12     */
143 kumpf 1.20     void setValue(const CIMValue& value);
144            
145                /** setFlavor - Sets the bits defined on input into the Flavor variable
146                    for the Qualifier Object.
147                    @param flavor - Uint32 defines the flavor bits to be set.
148                */
149                void setFlavor(Uint32 flavor);
150            
151                /** unsetFlavor - Resets the bits defined for the flavor 
152                    for the Qualifier Object with the input.
153                    @param flavor - Uint32 defines the flavor bits to be set.
154                */
155                void unsetFlavor(Uint32 flavor);
156 karl  1.16 
157 karl  1.15     /**	getFlavor - Gets the Flavor field from a Qualifier
158 karl  1.18 	@return - Uint32 with the Flavor flags that can be tested
159 karl  1.16 	against the CIMFlavor constants.
160 mike  1.12     */
161 kumpf 1.20     Uint32 getFlavor() const;
162            
163 karl  1.18     /**	isFlavor - Boolean function that determines if particular flavor
164 karl  1.16 	flags are set in the flavor variable of a qualifier.
165            	@param flavor - The flavor bits to test.
166            	Return True if the defined flavor is set.
167            	<pre>
168            	if (q.isFlavor(CIMType::TOSUBCLASS)
169            		do something based on TOSUBCLASS being true
170            	</pre>
171 karl  1.18     */
172 kumpf 1.20     Boolean isFlavor(Uint32 flavor) const;
173            
174 karl  1.17     /**	getPropagated returns the propagated indicator
175            	@return Uint32 - TBD
176 karl  1.18     */
177 kumpf 1.20     const Uint32 getPropagated() const;
178 mike  1.12 
179 karl  1.18     /**	setPropagated - Sets the Propagated flag for the object.
180 mike  1.12     */
181 kumpf 1.20     void setPropagated(Boolean propagated);
182 mike  1.12 
183 kumpf 1.20 #ifdef PEGASUS_INTERNALONLY
184 mike  1.12     /**	CIMMethod
185                */
186 kumpf 1.21     Boolean isNull() const;
187 kumpf 1.20 #endif
188 mike  1.12 
189 mike  1.13     /**	identical - compares two CIMQualifier objects.
190                    @return - True if the objects are identical.
191 kumpf 1.20     */
192 mike  1.12     Boolean identical(const CIMConstQualifier& x) const;
193            
194 karl  1.18     /**	clone Creates an exact copy of the qualifier and returns the
195            	new object.
196            	@return CIMQualifier New Qualifier object.
197 mike  1.12     */
198 kumpf 1.20     CIMQualifier clone() const;
199 mike  1.12 
200            private:
201            
202 kumpf 1.20     CIMQualifier(CIMQualifierRep* rep);
203            
204                void _checkRep() const;
205 mike  1.12 
206                CIMQualifierRep* _rep;
207 kumpf 1.22 
208 mike  1.12     friend class CIMConstQualifier;
209                friend class CIMClassRep;
210 kumpf 1.30     friend class Resolver;
211 kumpf 1.22     friend class XmlWriter;
212 kumpf 1.23     friend class MofWriter;
213 mike  1.12 };
214            
215            ////////////////////////////////////////////////////////////////////////////////
216            //
217            // CIMConstQualifier
218            //
219            ////////////////////////////////////////////////////////////////////////////////
220            
221            class PEGASUS_COMMON_LINKAGE CIMConstQualifier
222            {
223            public:
224            
225 kumpf 1.20     CIMConstQualifier();
226 mike  1.12 
227 kumpf 1.20     CIMConstQualifier(const CIMConstQualifier& x);
228 mike  1.12 
229 kumpf 1.20     CIMConstQualifier(const CIMQualifier& x);
230 mike  1.12 
231                // Throws IllegalName if name argument not legal CIM identifier.
232            
233                CIMConstQualifier(
234            	const String& name, 
235            	const CIMValue& value, 
236 kumpf 1.20 	Uint32 flavor = CIMFlavor::NONE,
237            	Boolean propagated = false);
238            
239                ~CIMConstQualifier();
240            
241                CIMConstQualifier& operator=(const CIMConstQualifier& x);
242            
243                CIMConstQualifier& operator=(const CIMQualifier& x);
244            
245                const String& getName() const;
246            
247                CIMType getType() const;
248            
249                Boolean isArray() const;
250            
251                const CIMValue& getValue() const;
252            
253                const Uint32 getFlavor() const;
254            
255                Boolean isFlavor(Uint32 flavor) const;
256 karl  1.15 	
257 kumpf 1.20     Boolean isFlavorToSubclass() const;
258            
259                Boolean isFlavorToInstance() const;
260            
261                Boolean isFlavorOverridable() const;
262            
263                const Uint32 getPropagated() const;
264            
265            #ifdef PEGASUS_INTERNALONLY
266 kumpf 1.21     Boolean isNull() const;
267 kumpf 1.20 #endif
268            
269                Boolean identical(const CIMConstQualifier& x) const;
270            
271                CIMQualifier clone() const;
272 mike  1.12 
273            private:
274            
275 kumpf 1.20     void _checkRep() const;
276 mike  1.12 
277                CIMQualifierRep* _rep;
278 kumpf 1.22 
279 mike  1.12     friend class CIMQualifier;
280 kumpf 1.22     friend class XmlWriter;
281 kumpf 1.23     friend class MofWriter;
282 mike  1.12 };
283            
284            #define PEGASUS_ARRAY_T CIMQualifier
285 kumpf 1.25 # include <Pegasus/Common/ArrayInter.h>
286 mike  1.12 #undef PEGASUS_ARRAY_T
287            
288            PEGASUS_NAMESPACE_END
289            
290            #endif /* Pegasus_Qualifier_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2