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

  1 mike  1.16 //%/////////////////////////////////////////////////////////////////////////////
  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.16 //
 23            // Author: Mike Brasher (mbrasher@bmc.com)
 24            //
 25            // Modified By:
 26            //
 27            //%/////////////////////////////////////////////////////////////////////////////
 28            
 29            #ifndef Pegasus_CIMClassRep_h
 30            #define Pegasus_CIMClassRep_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/CIMProperty.h>
 38            #include <Pegasus/Common/CIMMethod.h>
 39            
 40            PEGASUS_NAMESPACE_BEGIN
 41            
 42            class DeclContext;
 43 mike  1.16 class CIMClass;
 44            class CIMConstClass;
 45            class CIMInstanceRep;
 46            
 47            class PEGASUS_COMMON_LINKAGE CIMClassRep : public Sharable
 48            {
 49            public:
 50            
 51                CIMClassRep(
 52            	const String& className,
 53            	const String& superClassName);
 54            
 55                ~CIMClassRep();
 56            
 57                Boolean isAssociation() const;
 58            
 59                Boolean isAbstract() const;
 60            
 61                const String& getClassName() const { return _className; }
 62            
 63                const String& getSuperClassName() const { return _superClassName; }
 64 mike  1.16 
 65                void setSuperClassName(const String& superClassName);
 66            
 67                void addQualifier(const CIMQualifier& qualifier)
 68                {
 69            	_qualifiers.add(qualifier);
 70                }
 71            
 72                Uint32 findQualifier(const String& name) const
 73                {
 74            	return _qualifiers.find(name);
 75                }
 76            
 77                Boolean existsQualifier(const String& name) const
 78                {
 79            	return ((_qualifiers.find(name) != PEG_NOT_FOUND) ? true : false);
 80                }
 81            
 82                CIMQualifier getQualifier(Uint32 pos)
 83                {
 84            	return _qualifiers.getQualifier(pos);
 85 mike  1.16     }
 86            
 87                CIMConstQualifier getQualifier(Uint32 pos) const
 88                {
 89            	return _qualifiers.getQualifier(pos);
 90                }
 91            
 92                Uint32 getQualifierCount() const
 93                {
 94            	return _qualifiers.getCount();
 95                }
 96            
 97                void removeQualifier(Uint32 pos)
 98                {
 99                _qualifiers.removeQualifier(pos);
100                }
101            
102                void addProperty(const CIMProperty& x);
103            
104            
105                Uint32 findProperty(const String& name);
106 mike  1.16 
107                Uint32 findProperty(const String& name) const
108                {
109            	return ((CIMClassRep*)this)->findProperty(name);
110                }
111            
112                Boolean existsProperty(const String& name);
113            
114                Boolean existsProperty(const String& name) const
115                {
116            	return ((CIMClassRep*)this)->existsProperty(name);
117                }
118            
119                CIMProperty getProperty(Uint32 pos);
120            
121                CIMConstProperty getProperty(Uint32 pos) const
122                {
123            	return ((CIMClassRep*)this)->getProperty(pos);
124                }
125            
126                void removeProperty(Uint32 pos);
127 mike  1.16 
128            
129                Uint32 getPropertyCount() const;
130            
131                void addMethod(const CIMMethod& x);
132            
133                Uint32 findMethod(const String& name);
134            
135                Uint32 findMethod(const String& name) const
136                {
137            	return ((CIMClassRep*)this)->findMethod(name);
138                }
139            
140                Boolean existsMethod(const String& name);
141            
142                Boolean existsMethod(const String& name) const
143                {
144            	return ((CIMClassRep*)this)->existsMethod(name);
145                }
146            
147            
148 mike  1.16     CIMMethod getMethod(Uint32 pos);
149            
150                CIMConstMethod getMethod(Uint32 pos) const
151                {
152            	return ((CIMClassRep*)this)->getMethod(pos);
153                }
154            
155                void removeMethod(Uint32 pos);
156            
157                Uint32 getMethodCount() const;
158            
159                void resolve(
160            	DeclContext* context,
161            	const String& nameSpace);
162            
163                void toXml(Array<Sint8>& out) const;
164            
165                void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const;
166            
167                Boolean identical(const CIMClassRep* x) const;
168            
169 mike  1.16     CIMClassRep* clone() const
170                {
171            	return new CIMClassRep(*this);
172                }
173            
174                void getKeyNames(Array<String>& keyNames) const;
175            
176                Boolean hasKeys() const;
177            
178            private:
179            
180                CIMClassRep();
181            
182                CIMClassRep(const CIMClassRep& x);
183            
184                CIMClassRep& operator=(const CIMClassRep& x);
185            
186                String _className;
187                String _superClassName;
188                CIMQualifierList _qualifiers;
189                Array<CIMProperty> _properties;
190 mike  1.16     Array<CIMMethod> _methods;
191                Boolean _resolved;
192            
193                friend class CIMClass;
194                friend class CIMInstanceRep;
195            };
196            
197            PEGASUS_NAMESPACE_END
198            
199            #endif /* Pegasus_CIMClassRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2