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

  1 karl  1.33 //%2003////////////////////////////////////////////////////////////////////////
  2 mike  1.12 //
  3 karl  1.33 // 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            // IBM Corp.; EMC Corporation, The Open Group.
  7 mike  1.12 //
  8            // Permission is hereby granted, free of charge, to any person obtaining a copy
  9 kumpf 1.21 // of this software and associated documentation files (the "Software"), to
 10            // deal in the Software without restriction, including without limitation the
 11            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 12 mike  1.12 // sell copies of the Software, and to permit persons to whom the Software is
 13            // furnished to do so, subject to the following conditions:
 14            // 
 15 kumpf 1.21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 16 mike  1.12 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 17            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 18 kumpf 1.21 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 19            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 20            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 21 mike  1.12 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 22            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 23            //
 24            //==============================================================================
 25            //
 26            // Author: Mike Brasher (mbrasher@bmc.com)
 27            //
 28 kumpf 1.16 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 29 kumpf 1.22 //              Carol Ann Krug Graves, Hewlett-Packard Company
 30            //                (carolann_graves@hp.com)
 31 mike  1.12 //
 32            //%/////////////////////////////////////////////////////////////////////////////
 33            
 34            #ifndef Pegasus_Parameter_h
 35            #define Pegasus_Parameter_h
 36            
 37            #include <Pegasus/Common/Config.h>
 38 kumpf 1.24 #include <Pegasus/Common/CIMName.h>
 39 kumpf 1.16 #include <Pegasus/Common/CIMQualifier.h>
 40            #include <Pegasus/Common/CIMType.h>
 41 kumpf 1.23 #include <Pegasus/Common/Linkage.h>
 42 mike  1.12 
 43            PEGASUS_NAMESPACE_BEGIN
 44            
 45            ////////////////////////////////////////////////////////////////////////////////
 46            //
 47            // CIMParameter
 48            //
 49            ////////////////////////////////////////////////////////////////////////////////
 50            
 51 kumpf 1.22 class Resolver;
 52 mike  1.12 class CIMConstParameter;
 53 kumpf 1.16 class CIMParameterRep;
 54 mike  1.12 
 55 karl  1.32 /**	This class provides the interface to construct and manage CIM Parameters.
 56                CIM Parameters are the parameters attached to CIMMethods.
 57                A CIM Parameter consists of:
 58                <UL>
 59                <LI> <B>qualifiers</B> - zero or more qualifiers.
 60                <LI> <B>name</B> - The name of the parameter which must be a valid CIM name.
 61                <LI> <B>type</B> - The type for the parameter, one of the inherent CIM types
 62                <LI> <B>value</B> -	Which is dependent on the type. The value can be
 63            		<UL>
 64            		<LI> a reference type. In this class the value is a Class reference. This must be
 65                    a single value
 66                    <LI> an array (fixed or variable number of elements) or a single value
 67            		with any CIMType other than reference.  The input parameters allow specifying
 68                    these conditions.
 69            		</UL>
 70                </UL>
 71                
 72                ATTN: Define the form of this objec, the rep and what it means.
 73            */
 74 mike  1.12 class PEGASUS_COMMON_LINKAGE CIMParameter
 75            {
 76            public:
 77            
 78 karl  1.32     /// Construct a NULL CIMParameter object.
 79 kumpf 1.16     CIMParameter();
 80 mike  1.12 
 81 karl  1.32     /** Construct a CIMParameter from another CIMParameter
 82            	    @param CIMParameter from which the new object is to be constructed
 83            	*/
 84            
 85 kumpf 1.16     CIMParameter(const CIMParameter& x);
 86 mike  1.12 
 87 karl  1.32     /**	Constructs a CIMParameter object with properties. The Properties
 88            	    Must include name and type and may include the indicator whether
 89            	    this is an array or not, the size of the array and a reference
 90            	    class name.
 91            	    @param name Name of the parameter, a legal CIMName.
 92            	    @param type	CIMType defining the CIM Type for this parameter
 93            	    @param IsArray Boolean indicating whether this parameter defines an
 94            	    array.
 95            	    @param arraySize Size of the array if this is to be a fixed size
 96            	    array parameter. The default is zero which indicates variable size array.
 97            	    @param referenceClassName Optional property but required for reference
 98            	    type parameters.  This defines the class for the reference.
 99            	    @exception TypeMismatchException - if reference type and referenceClassname
100            	    is Null.
101            	    @exception TypeMismatchException - if arraysize != zero and isArray true.
102            	*/
103 mike  1.12     CIMParameter(
104 kumpf 1.24 	const CIMName& name, 
105 mike  1.12 	CIMType type,
106            	Boolean isArray = false,
107            	Uint32 arraySize = 0,
108 kumpf 1.24 	const CIMName& referenceClassName = CIMName());
109 kumpf 1.16 
110 karl  1.32     ///	 Destructor.
111 kumpf 1.16     ~CIMParameter();
112            
113 karl  1.32     /** Assignment operator. Assigns one CIMParameter to 
114            	    another CIMParameter
115            	*/
116 kumpf 1.16     CIMParameter& operator=(const CIMParameter& x);
117            
118 karl  1.32     /**	Get the name from the CIMParameter object.
119            	    @return CIMName containing the name from the object.
120            	*/
121 kumpf 1.24     const CIMName& getName() const ;
122 mike  1.12 
123 karl  1.32     /** Set the name field in the object with a valid CIMName
124            	    @param CIMName to set into name field.
125            	*/
126 kumpf 1.24     void setName(const CIMName& name);
127 mike  1.12 
128 karl  1.32     /** Test for Array type for this parameter object.
129            	    @return true if the value for this parameter is defined
130            	    as an array (is array = true).
131            	*/
132 kumpf 1.16     Boolean isArray() const;
133 kumpf 1.15 
134 karl  1.32     /**	 Get the array size for the parameter. 
135            	    @return Uint32 array size.
136            	*/
137 kumpf 1.16     Uint32 getArraySize() const;
138            
139 kumpf 1.31     ///
140 kumpf 1.24     const CIMName& getReferenceClassName() const ;
141 kumpf 1.16 
142 karl  1.32     /**	Get the type (CIMTYPE) defined for this parameter.
143            	    If the parameter is not initialized the type returned is 
144            	    TBD.
145            	    @return the type for this parameter defined as a CIMTYPE
146            	    object.
147            	*/
148 kumpf 1.16     CIMType getType() const ;
149            
150 karl  1.32     /** Add a single qualifier object to the CIMParameter.
151            	    @param CIMQualifier object to be added.
152            	    @exception AlreadyExistsException if a qualifier with the
153            	    same name already exists for this CIMParameter.
154                */
155 kumpf 1.16     CIMParameter& addQualifier(const CIMQualifier& x);
156            
157 karl  1.32     /**	Find a qualifier by name.  Finds a single qualifier
158            	    based on the name input as parameter and returns an
159            	    index to the name.
160            	    @param CIMName with the name of the qualifier to be found
161            	    @return Uint32 with either the index (zero origin) of 
162            	    the parameter that was to be found or the value
163            	    PEG_NOT_FOUND if no parameter is found with the
164            	    defined name.
165            	*/
166 kumpf 1.24     Uint32 findQualifier(const CIMName& name) const;
167 mike  1.12 
168 karl  1.32     /**	Get qualifier at index defined by input.  Gets the
169            	    qualifier in the array of qualifiers for this parameter
170            	    defined by the index provided on input.
171            	    @param index defining the position in the qualifier array
172            	    of the qualifier to be retrieved
173            	    @return CIMQualifier object containing the qualifer defined
174            	    by the index
175            	    @exception IndexOutOfBoundsException thrown if index outside
176            	    the array of qualifiers.
177            
178            	*/
179 kumpf 1.29     CIMQualifier getQualifier(Uint32 index);
180 kumpf 1.16 
181 kumpf 1.31     /** Removes the CIMQualifier defined by the input parameter.
182                    @param index - Index of the qualifier to be removed.
183 kumpf 1.28         @exception IndexOutOfBoundsException if the index is outside
184 kumpf 1.31         the range of qualifiers available for the CIMParameter.
185 karl  1.32 		@exception IndexOutOfBoundsException thrown if index outside
186            		the array of qualifiers.
187 kumpf 1.27     */
188 kumpf 1.29     void removeQualifier (Uint32 index);
189 kumpf 1.27 
190 kumpf 1.31     ///
191 kumpf 1.29     CIMConstQualifier getQualifier(Uint32 index) const;
192 kumpf 1.16 
193 karl  1.32     /** Gets the count of qualifiers attached to this CIMParameter.
194            	    @return count of number of qualifiers that have been added
195            	    to this CIMparameter.
196            	    <pre>
197            	         // loop to access all qualifiers in a CIMparameter
198            	         CIMParameter parm;
199            	         ....				// build the parameter
200            			for (Uint32 i = 0 ; i < parm.getQualifierCount() ; i++
201            				....
202            	    </pre>
203            	*/ 
204 kumpf 1.16     Uint32 getQualifierCount() const;
205            
206 karl  1.32     /** Determines if the object has not been initialized. A CIM parameter
207            	    is intialized only when the name and type fields have been set either
208            	    on construction or through the set functions.
209 kumpf 1.31         @return  true if the object has not been initialized,
210                             false otherwise.
211 kumpf 1.26      */
212                Boolean isUninitialized() const;
213 kumpf 1.16 
214 kumpf 1.31     ///
215 mike  1.12     Boolean identical(const CIMConstParameter& x) const;
216            
217 kumpf 1.31     ///
218 kumpf 1.16     CIMParameter clone() const;
219 mike  1.12 
220            private:
221            
222 kumpf 1.16     CIMParameter(CIMParameterRep* rep);
223            
224                void _checkRep() const;
225 mike  1.12 
226                CIMParameterRep* _rep;
227 kumpf 1.19 
228 mike  1.12     friend class CIMConstParameter;
229 kumpf 1.22     friend class Resolver;
230 kumpf 1.18     friend class XmlWriter;
231 kumpf 1.19     friend class MofWriter;
232 mike  1.12 };
233            
234            ////////////////////////////////////////////////////////////////////////////////
235            //
236            // CIMConstParameter
237            //
238            ////////////////////////////////////////////////////////////////////////////////
239            
240 kumpf 1.31 ///
241 mike  1.12 class PEGASUS_COMMON_LINKAGE CIMConstParameter
242            {
243            public:
244            
245 kumpf 1.31     ///
246 kumpf 1.16     CIMConstParameter();
247 mike  1.12 
248 kumpf 1.31     ///
249 kumpf 1.16     CIMConstParameter(const CIMConstParameter& x);
250 mike  1.12 
251 kumpf 1.31     ///
252 kumpf 1.16     CIMConstParameter(const CIMParameter& x);
253 mike  1.12 
254 kumpf 1.31     ///
255 mike  1.12     CIMConstParameter(
256 kumpf 1.24 	const CIMName& name, 
257 mike  1.12 	CIMType type,
258            	Boolean isArray = false,
259            	Uint32 arraySize = 0,
260 kumpf 1.24 	const CIMName& referenceClassName = CIMName());
261 kumpf 1.16 
262 kumpf 1.31     ///
263 kumpf 1.16     ~CIMConstParameter();
264            
265 kumpf 1.31     ///
266 kumpf 1.16     CIMConstParameter& operator=(const CIMConstParameter& x);
267            
268 kumpf 1.31     ///
269 kumpf 1.16     CIMConstParameter& operator=(const CIMParameter& x);
270            
271 kumpf 1.31     ///
272 kumpf 1.24     const CIMName& getName() const;
273 kumpf 1.16 
274 kumpf 1.31     ///
275 kumpf 1.16     Boolean isArray() const;
276            
277 kumpf 1.31     ///
278 kumpf 1.16     Uint32 getArraySize() const;
279            
280 kumpf 1.31     ///
281 kumpf 1.24     const CIMName& getReferenceClassName() const;
282 kumpf 1.16 
283 kumpf 1.31     ///
284 kumpf 1.16     CIMType getType() const;
285            
286 kumpf 1.31     ///
287 kumpf 1.24     Uint32 findQualifier(const CIMName& name) const;
288 kumpf 1.16 
289 kumpf 1.31     ///
290 kumpf 1.29     CIMConstQualifier getQualifier(Uint32 index) const;
291 kumpf 1.16 
292 kumpf 1.31     ///
293 kumpf 1.16     Uint32 getQualifierCount() const;
294            
295 kumpf 1.31     ///
296 kumpf 1.26     Boolean isUninitialized() const;
297 kumpf 1.16 
298 kumpf 1.31     ///
299 kumpf 1.16     Boolean identical(const CIMConstParameter& x) const;
300            
301 kumpf 1.31     ///
302 kumpf 1.16     CIMParameter clone() const;
303 mike  1.12 
304            private:
305            
306 kumpf 1.16     void _checkRep() const;
307 mike  1.12 
308                CIMParameterRep* _rep;
309                friend class CIMParameter;
310 kumpf 1.18     friend class XmlWriter;
311 kumpf 1.19     friend class MofWriter;
312 mike  1.12 };
313            
314            #define PEGASUS_ARRAY_T CIMParameter
315 kumpf 1.20 # include <Pegasus/Common/ArrayInter.h>
316 mike  1.12 #undef PEGASUS_ARRAY_T
317            
318            PEGASUS_NAMESPACE_END
319            
320            #endif /* Pegasus_Parameter_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2