1 mike 1.1 //BEGIN_LICENSE
2 //
3 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a
6 // copy of this software and associated documentation files (the "Software"),
7 // to deal in the Software without restriction, including without limitation
8 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 // and/or sell copies of the Software, and to permit persons to whom the
10 // Software is furnished to do so, subject to the following conditions:
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 // DEALINGS IN THE SOFTWARE.
19 //
20 //END_LICENSE
21 //BEGIN_HISTORY
22 mike 1.1 //
23 // Author:
24 //
25 // $Log: CIMMethodRep.h,v $
|
31 mike 1.1 //
32 // Revision 1.1 2001/02/16 02:07:06 mike
33 // Renamed many classes and headers (using new CIM prefixes).
34 //
35 // Revision 1.1.1.1 2001/01/14 19:52:58 mike
36 // Pegasus import
37 //
38 //
39 //END_HISTORY
40
41 #ifndef Pegasus_MethodRep_h
42 #define Pegasus_MethodRep_h
43
44 #include <Pegasus/Common/Config.h>
45 #include <Pegasus/Common/Exception.h>
46 #include <Pegasus/Common/String.h>
47 #include <Pegasus/Common/CIMQualifier.h>
48 #include <Pegasus/Common/CIMQualifierList.h>
49 #include <Pegasus/Common/CIMParameter.h>
50 #include <Pegasus/Common/Sharable.h>
51 #include <Pegasus/Common/Pair.h>
52 mike 1.1
53 PEGASUS_NAMESPACE_BEGIN
54
55 class CIMMethod;
56 class CIMConstMethod;
57 class DeclContext;
58
59 class PEGASUS_COMMON_LINKAGE CIMMethodRep : public Sharable
60 {
61 public:
62
63 CIMMethodRep(
64 const String& name,
65 CIMType type,
66 const String& classOrigin,
67 Boolean propagated);
68
69 ~CIMMethodRep();
70
71 virtual const String& getName() const
72 {
73 mike 1.1 return _name;
74 }
75
76 void setName(const String& name);
77
78 CIMType getType() const
79 {
80 return _type;
81 }
82
83 void setType(CIMType type)
84 {
85 _type = type;
86
87 if (type == CIMType::NONE)
88 throw NullType();
89 }
90
91 const String& getClassOrigin() const
92 {
93 return _classOrigin;
94 mike 1.1 }
95
96 void setClassOrigin(const String& classOrigin);
97
98 Boolean getPropagated() const
99 {
100 return _propagated;
101 }
102
103 void setPropagated(Boolean propagated)
104 {
105 _propagated = propagated;
106 }
107
108 void addQualifier(const CIMQualifier& qualifier)
109 {
110 _qualifiers.add(qualifier);
111 }
112
113 Uint32 findQualifier(const String& name) const
114 {
115 mike 1.1 return _qualifiers.find(name);
116 }
117
118 CIMQualifier getQualifier(Uint32 pos)
119 {
120 return _qualifiers.getQualifier(pos);
121 }
122
123 CIMConstQualifier getQualifier(Uint32 pos) const
124 {
125 return _qualifiers.getQualifier(pos);
126 }
127
128 Uint32 getQualifierCount() const
129 {
130 return _qualifiers.getCount();
131 }
132
133 void addParameter(const CIMParameter& x);
134
135 Uint32 findParameter(const String& name);
136 mike 1.1
137 Uint32 findParameter(const String& name) const
138 {
139 return ((CIMMethodRep*)this)->findParameter(name);
140 }
141
142 CIMParameter getParameter(Uint32 pos);
143
144 CIMConstParameter getParameter(Uint32 pos) const
145 {
146 return ((CIMMethodRep*)this)->getParameter(pos);
147 }
148
149 Uint32 getParameterCount() const;
150
151 void resolve(
152 DeclContext* declContext,
153 const String& nameSpace,
154 const CIMConstMethod& method);
155
156 void resolve(
157 mike 1.1 DeclContext* declContext,
158 const String& nameSpace);
159
160 void toXml(Array<Sint8>& out) const;
161
162 virtual void print() const;
163
164 Boolean identical(const CIMMethodRep* x) const;
165
166 CIMMethodRep* clone() const
167 {
168 return new CIMMethodRep(*this);
169 }
170
171 private:
172
173 CIMMethodRep();
174
175 CIMMethodRep(const CIMMethodRep& x);
176
177 CIMMethodRep& operator=(const CIMMethodRep& x);
178 mike 1.1
179 String _name;
180 CIMType _type;
181 String _classOrigin;
182 Boolean _propagated;
183 CIMQualifierList _qualifiers;
184 Array<CIMParameter> _parameters;
185
186 friend class CIMClassRep;
187 };
188
189 PEGASUS_NAMESPACE_END
190
191 #endif /* Pegasus_MethodRep_h */
|