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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2