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

  1 mike  1.1 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3 kumpf 1.16 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
  4            // The Open Group, Tivoli Systems
  5 mike  1.1  //
  6            // Permission is hereby granted, free of charge, to any person obtaining a copy
  7 chip  1.2  // of this software and associated documentation files (the "Software"), to
  8            // deal in the Software without restriction, including without limitation the
  9            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 10 mike  1.1  // sell copies of the Software, and to permit persons to whom the Software is
 11            // furnished to do so, subject to the following conditions:
 12 kumpf 1.16 // 
 13 chip  1.2  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 14 mike  1.1  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 15            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 16 chip  1.2  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 17            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 18            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 19 mike  1.1  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 20            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 21            //
 22            //==============================================================================
 23            //
 24            // Author: Mike Brasher (mbrasher@bmc.com)
 25            //
 26 kumpf 1.15 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 27            //                  (carolann_graves@hp.com)
 28 mike  1.1  //
 29            //%/////////////////////////////////////////////////////////////////////////////
 30            
 31            #ifndef Pegasus_CIMObjectRep_h
 32            #define Pegasus_CIMObjectRep_h
 33            
 34            #include <Pegasus/Common/Config.h>
 35 kumpf 1.19 #include <Pegasus/Common/Linkage.h>
 36 mike  1.1  #include <Pegasus/Common/String.h>
 37 kumpf 1.10 #include <Pegasus/Common/Sharable.h>
 38 kumpf 1.19 #include <Pegasus/Common/CIMName.h>
 39 mike  1.1  #include <Pegasus/Common/CIMProperty.h>
 40            #include <Pegasus/Common/CIMQualifier.h>
 41 kumpf 1.8  #include <Pegasus/Common/CIMQualifierList.h>
 42 mike  1.1  #include <Pegasus/Common/Array.h>
 43            
 44            PEGASUS_NAMESPACE_BEGIN
 45            
 46            /** This class defines the internal representation of the CIMObject class.
 47            
 48                This base class has two implementations: CIMClassRep CIMInstanceRep. The
 49                CIMObjectRep pointer member of CIMObject points to one of these.
 50            
 51                This class contains what is common to CIMClass and CIMInstance.
 52            */
 53            class PEGASUS_COMMON_LINKAGE CIMObjectRep : public Sharable
 54            {
 55            public:
 56            
 57 kumpf 1.12     CIMObjectRep(const CIMObjectPath& className);
 58 mike  1.1  
 59                virtual ~CIMObjectRep();
 60            
 61 kumpf 1.19     const CIMName& getClassName() const
 62 chip  1.2      {
 63 chip  1.4  	return _reference.getClassName();
 64                }
 65            
 66 kumpf 1.12     const CIMObjectPath& getPath() const
 67 chip  1.4      {
 68            	return _reference;
 69 mike  1.1      }
 70 kumpf 1.15 
 71                /**
 72                  Sets the object path for the object
 73                  @param  path  CIMObjectPath containing the object path
 74                 */
 75                void setPath (const CIMObjectPath & path);
 76 mike  1.1  
 77                void addQualifier(const CIMQualifier& qualifier)
 78                {
 79            	_qualifiers.add(qualifier);
 80                }
 81            
 82 kumpf 1.19     Uint32 findQualifier(const CIMName& name) const
 83 mike  1.1      {
 84            	return _qualifiers.find(name);
 85                }
 86            
 87 kumpf 1.20     CIMQualifier getQualifier(Uint32 index)
 88 mike  1.1      {
 89 kumpf 1.20 	return _qualifiers.getQualifier(index);
 90 mike  1.1      }
 91            
 92 kumpf 1.20     CIMConstQualifier getQualifier(Uint32 index) const
 93 mike  1.1      {
 94 kumpf 1.20 	return _qualifiers.getQualifier(index);
 95 mike  1.1      }
 96            
 97 kumpf 1.19     Boolean isTrueQualifer(CIMName& name) const
 98 karl  1.5      {
 99            	return _qualifiers.isTrue(name);
100                }
101            
102 mike  1.1      Uint32 getQualifierCount() const
103                {
104            	return _qualifiers.getCount();
105                }
106            
107 kumpf 1.20     void removeQualifier(Uint32 index)
108 mike  1.1      {
109 kumpf 1.20 	_qualifiers.removeQualifier(index);
110 mike  1.1      }
111            
112                virtual void addProperty(const CIMProperty& x);
113            
114 kumpf 1.19     Uint32 findProperty(const CIMName& name) const;
115 mike  1.1  
116 kumpf 1.20     CIMProperty getProperty(Uint32 index);
117 mike  1.1  
118 kumpf 1.20     CIMConstProperty getProperty(Uint32 index) const
119 mike  1.1      {
120 kumpf 1.20 	return ((CIMObjectRep*)this)->getProperty(index);
121 mike  1.1      }
122            
123 kumpf 1.20     void removeProperty(Uint32 index);
124 mike  1.1  
125                Uint32 getPropertyCount() const;
126            
127                virtual Boolean identical(const CIMObjectRep* x) const;
128            
129                virtual void toXml(Array<Sint8>& out) const = 0;
130            
131                virtual CIMObjectRep* clone() const = 0;
132            
133            protected:
134            
135                CIMObjectRep();
136            
137                CIMObjectRep(const CIMObjectRep& x);
138            
139 kumpf 1.12     CIMObjectPath _reference;
140 kumpf 1.9      CIMQualifierList _qualifiers;
141                Array<CIMProperty> _properties;
142                Boolean _resolved;
143            
144            private:
145            
146                // This method is declared and made private so that the compiler does
147                // not implicitly define a default copy constructor.
148 mike  1.1      CIMObjectRep& operator=(const CIMObjectRep& x)
149                {
150 kumpf 1.14 	//PEGASUS_ASSERT(0);
151 mike  1.1  	return *this;
152                }
153            
154                friend class CIMObject;
155            };
156            
157            PEGASUS_NAMESPACE_END
158            
159            #endif /* Pegasus_CIMObjectRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2