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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2