1 karl 1.33 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.15 //
|
3 karl 1.29 // 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.28 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.29 // 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.31 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.33 // 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.21 // 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.21 // 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.21 // 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_MethodRep_h
35 #define Pegasus_MethodRep_h
36
37 #include <Pegasus/Common/Config.h>
|
38 kumpf 1.24 #include <Pegasus/Common/Linkage.h>
|
39 marek 1.37 #include <Pegasus/Common/Constants.h>
|
40 kumpf 1.26 #include <Pegasus/Common/InternalException.h>
|
41 mike 1.15 #include <Pegasus/Common/String.h>
|
42 kumpf 1.24 #include <Pegasus/Common/CIMName.h>
|
43 mike 1.15 #include <Pegasus/Common/CIMQualifier.h>
44 #include <Pegasus/Common/CIMQualifierList.h>
45 #include <Pegasus/Common/CIMParameter.h>
|
46 marek 1.37 #include <Pegasus/Common/CIMParameterRep.h>
|
47 mike 1.15 #include <Pegasus/Common/Sharable.h>
48 #include <Pegasus/Common/Pair.h>
|
49 marek 1.37 #include <Pegasus/Common/OrderedSet.h>
|
50 mike 1.15
51 PEGASUS_NAMESPACE_BEGIN
52
53 class CIMConstMethod;
54 class DeclContext;
55
|
56 mike 1.34 class CIMMethodRep : public Sharable
|
57 mike 1.15 {
58 public:
59
60 CIMMethodRep(
|
61 kumpf 1.35 const CIMName& name,
62 CIMType type,
63 const CIMName& classOrigin,
64 Boolean propagated);
|
65 mike 1.15
|
66 marek 1.39 ~CIMMethodRep()
67 {
68 }
|
69 mike 1.15
|
70 kumpf 1.24 virtual const CIMName& getName() const
|
71 mike 1.15 {
|
72 kumpf 1.35 return _name;
|
73 mike 1.15 }
74
|
75 kumpf 1.40 Uint32 getNameTag() const
|
76 marek 1.37 {
77 return _nameTag;
78 }
79
80 void increaseOwnerCount()
81 {
82 _ownerCount++;
83 return;
84 }
85
86 void decreaseOwnerCount()
87 {
88 _ownerCount++;
89 return;
90 }
91
|
92 kumpf 1.24 void setName(const CIMName& name);
|
93 mike 1.15
94 CIMType getType() const
95 {
|
96 kumpf 1.35 return _type;
|
97 mike 1.15 }
98
|
99 marek 1.39 void setType(CIMType type)
100 {
101 _type = type;
102 }
|
103 mike 1.15
|
104 kumpf 1.24 const CIMName& getClassOrigin() const
|
105 mike 1.15 {
|
106 kumpf 1.35 return _classOrigin;
|
107 mike 1.15 }
108
|
109 marek 1.39 void setClassOrigin(const CIMName& classOrigin)
110 {
111 _classOrigin = classOrigin;
112 }
|
113 mike 1.15
114 Boolean getPropagated() const
115 {
|
116 kumpf 1.35 return _propagated;
|
117 mike 1.15 }
118
119 void setPropagated(Boolean propagated)
120 {
|
121 kumpf 1.35 _propagated = propagated;
|
122 mike 1.15 }
123
124 void addQualifier(const CIMQualifier& qualifier)
125 {
|
126 kumpf 1.35 _qualifiers.add(qualifier);
|
127 mike 1.15 }
|
128 kumpf 1.18
|
129 kumpf 1.24 Uint32 findQualifier(const CIMName& name) const
|
130 mike 1.15 {
|
131 kumpf 1.35 return _qualifiers.find(name);
|
132 mike 1.15 }
133
|
134 kumpf 1.27 CIMQualifier getQualifier(Uint32 index)
|
135 mike 1.15 {
|
136 kumpf 1.35 return _qualifiers.getQualifier(index);
|
137 mike 1.15 }
138
139
|
140 kumpf 1.27 CIMConstQualifier getQualifier(Uint32 index) const
|
141 mike 1.15 {
|
142 kumpf 1.35 return _qualifiers.getQualifier(index);
|
143 mike 1.15 }
|
144 kumpf 1.18
|
145 kumpf 1.27 void removeQualifier(Uint32 index)
|
146 mike 1.15 {
|
147 kumpf 1.35 _qualifiers.removeQualifier(index);
|
148 mike 1.15 }
149
150
151 Uint32 getQualifierCount() const
152 {
|
153 kumpf 1.35 return _qualifiers.getCount();
|
154 mike 1.15 }
155
156 void addParameter(const CIMParameter& x);
157
|
158 marek 1.39 Uint32 findParameter(const CIMName& name) const
159 {
160 return _parameters.find(name, generateCIMNameTag(name));
161 }
|
162 mike 1.15
|
163 marek 1.39 CIMParameter getParameter(Uint32 index)
164 {
165 return _parameters[index];
166 }
|
167 mike 1.15
|
168 kumpf 1.27 CIMConstParameter getParameter(Uint32 index) const
|
169 mike 1.15 {
|
170 kumpf 1.35 return ((CIMMethodRep*)this)->getParameter(index);
|
171 mike 1.15 }
172
|
173 marek 1.39 void removeParameter (Uint32 index)
174 {
175 _parameters.remove (index);
176 }
|
177 kumpf 1.25
|
178 marek 1.39 Uint32 getParameterCount() const
179 {
180 return _parameters.size();
181 }
|
182 mike 1.15
183 void resolve(
|
184 kumpf 1.35 DeclContext* declContext,
185 const CIMNamespaceName& nameSpace,
186 const CIMConstMethod& method);
|
187 mike 1.15
188 void resolve(
|
189 kumpf 1.35 DeclContext* declContext,
190 const CIMNamespaceName& nameSpace);
|
191 mike 1.15
192 Boolean identical(const CIMMethodRep* x) const;
193
194 CIMMethodRep* clone() const
195 {
|
196 kumpf 1.35 return new CIMMethodRep(*this);
|
197 mike 1.15 }
198
199 private:
200
201 CIMMethodRep(const CIMMethodRep& x);
202
|
203 kumpf 1.36 CIMMethodRep(); // Unimplemented
204 CIMMethodRep& operator=(const CIMMethodRep& x); // Unimplemented
|
205 mike 1.15
|
206 kumpf 1.24 CIMName _name;
|
207 mike 1.15 CIMType _type;
|
208 kumpf 1.24 CIMName _classOrigin;
|
209 mike 1.15 Boolean _propagated;
210 CIMQualifierList _qualifiers;
|
211 marek 1.37 Uint32 _nameTag;
212 Uint32 _ownerCount;
213
214 typedef OrderedSet<CIMParameter,
215 CIMParameterRep,
216 PEGASUS_PARAMETER_ORDEREDSET_HASHSIZE> ParameterSet;
217 ParameterSet _parameters;
|
218 mike 1.15
219 friend class CIMClassRep;
220 };
221
222 PEGASUS_NAMESPACE_END
223
224 #endif /* Pegasus_MethodRep_h */
|