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