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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2