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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2