(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               
 50               CIMClassRep(
 51           	const String& className, 
 52           	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 mike  1.1 
 66               void addQualifier(const CIMQualifier& qualifier)
 67               {
 68           	_qualifiers.add(qualifier);
 69               }
 70           
 71               Uint32 findQualifier(const String& name) const
 72               {
 73           	return _qualifiers.find(name);
 74               }
 75           
 76               CIMQualifier getQualifier(Uint32 pos)
 77               {
 78           	return _qualifiers.getQualifier(pos);
 79               }
 80           
 81               CIMConstQualifier getQualifier(Uint32 pos) const
 82               {
 83           	return _qualifiers.getQualifier(pos);
 84               }
 85           
 86 mike  1.1     Uint32 getQualifierCount() const
 87               {
 88           	return _qualifiers.getCount();
 89               }
 90           
 91               void addProperty(const CIMProperty& x);
 92           
 93               void removeProperty(Uint32 pos);
 94           
 95               Uint32 findProperty(const String& name);
 96           
 97               Uint32 findProperty(const String& name) const
 98               {
 99           	return ((CIMClassRep*)this)->findProperty(name);
100               }
101           
102               CIMProperty getProperty(Uint32 pos);
103           
104 mike  1.5     CIMConstProperty getProperty(Uint32 pos) const
105 mike  1.1     {
106           	return ((CIMClassRep*)this)->getProperty(pos);
107               }
108           
109               Uint32 getPropertyCount() const;
110           
111               void addMethod(const CIMMethod& x);
112           
113               Uint32 findMethod(const String& name);
114           
115               Uint32 findMethod(const String& name) const
116               {
117           	return ((CIMClassRep*)this)->findMethod(name);
118               }
119           
120               CIMMethod getMethod(Uint32 pos);
121           
122               CIMConstMethod getMethod(Uint32 pos) const
123               {
124           	return ((CIMClassRep*)this)->getMethod(pos);
125               }
126 mike  1.1 
127               Uint32 getMethodCount() const;
128           
129               void resolve(
130           	DeclContext* context,
131           	const String& nameSpace);
132           
133               void toXml(Array<Sint8>& out) const;
134           
135 bob   1.4     void print(std::ostream &o=std::cout) const;
136 mike  1.1 
137               Boolean identical(const CIMClassRep* x) const;
138           
139               CIMClassRep* clone() const
140               {
141           	return new CIMClassRep(*this);
142               }
143 mike  1.2 
144 mike  1.3     /** Return the names of all properties which bear a true key qualifier. 
145           	Sort the keys in ascending order.
146               */
147 mike  1.2     void getKeyNames(Array<String>& keyNames) const;
148 mike  1.1 
149           private:
150           
151               CIMClassRep();
152           
153               CIMClassRep(const CIMClassRep& x);
154           
155               CIMClassRep& operator=(const CIMClassRep& x);
156           
157               String _className;
158               String _superClassName;
159               CIMQualifierList _qualifiers;
160               Array<CIMProperty> _properties;
161               Array<CIMMethod> _methods;
162               Boolean _resolved;
163           
164               friend class CIMClass;
165               friend class CIMInstanceRep;
166           };
167           
168           PEGASUS_NAMESPACE_END
169 mike  1.1 
170 mike  1.6 #endif /* Pegasus_CIMClassRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2