1 mike 1.15 //%/////////////////////////////////////////////////////////////////////////////
2 //
|
3 kumpf 1.21 // 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.21 // 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.21 // 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.21 // 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_MethodRep_h
31 #define Pegasus_MethodRep_h
32
33 #include <Pegasus/Common/Config.h>
34 #include <Pegasus/Common/Exception.h>
35 #include <Pegasus/Common/String.h>
36 #include <Pegasus/Common/CIMQualifier.h>
37 #include <Pegasus/Common/CIMQualifierList.h>
38 #include <Pegasus/Common/CIMParameter.h>
39 #include <Pegasus/Common/Sharable.h>
40 mike 1.15 #include <Pegasus/Common/Pair.h>
41
42 PEGASUS_NAMESPACE_BEGIN
43
44 class CIMConstMethod;
45 class DeclContext;
46
47 class PEGASUS_COMMON_LINKAGE CIMMethodRep : public Sharable
48 {
49 public:
50
51 CIMMethodRep(
52 const String& name,
53 CIMType type,
54 const String& classOrigin,
55 Boolean propagated);
56
57 ~CIMMethodRep();
58
59 virtual const String& getName() const
60 {
61 mike 1.15 return _name;
62 }
63
64 void setName(const String& name);
65
66 CIMType getType() const
67 {
68 return _type;
69 }
70
71 void setType(CIMType type);
72
73 const String& getClassOrigin() const
74 {
75 return _classOrigin;
76 }
77
78 void setClassOrigin(const String& classOrigin);
79
80 Boolean getPropagated() const
81 {
82 mike 1.15 return _propagated;
83 }
84
85 void setPropagated(Boolean propagated)
86 {
87 _propagated = propagated;
88 }
89
90 void addQualifier(const CIMQualifier& qualifier)
91 {
92 _qualifiers.add(qualifier);
93 }
|
94 kumpf 1.18
|
95 mike 1.15 Uint32 findQualifier(const String& name) const
96 {
97 return _qualifiers.find(name);
98 }
|
99 kumpf 1.18
|
100 mike 1.15 Boolean existsQualifier(const String& name) const
101 {
102 return (findQualifier(name) != PEG_NOT_FOUND) ? true : false;
103 }
104
105 CIMQualifier getQualifier(Uint32 pos)
106 {
107 return _qualifiers.getQualifier(pos);
108 }
109
110
111 CIMConstQualifier getQualifier(Uint32 pos) const
112 {
113 return _qualifiers.getQualifier(pos);
114 }
|
115 kumpf 1.18
|
116 mike 1.15 void removeQualifier(Uint32 pos)
117 {
118 _qualifiers.removeQualifier(pos);
119 }
120
121
122 Uint32 getQualifierCount() const
123 {
124 return _qualifiers.getCount();
125 }
126
127 void addParameter(const CIMParameter& x);
128
|
129 kumpf 1.18 Uint32 findParameter(const String& name) const;
|
130 mike 1.15
131 CIMParameter getParameter(Uint32 pos);
132
133 CIMConstParameter getParameter(Uint32 pos) const
134 {
135 return ((CIMMethodRep*)this)->getParameter(pos);
136 }
137
138 Uint32 getParameterCount() const;
139
140 void resolve(
141 DeclContext* declContext,
142 const String& nameSpace,
143 const CIMConstMethod& method);
144
145 void resolve(
146 DeclContext* declContext,
147 const String& nameSpace);
148
149 void toXml(Array<Sint8>& out) const;
150
|
151 mike 1.16 void toMof(Array<Sint8>& out) const;
152
|
153 mike 1.15 Boolean identical(const CIMMethodRep* x) const;
154
155 CIMMethodRep* clone() const
156 {
157 return new CIMMethodRep(*this);
158 }
159
160 private:
161
162 CIMMethodRep();
163
164 CIMMethodRep(const CIMMethodRep& x);
165
|
166 kumpf 1.17 // This method is declared and made private so that the compiler does
167 // not implicitly define a default copy constructor.
168 CIMMethodRep& operator=(const CIMMethodRep& x)
169 {
|
170 kumpf 1.20 //PEGASUS_ASSERT(0);
|
171 kumpf 1.17 return *this;
172 }
|
173 mike 1.15
174 String _name;
175 CIMType _type;
176 String _classOrigin;
177 Boolean _propagated;
178 CIMQualifierList _qualifiers;
179 Array<CIMParameter> _parameters;
180
181 friend class CIMClassRep;
182 };
183
184 PEGASUS_NAMESPACE_END
185
186 #endif /* Pegasus_MethodRep_h */
|