(file) Return to CIMMethodRep.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 mike  1.5 //%/////////////////////////////////////////////////////////////////////////////
  2 mike  1.1 //
  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 mike  1.5 //==============================================================================
 21 mike  1.1 //
 22 mike  1.5 // Author: Mike Brasher (mbrasher@bmc.com)
 23 mike  1.1 //
 24 mike  1.5 // Modified By:
 25 bob   1.3 //
 26 mike  1.5 //%/////////////////////////////////////////////////////////////////////////////
 27 mike  1.1 
 28           #ifndef Pegasus_MethodRep_h
 29           #define Pegasus_MethodRep_h
 30           
 31           #include <Pegasus/Common/Config.h>
 32           #include <Pegasus/Common/Exception.h>
 33           #include <Pegasus/Common/String.h>
 34           #include <Pegasus/Common/CIMQualifier.h>
 35           #include <Pegasus/Common/CIMQualifierList.h>
 36           #include <Pegasus/Common/CIMParameter.h>
 37           #include <Pegasus/Common/Sharable.h>
 38           #include <Pegasus/Common/Pair.h>
 39           
 40           PEGASUS_NAMESPACE_BEGIN
 41           
 42           class CIMMethod;
 43           class CIMConstMethod;
 44           class DeclContext;
 45           
 46           class PEGASUS_COMMON_LINKAGE CIMMethodRep : public Sharable
 47           {
 48 mike  1.1 public:
 49           
 50               CIMMethodRep(
 51           	const String& name, 
 52           	CIMType type,
 53           	const String& classOrigin,
 54           	Boolean propagated);
 55           
 56               ~CIMMethodRep();
 57           
 58               virtual const String& getName() const 
 59               { 
 60           	return _name; 
 61               }
 62           
 63               void setName(const String& name);
 64           
 65               CIMType getType() const 
 66               {
 67           	return _type; 
 68               }
 69 mike  1.1 
 70               void setType(CIMType type)
 71               {
 72           	_type = type; 
 73           
 74           	if (type == CIMType::NONE)
 75           	    throw NullType();
 76               }
 77           
 78               const String& getClassOrigin() const
 79               {
 80           	return _classOrigin;
 81               }
 82           
 83               void setClassOrigin(const String& classOrigin);
 84           
 85               Boolean getPropagated() const 
 86               { 
 87           	return _propagated; 
 88               }
 89           
 90 mike  1.1     void setPropagated(Boolean propagated) 
 91               { 
 92           	_propagated = propagated; 
 93               }
 94           
 95               void addQualifier(const CIMQualifier& qualifier)
 96               {
 97           	_qualifiers.add(qualifier);
 98               }
 99           
100               Uint32 findQualifier(const String& name) const
101               {
102           	return _qualifiers.find(name);
103               }
104           
105               CIMQualifier getQualifier(Uint32 pos)
106               {
107           	return _qualifiers.getQualifier(pos);
108               }
109           
110               CIMConstQualifier getQualifier(Uint32 pos) const
111 mike  1.1     {
112           	return _qualifiers.getQualifier(pos);
113               }
114           
115               Uint32 getQualifierCount() const
116               {
117           	return _qualifiers.getCount();
118               }
119           
120               void addParameter(const CIMParameter& x);
121           
122               Uint32 findParameter(const String& name);
123           
124               Uint32 findParameter(const String& name) const
125               {
126           	return ((CIMMethodRep*)this)->findParameter(name);
127               }
128           
129               CIMParameter getParameter(Uint32 pos);
130           
131               CIMConstParameter getParameter(Uint32 pos) const
132 mike  1.1     {
133           	return ((CIMMethodRep*)this)->getParameter(pos);
134               }
135           
136               Uint32 getParameterCount() const;
137           
138               void resolve(
139           	DeclContext* declContext, 
140           	const String& nameSpace,
141           	const CIMConstMethod& method);
142           
143               void resolve(
144           	DeclContext* declContext,
145           	const String& nameSpace);
146           
147               void toXml(Array<Sint8>& out) const;
148           
149 bob   1.3     virtual void print(std::ostream &o=std::cout) const;
150 mike  1.1 
151               Boolean identical(const CIMMethodRep* x) const;
152           
153               CIMMethodRep* clone() const
154               {
155           	return new CIMMethodRep(*this);
156               }
157           
158           private:
159           
160               CIMMethodRep();
161           
162               CIMMethodRep(const CIMMethodRep& x);
163           
164               CIMMethodRep& operator=(const CIMMethodRep& x);
165           
166               String _name;
167               CIMType _type;
168               String _classOrigin;
169               Boolean _propagated;
170               CIMQualifierList _qualifiers;
171 mike  1.1     Array<CIMParameter> _parameters;
172           
173               friend class CIMClassRep;
174           };
175           
176           PEGASUS_NAMESPACE_END
177           
178           #endif /* Pegasus_MethodRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2