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

  1 mike  1.15 //%/////////////////////////////////////////////////////////////////////////////
  2            //
  3            // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
  4            //
  5            // Permission is hereby granted, free of charge, to any person obtaining a copy
  6            // of this software and associated documentation files (the "Software"), to 
  7            // deal in the Software without restriction, including without limitation the 
  8            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 
  9            // sell copies of the Software, and to permit persons to whom the Software is
 10            // furnished to do so, subject to the following conditions:
 11            // 
 12            // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN 
 13            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 14            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 15            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
 16            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 17            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
 18            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 19            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 20            //
 21            //==============================================================================
 22 mike  1.15 //
 23            // Author: Mike Brasher (mbrasher@bmc.com)
 24            //
 25            // Modified By:
 26            //
 27            //%/////////////////////////////////////////////////////////////////////////////
 28            
 29            #ifndef Pegasus_MethodRep_h
 30            #define Pegasus_MethodRep_h
 31            
 32            #include <Pegasus/Common/Config.h>
 33            #include <Pegasus/Common/Exception.h>
 34            #include <Pegasus/Common/String.h>
 35            #include <Pegasus/Common/CIMQualifier.h>
 36            #include <Pegasus/Common/CIMQualifierList.h>
 37            #include <Pegasus/Common/CIMParameter.h>
 38            #include <Pegasus/Common/Sharable.h>
 39            #include <Pegasus/Common/Pair.h>
 40            
 41            PEGASUS_NAMESPACE_BEGIN
 42            
 43 mike  1.15 class CIMConstMethod;
 44            class DeclContext;
 45            
 46            class PEGASUS_COMMON_LINKAGE CIMMethodRep : public Sharable
 47            {
 48            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 mike  1.15 
 65                CIMType getType() const
 66                {
 67            	return _type;
 68                }
 69            
 70                void setType(CIMType type);
 71            
 72                const String& getClassOrigin() const
 73                {
 74            	return _classOrigin;
 75                }
 76            
 77                void setClassOrigin(const String& classOrigin);
 78            
 79                Boolean getPropagated() const
 80                {
 81            	return _propagated;
 82                }
 83            
 84                void setPropagated(Boolean propagated)
 85 mike  1.15     {
 86            	_propagated = propagated;
 87                }
 88            
 89                void addQualifier(const CIMQualifier& qualifier)
 90                {
 91            	_qualifiers.add(qualifier);
 92                }
 93 kumpf 1.18 
 94 mike  1.15     Uint32 findQualifier(const String& name) const
 95                {
 96            	return _qualifiers.find(name);
 97                }
 98 kumpf 1.18 
 99 mike  1.15     Boolean existsQualifier(const String& name) const
100                {
101            	return (findQualifier(name) != PEG_NOT_FOUND) ? true : false;
102                }
103            
104                CIMQualifier getQualifier(Uint32 pos)
105                {
106            	return _qualifiers.getQualifier(pos);
107                }
108            
109            
110                CIMConstQualifier getQualifier(Uint32 pos) const
111                {
112            	return _qualifiers.getQualifier(pos);
113                }
114 kumpf 1.18 
115 mike  1.15     void removeQualifier(Uint32 pos)
116                {
117            	_qualifiers.removeQualifier(pos);
118                }
119            
120            
121                Uint32 getQualifierCount() const
122                {
123            	return _qualifiers.getCount();
124                }
125            
126                void addParameter(const CIMParameter& x);
127            
128 kumpf 1.18     Uint32 findParameter(const String& name) const;
129 mike  1.15 
130                CIMParameter getParameter(Uint32 pos);
131            
132                CIMConstParameter getParameter(Uint32 pos) const
133                {
134            	return ((CIMMethodRep*)this)->getParameter(pos);
135                }
136            
137                Uint32 getParameterCount() const;
138            
139                void resolve(
140            	DeclContext* declContext,
141            	const String& nameSpace,
142            	const CIMConstMethod& method);
143            
144                void resolve(
145            	DeclContext* declContext,
146            	const String& nameSpace);
147            
148                void toXml(Array<Sint8>& out) const;
149            
150 mike  1.16     void toMof(Array<Sint8>& out) const;
151            
152 mike  1.15     Boolean identical(const CIMMethodRep* x) const;
153            
154                CIMMethodRep* clone() const
155                {
156            	return new CIMMethodRep(*this);
157                }
158            
159            private:
160            
161                CIMMethodRep();
162            
163                CIMMethodRep(const CIMMethodRep& x);
164            
165 kumpf 1.17     // This method is declared and made private so that the compiler does
166                // not implicitly define a default copy constructor.
167                CIMMethodRep& operator=(const CIMMethodRep& x)
168                {
169                    PEGASUS_ASSERT(0);
170                    return *this;
171                }
172 mike  1.15 
173                String _name;
174                CIMType _type;
175                String _classOrigin;
176                Boolean _propagated;
177                CIMQualifierList _qualifiers;
178                Array<CIMParameter> _parameters;
179            
180                friend class CIMClassRep;
181            };
182            
183            PEGASUS_NAMESPACE_END
184            
185            #endif /* Pegasus_MethodRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2