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

  1 karl  1.33 //%2005////////////////////////////////////////////////////////////////////////
  2 mike  1.15 //
  3 karl  1.31 // 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.30 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.31 // 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.33 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 mike  1.15 //
 12            // Permission is hereby granted, free of charge, to any person obtaining a copy
 13 kumpf 1.23 // of this software and associated documentation files (the "Software"), to
 14            // deal in the Software without restriction, including without limitation the
 15            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16 mike  1.15 // sell copies of the Software, and to permit persons to whom the Software is
 17            // furnished to do so, subject to the following conditions:
 18            // 
 19 kumpf 1.23 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20 mike  1.15 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22 kumpf 1.23 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25 mike  1.15 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27            //
 28            //==============================================================================
 29            //
 30            // Author: Mike Brasher (mbrasher@bmc.com)
 31            //
 32 kumpf 1.26 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 33 david.dillard 1.32 //                  (carolann_graves@hp.com)
 34                    //              David Dillard, VERITAS Software Corp.
 35                    //                  (david.dillard@veritas.com)
 36 mike          1.15 //
 37                    //%/////////////////////////////////////////////////////////////////////////////
 38                    
 39                    #ifndef Pegasus_QualifierList_h
 40                    #define Pegasus_QualifierList_h
 41                    
 42                    #include <Pegasus/Common/Config.h>
 43 kumpf         1.25 #include <Pegasus/Common/Linkage.h>
 44                    #include <Pegasus/Common/CIMName.h>
 45 mike          1.15 #include <Pegasus/Common/CIMQualifier.h>
 46 kumpf         1.26 #include <Pegasus/Common/CIMScope.h>
 47 mike          1.15 #include <Pegasus/Common/Array.h>
 48                    #include <Pegasus/Common/Pair.h>
 49 mike          1.34 #include <Pegasus/Common/Buffer.h>
 50 mike          1.15 
 51 karl          1.20 
 52                    /* ATTN: P2 KS 25 Mar 2002 - The function names are a mismash of local and taken
 53                       from the class and instance functions.  Thus, we have getCount but getQualifier
 54                       This causes confusion with the functions in class and instance which are specifically
 55                       getQualifier.  We should clean up so the names here remove the Qualifier portion.
 56                    */
 57 mike          1.15 PEGASUS_NAMESPACE_BEGIN
 58                    
 59                    class DeclContext;
 60                    
 61 karl          1.22 
 62                    /* ATTN: KS P3 DEFER 1 May 2002. We have list processors (really array processors) for
 63                        qualifiers, properties, methods(???) but they are all slightly different.
 64                        Should we create a common base??
 65                    */
 66                    /** This class is for representing Qualifier lists in the CIM interface.
 67                    
 68                        Members are provided for accessing elements of the the internal property
 69                        list. There are none for modifying elements (the entire array must be
 70                        formed and passed to the constructor or replaced by calling set()).
 71                    */
 72                    
 73 mike          1.15 class PEGASUS_COMMON_LINKAGE CIMQualifierList
 74                    {
 75                    public:
 76                    
 77 karl          1.22     /// constructor - Constructs a NULL qualifier list.
 78 mike          1.15     CIMQualifierList();
 79                    
 80 karl          1.17     ///
 81 mike          1.15     ~CIMQualifierList();
 82                    
 83 karl          1.22     /** add adds a single CIMQualifier to a CIMQualifierList
 84                        */
 85 mike          1.15     CIMQualifierList& add(const CIMQualifier& qualifier);
 86                    
 87 karl          1.20     /**	 getCount - Returns the count of qualifiers in the list
 88                    	@return Zero origin count of qualifiers in the qualifier list.
 89                        */
 90 mike          1.15     Uint32 getCount() const
 91                        {
 92                    	return _qualifiers.size(); 
 93                        }
 94                    
 95 kumpf         1.28     /** getQualifer - Gets the qaulifier defined at the index provided
 96 karl          1.20 	in the Qualifier list.
 97 kumpf         1.28 	@param index - The position in the qualifierlist containing the
 98 karl          1.20 	qualifier.
 99                    	@return CIMQualifier object.
100                    	@exception - Throws OutofBounds exception of pso not within the
101                    	qualifier list.
102                    	ATTN: P0 KS Mar 2002 Add the outofbounds exception.
103                        */
104 kumpf         1.28     CIMQualifier& getQualifier(Uint32 index);
105 mike          1.15 
106 kumpf         1.28     const CIMQualifier& getQualifier(Uint32 index) const
107 mike          1.15     {
108 kumpf         1.28 	return _qualifiers[index]; 
109 mike          1.15     }
110 karl          1.20 
111 mike          1.15     /** removeQualifier - Removes the Qualifier defined by
112 kumpf         1.28 	the index parameter
113                    	@exception IndexOutOfBoundsException if index not within
114 karl          1.20 	range of current qualifiers.
115 mike          1.15     */
116 kumpf         1.28     void removeQualifier(Uint32 index);
117 mike          1.15     
118 karl          1.20     /**	find - Searches for a qualifier with the specified `
119                            input name if it exists in the class
120                    	@param name CIMName of the qualifier
121                    	to be found @return Position of the qualifier in the Class.
122                    	@return Returns index of the qualifier found or PEG_NOT_FOUND
123                    	if not found.
124                        */
125 kumpf         1.25     Uint32 find(const CIMName& name) const;
126 mike          1.15 
127 karl          1.20     /** exists - Returns true if the qualifier with the
128                    	specified name exists in the class
129 kumpf         1.25 	@param name CIMName name of the qualifier object being tested.
130 karl          1.20 	@return True if the qualifier exits in the list.  Otherwise
131                    	false is returned.
132                        */
133                    
134 kumpf         1.25     Boolean exists(const CIMName& name) const
135 karl          1.20     {
136                    	return (((find(name)) == PEG_NOT_FOUND)? false : true);
137                        }
138                    
139                        /** isTrue - Determines if the qualifier defined by
140                    	the input parameter exists for the class, is Boolean, and
141                    	has a value of true.
142                    	This function is useful to quickly determine the state of a
143                    	qualifier.
144 kumpf         1.25 	@param CIMName containing the qualifier  name.
145 karl          1.20 	@return Boolean True if the qualifier exists, 
146                        */
147 kumpf         1.25     Boolean isTrue(const CIMName& name) const;
148 karl          1.20 
149                        /// findReverse - See find
150 kumpf         1.25     Uint32 findReverse(const CIMName& name) const;
151 karl          1.17     
152 karl          1.19     /** resolve - Resolves the qualifierList based on the information provided. The resolved
153 karl          1.21 	qualifiers are the result of validating and testing the qualifiers against the
154                    	inherited qualifiers and qualifier declarations.  The qualifier list contains
155                    	the set of resolved qualifiers when the function is complete.
156                    	Resolution includes:
157                    	1. Determining if the qualifier is declared (obtainable form declContext).
158                    	2. Qualifier is same type as declaration
159                    	3. Valid for the scope provided (Qualifier scope contains the provided scope).
160                    	4. Whether qualifier can be overridden.
161                    	5. Whether it should be propagated to subclass
162                    	If a qualifier can be overridden it is put into the qualifiers array.
163                            @param declContext  Declaration context for this resolution (ex repository, simple)
164 karl          1.19         @param nameSpace Namespace in which to find the declaration.
165 karl          1.21         @param scope - Scope of the entity doing the resolution (ex. Class, association, etc.)
166 karl          1.19         @param isInstancePart - TBD
167                            @param inheritedQualifiers - CimQualifierList defining List of inherited qualifiers
168                    		@param propagateQualifiers Boolean indicator whether to propagate qualifiers.
169                            @return 
170                        	@exception - There are a number of different 
171 karl          1.17     */ 
172 mike          1.15     void resolve(
173                    	DeclContext* declContext,
174 kumpf         1.29 	const CIMNamespaceName & nameSpace,
175 kumpf         1.26 	CIMScope scope,
176 mike          1.15 	Boolean isInstancePart,
177 mike          1.18 	CIMQualifierList& inheritedQualifiers,
178                    	Boolean propagateQualifiers);
179 mike          1.15 
180 karl          1.17     ///
181 mike          1.34     void toXml(Buffer& out) const;
182 mike          1.15 
183 karl          1.17     ///
184 mike          1.34     void toMof(Buffer& out) const;
185 mike          1.16 
186 karl          1.17     ///
187 mike          1.15     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const;
188                    
189 karl          1.17     ///
190 mike          1.15     Boolean identical(const CIMQualifierList& x) const;
191                    
192 karl          1.17     ///
193 mike          1.15     void cloneTo(CIMQualifierList& x) const;
194                    
195                    private:
196                    
197                        Array<CIMQualifier> _qualifiers;
198                    };
199                    
200                    PEGASUS_NAMESPACE_END
201                    
202                    #endif /* Pegasus_QualifierList_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2