(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            #include <Pegasus/Common/String.h>
 36 kumpf 1.10 #include <Pegasus/Common/Sharable.h>
 37 mike  1.1  #include <Pegasus/Common/CIMProperty.h>
 38            #include <Pegasus/Common/CIMQualifier.h>
 39 kumpf 1.8  #include <Pegasus/Common/CIMQualifierList.h>
 40 mike  1.1  #include <Pegasus/Common/Array.h>
 41            
 42            PEGASUS_NAMESPACE_BEGIN
 43            
 44            /** This class defines the internal representation of the CIMObject class.
 45            
 46                This base class has two implementations: CIMClassRep CIMInstanceRep. The
 47                CIMObjectRep pointer member of CIMObject points to one of these.
 48            
 49                This class contains what is common to CIMClass and CIMInstance.
 50            */
 51            class PEGASUS_COMMON_LINKAGE CIMObjectRep : public Sharable
 52            {
 53            public:
 54            
 55 kumpf 1.12     CIMObjectRep(const CIMObjectPath& className);
 56 mike  1.1  
 57                virtual ~CIMObjectRep();
 58            
 59 chip  1.3      const String& getClassName() const
 60 chip  1.2      {
 61 chip  1.4  	return _reference.getClassName();
 62                }
 63            
 64 kumpf 1.12     const CIMObjectPath& getPath() const
 65 chip  1.4      {
 66            	return _reference;
 67 mike  1.1      }
 68 kumpf 1.15 
 69                /**
 70                  Sets the object path for the object
 71                  @param  path  CIMObjectPath containing the object path
 72                 */
 73                void setPath (const CIMObjectPath & path);
 74 mike  1.1  
 75                void addQualifier(const CIMQualifier& qualifier)
 76                {
 77            	_qualifiers.add(qualifier);
 78                }
 79            
 80                Uint32 findQualifier(const String& name) const
 81                {
 82            	return _qualifiers.find(name);
 83                }
 84            
 85                CIMQualifier getQualifier(Uint32 pos)
 86                {
 87            	return _qualifiers.getQualifier(pos);
 88                }
 89            
 90                CIMConstQualifier getQualifier(Uint32 pos) const
 91                {
 92            	return _qualifiers.getQualifier(pos);
 93                }
 94            
 95 karl  1.5      Boolean isTrueQualifer(String& name) const
 96                {
 97            	return _qualifiers.isTrue(name);
 98                }
 99            
100 mike  1.1      Uint32 getQualifierCount() const
101                {
102            	return _qualifiers.getCount();
103                }
104            
105                void removeQualifier(Uint32 pos)
106                {
107            	_qualifiers.removeQualifier(pos);
108                }
109            
110                virtual void addProperty(const CIMProperty& x);
111            
112 kumpf 1.9      Uint32 findProperty(const String& name) const;
113 mike  1.1  
114                CIMProperty getProperty(Uint32 pos);
115            
116                CIMConstProperty getProperty(Uint32 pos) const
117                {
118            	return ((CIMObjectRep*)this)->getProperty(pos);
119                }
120            
121                void removeProperty(Uint32 pos);
122            
123                Uint32 getPropertyCount() const;
124            
125                virtual Boolean identical(const CIMObjectRep* x) const;
126            
127                virtual void toXml(Array<Sint8>& out) const = 0;
128            
129                virtual CIMObjectRep* clone() const = 0;
130            
131            protected:
132            
133                CIMObjectRep();
134 mike  1.1  
135                CIMObjectRep(const CIMObjectRep& x);
136            
137 kumpf 1.12     CIMObjectPath _reference;
138 kumpf 1.9      CIMQualifierList _qualifiers;
139                Array<CIMProperty> _properties;
140                Boolean _resolved;
141            
142            private:
143            
144                // This method is declared and made private so that the compiler does
145                // not implicitly define a default copy constructor.
146 mike  1.1      CIMObjectRep& operator=(const CIMObjectRep& x)
147                {
148 kumpf 1.14 	//PEGASUS_ASSERT(0);
149 mike  1.1  	return *this;
150                }
151            
152                friend class CIMObject;
153            };
154            
155            PEGASUS_NAMESPACE_END
156            
157            #endif /* Pegasus_CIMObjectRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2