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