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

  1 mike  1.15 //%/////////////////////////////////////////////////////////////////////////////
  2            //
  3 kumpf 1.23 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4            // The Open Group, Tivoli Systems
  5 mike  1.15 //
  6            // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 kumpf 1.23 // 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.15 // 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.23 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mike  1.15 // 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.23 // 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.15 // 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 kumpf 1.26 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 27            //                (carolann_graves@hp.com)
 28 mike  1.15 //
 29            //%/////////////////////////////////////////////////////////////////////////////
 30            
 31            #ifndef Pegasus_QualifierList_h
 32            #define Pegasus_QualifierList_h
 33            
 34            #include <Pegasus/Common/Config.h>
 35 kumpf 1.25 #include <Pegasus/Common/Linkage.h>
 36            #include <Pegasus/Common/CIMName.h>
 37 mike  1.15 #include <Pegasus/Common/CIMQualifier.h>
 38 kumpf 1.26 #include <Pegasus/Common/CIMScope.h>
 39 mike  1.15 #include <Pegasus/Common/Array.h>
 40            #include <Pegasus/Common/Pair.h>
 41            
 42 karl  1.20 
 43            /* ATTN: P2 KS 25 Mar 2002 - The function names are a mismash of local and taken
 44               from the class and instance functions.  Thus, we have getCount but getQualifier
 45               This causes confusion with the functions in class and instance which are specifically
 46               getQualifier.  We should clean up so the names here remove the Qualifier portion.
 47            */
 48 mike  1.15 PEGASUS_NAMESPACE_BEGIN
 49            
 50            class DeclContext;
 51            
 52 karl  1.22 
 53            /* ATTN: KS P3 DEFER 1 May 2002. We have list processors (really array processors) for
 54                qualifiers, properties, methods(???) but they are all slightly different.
 55                Should we create a common base??
 56            */
 57            /** This class is for representing Qualifier lists in the CIM interface.
 58            
 59                Members are provided for accessing elements of the the internal property
 60                list. There are none for modifying elements (the entire array must be
 61                formed and passed to the constructor or replaced by calling set()).
 62            */
 63            
 64 mike  1.15 class PEGASUS_COMMON_LINKAGE CIMQualifierList
 65            {
 66            public:
 67            
 68 karl  1.22     /// constructor - Constructs a NULL qualifier list.
 69 mike  1.15     CIMQualifierList();
 70            
 71 karl  1.17     ///
 72 mike  1.15     ~CIMQualifierList();
 73            
 74 karl  1.22     /** add adds a single CIMQualifier to a CIMQualifierList
 75                */
 76 mike  1.15     CIMQualifierList& add(const CIMQualifier& qualifier);
 77            
 78 karl  1.20     /**	 getCount - Returns the count of qualifiers in the list
 79            	@return Zero origin count of qualifiers in the qualifier list.
 80                */
 81 mike  1.15     Uint32 getCount() const
 82                {
 83            	return _qualifiers.size(); 
 84                }
 85            
 86 kumpf 1.28     /** getQualifer - Gets the qaulifier defined at the index provided
 87 karl  1.20 	in the Qualifier list.
 88 kumpf 1.28 	@param index - The position in the qualifierlist containing the
 89 karl  1.20 	qualifier.
 90            	@return CIMQualifier object.
 91            	@exception - Throws OutofBounds exception of pso not within the
 92            	qualifier list.
 93            	ATTN: P0 KS Mar 2002 Add the outofbounds exception.
 94                */
 95 kumpf 1.28     CIMQualifier& getQualifier(Uint32 index);
 96 mike  1.15 
 97 kumpf 1.28     const CIMQualifier& getQualifier(Uint32 index) const
 98 mike  1.15     {
 99 kumpf 1.28 	return _qualifiers[index]; 
100 mike  1.15     }
101 karl  1.20 
102 mike  1.15     /** removeQualifier - Removes the Qualifier defined by
103 kumpf 1.28 	the index parameter
104            	@exception IndexOutOfBoundsException if index not within
105 karl  1.20 	range of current qualifiers.
106 mike  1.15     */
107 kumpf 1.28     void removeQualifier(Uint32 index);
108 mike  1.15     
109 karl  1.20     /**	find - Searches for a qualifier with the specified `
110                    input name if it exists in the class
111            	@param name CIMName of the qualifier
112            	to be found @return Position of the qualifier in the Class.
113            	@return Returns index of the qualifier found or PEG_NOT_FOUND
114            	if not found.
115                */
116 kumpf 1.25     Uint32 find(const CIMName& name) const;
117 mike  1.15 
118 karl  1.20     /** exists - Returns true if the qualifier with the
119            	specified name exists in the class
120 kumpf 1.25 	@param name CIMName name of the qualifier object being tested.
121 karl  1.20 	@return True if the qualifier exits in the list.  Otherwise
122            	false is returned.
123                */
124            
125 kumpf 1.25     Boolean exists(const CIMName& name) const
126 karl  1.20     {
127            	return (((find(name)) == PEG_NOT_FOUND)? false : true);
128                }
129            
130                /** isTrue - Determines if the qualifier defined by
131            	the input parameter exists for the class, is Boolean, and
132            	has a value of true.
133            	This function is useful to quickly determine the state of a
134            	qualifier.
135 kumpf 1.25 	@param CIMName containing the qualifier  name.
136 karl  1.20 	@return Boolean True if the qualifier exists, 
137                */
138 kumpf 1.25     Boolean isTrue(const CIMName& name) const;
139 karl  1.20 
140                /// findReverse - See find
141 kumpf 1.25     Uint32 findReverse(const CIMName& name) const;
142 karl  1.17     
143 karl  1.19     /** resolve - Resolves the qualifierList based on the information provided. The resolved
144 karl  1.21 	qualifiers are the result of validating and testing the qualifiers against the
145            	inherited qualifiers and qualifier declarations.  The qualifier list contains
146            	the set of resolved qualifiers when the function is complete.
147            	Resolution includes:
148            	1. Determining if the qualifier is declared (obtainable form declContext).
149            	2. Qualifier is same type as declaration
150            	3. Valid for the scope provided (Qualifier scope contains the provided scope).
151            	4. Whether qualifier can be overridden.
152            	5. Whether it should be propagated to subclass
153            	If a qualifier can be overridden it is put into the qualifiers array.
154                    @param declContext  Declaration context for this resolution (ex repository, simple)
155 karl  1.19         @param nameSpace Namespace in which to find the declaration.
156 karl  1.21         @param scope - Scope of the entity doing the resolution (ex. Class, association, etc.)
157 karl  1.19         @param isInstancePart - TBD
158                    @param inheritedQualifiers - CimQualifierList defining List of inherited qualifiers
159            		@param propagateQualifiers Boolean indicator whether to propagate qualifiers.
160                    @return 
161                	@exception - There are a number of different 
162 karl  1.17     */ 
163 mike  1.15     void resolve(
164            	DeclContext* declContext,
165 kumpf 1.29 	const CIMNamespaceName & nameSpace,
166 kumpf 1.26 	CIMScope scope,
167 mike  1.15 	Boolean isInstancePart,
168 mike  1.18 	CIMQualifierList& inheritedQualifiers,
169            	Boolean propagateQualifiers);
170 mike  1.15 
171 karl  1.17     ///
172 mike  1.15     void toXml(Array<Sint8>& out) const;
173            
174 karl  1.17     ///
175 mike  1.16     void toMof(Array<Sint8>& out) const;
176            
177 karl  1.17     ///
178 mike  1.15     void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const;
179            
180 karl  1.17     ///
181 mike  1.15     Boolean identical(const CIMQualifierList& x) const;
182            
183 karl  1.17     ///
184 mike  1.15     void cloneTo(CIMQualifierList& x) const;
185            
186            private:
187            
188                Array<CIMQualifier> _qualifiers;
189            };
190            
191            PEGASUS_NAMESPACE_END
192            
193            #endif /* Pegasus_QualifierList_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2