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

  1 karl  1.39 //%2003////////////////////////////////////////////////////////////////////////
  2 mike  1.6  //
  3 karl  1.39 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
  4            // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
  5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
  6            // IBM Corp.; EMC Corporation, The Open Group.
  7 mike  1.6  //
  8            // Permission is hereby granted, free of charge, to any person obtaining a copy
  9 chip  1.9  // of this software and associated documentation files (the "Software"), to
 10            // deal in the Software without restriction, including without limitation the
 11            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 12 mike  1.6  // sell copies of the Software, and to permit persons to whom the Software is
 13            // furnished to do so, subject to the following conditions:
 14 kumpf 1.28 // 
 15 chip  1.9  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 16 mike  1.6  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 17            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 18 chip  1.9  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 19            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 20            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 21 mike  1.6  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 22            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 23            //
 24            //==============================================================================
 25            //
 26            // Author: Mike Brasher (mbrasher@bmc.com)
 27            //
 28 kumpf 1.19 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 29 kumpf 1.24 //              Carol Ann Krug Graves, Hewlett-Packard Company
 30            //                  (carolann_graves@hp.com)
 31 mike  1.6  //
 32            //%/////////////////////////////////////////////////////////////////////////////
 33            
 34 mike  1.7  #ifndef Pegasus_Object_h
 35            #define Pegasus_Object_h
 36 mike  1.6  
 37            #include <Pegasus/Common/Config.h>
 38 kumpf 1.32 #include <Pegasus/Common/Linkage.h>
 39 kumpf 1.18 #include <Pegasus/Common/String.h>
 40 kumpf 1.32 #include <Pegasus/Common/CIMName.h>
 41 kumpf 1.18 #include <Pegasus/Common/Array.h>
 42            #include <Pegasus/Common/CIMProperty.h>
 43            #include <Pegasus/Common/CIMQualifier.h>
 44 mike  1.6  
 45            PEGASUS_NAMESPACE_BEGIN
 46            
 47 kumpf 1.18 class CIMConstObject;
 48            class CIMObjectRep;
 49 mike  1.7  class CIMClass;
 50            class CIMConstClass;
 51            class CIMInstance;
 52            class CIMConstInstance;
 53            
 54            ////////////////////////////////////////////////////////////////////////////////
 55            //
 56            // CIMObject
 57            //
 58            ////////////////////////////////////////////////////////////////////////////////
 59            
 60 kumpf 1.38 /** The CIMObject class is the superclass for the CIMInstance and 
 61                CIMClass classes.
 62 mike  1.7  
 63                The CIMObjectRep data member points to either a CIMInstanceRep or
 64                CIMClassRep.
 65 mike  1.6  */
 66            class PEGASUS_COMMON_LINKAGE CIMObject
 67            {
 68            public:
 69            
 70 mike  1.7      /** Constructor.
 71                */
 72 kumpf 1.18     CIMObject();
 73 mike  1.6  
 74 mike  1.7      /** Copy constructor.
 75                */
 76 kumpf 1.18     CIMObject(const CIMObject& x);
 77 mike  1.6  
 78 mike  1.7      /** Construction from CIMClass.
 79                */
 80                CIMObject(const CIMClass& x);
 81 mike  1.6  
 82 mike  1.7      /** Construction from CIMInstance.
 83                */
 84                CIMObject(const CIMInstance& x);
 85 mike  1.6  
 86 mike  1.7      /** Assignment operator.
 87                */
 88 kumpf 1.18     CIMObject& operator=(const CIMObject& x);
 89 mike  1.6  
 90 chip  1.9      /** Destructor.
 91 mike  1.7      */
 92 kumpf 1.18     ~CIMObject();
 93 mike  1.7  
 94 kumpf 1.38     /**	Gets the ClassName of the object.
 95            	@return ClassName of the object in a CIMName parameter.
 96 karl  1.13 	<pre>
 97 kumpf 1.32 	    CIMName className;
 98 karl  1.13 	    CIMClass myclass("myclass", "superclass");
 99            	    className = myclass.getClassName;
100            	</pre>
101 mike  1.7      */
102 kumpf 1.32     const CIMName& getClassName() const;
103 mike  1.7  
104 kumpf 1.38     ///
105 kumpf 1.22     const CIMObjectPath& getPath() const;
106 kumpf 1.24 
107 kumpf 1.38     /** Sets the object path for the object.
108                    @param  path -  CIMObjectPath containing the object path.
109                */
110 kumpf 1.24     void setPath (const CIMObjectPath & path);
111 chip  1.12 
112 kumpf 1.38     /**	Adds the CIMQualifier object to the instance.
113            	@param qualifier - CIMQualifier object to add to instance.
114            	@return the resulting CIMObject.
115            	@exception AlreadyExistsException if the CIMQualifier already 
116                    exists in the instance.
117 mike  1.7      */
118 kumpf 1.18     CIMObject& addQualifier(const CIMQualifier& qualifier);
119 mike  1.7  
120 kumpf 1.38     /**	Searches the instance for the qualifier object
121 mike  1.7          defined by the input parameter.
122 kumpf 1.38 	@param name - CIMName defining the qualifier object to be found.
123            	@return  Position of the qualifier to be used in subsequent
124 mike  1.7  	operations or PEG_NOT_FOUND if the qualifier is not found.
125                */
126 kumpf 1.32     Uint32 findQualifier(const CIMName& name) const;
127 mike  1.7  
128 kumpf 1.38     /**	Retrieves the qualifier object defined by the input parameter. 
129            	@param  index - Index for the qualifier object. The index to 
130                    qualifier objects is zero-origin and continuous so that 
131                    incrementing loops can be used to get all qualifier
132            	objects in a CIMInstance.
133            	@return CIMQualifier object defined by the index.
134            	@exception IndexOutOfBoundsException exception if the index
135            	is out of bounds.
136 mike  1.7      */
137 kumpf 1.36     CIMQualifier getQualifier(Uint32 index);
138 mike  1.7  
139 kumpf 1.38     /** Retrieves the qualifier object defined by the input parameter.  
140                    @param index - Index for the qualifier object. The index to 
141                    qualifier objects is zero-origin and continuous so that 
142                    incrementing loops can be used to get all qualifier
143            	objects in a CIMInstance.
144            	@return CIMConstQualifier object defined by the index.
145            	@exception IndexOutOfBoundsException exception if the index
146            	is out of bounds.
147 mike  1.7      */
148 kumpf 1.36     CIMConstQualifier getQualifier(Uint32 index) const;
149 kumpf 1.18 
150 kumpf 1.38     ///
151 kumpf 1.36     void removeQualifier(Uint32 index);
152 chip  1.11 	
153 kumpf 1.38     /** Gets the number of CIMQualifier objects defined for 
154                    this CIMObject.
155 kumpf 1.17 	@return	Count of the number of CIMQualifier objects in the
156 mike  1.7  	CIMObject.
157                */
158 kumpf 1.18     Uint32 getQualifierCount() const;
159 mike  1.7  
160 kumpf 1.38     /**	Adds a property object defined by the input parameter to 
161                    the CIMObject.
162            	@param x - Property Object to be added. See the CIM Property
163            	class for definition of the property object.
164            	@return the resulting CIMObject.
165 kumpf 1.35 	@exception AlreadyExistsException if the property already exists.
166 mike  1.7      */
167 kumpf 1.18     CIMObject& addProperty(const CIMProperty& x);
168 mike  1.7  
169 kumpf 1.38     /**	Searches the CIMProperty objects in the
170            	CIMObject for a property object with the name defined by the
171            	input parameter.
172            	@param name - CIMName with the name of the property object to be found.
173            	@return Position in the CIM object of the property object if found or
174 mike  1.7  	PEG_NOT_FOUND if no property object found with the name defined by the
175 kumpf 1.38 	input parameter.
176 mike  1.7      */
177 kumpf 1.32     Uint32 findProperty(const CIMName& name) const;
178 mike  1.7  
179 kumpf 1.38     /**	Gets the CIMProperty object in the CIMObject defined
180            	by the input parameter.
181            	@param index - Index to the property object in the CIMObject.
182 mike  1.7      	The index to qualifier objects is zero-origin and continuous
183            	so that incrementing loops can be used to get all qualifier
184            	objects in a CIMObject.
185            	@return CIMProperty object corresponding to the index.
186 kumpf 1.38 	@exception IndexOutOfBoundsException exception if the index
187            	is out of bounds.
188 mike  1.7      */
189 kumpf 1.36     CIMProperty getProperty(Uint32 index);
190 mike  1.7  
191 kumpf 1.38     /**	Gets the CIMproperty object in the CIMObject defined
192                    by the input parameter.
193                    @param index - Index to the property object in the CIMObject.
194 kumpf 1.36         @return CIMProperty object corresponding to the index.
195                    @exception IndexOutOfBoundsException if the index is outside the
196                    range of properties in this object.
197                */
198                CIMConstProperty getProperty(Uint32 index) const;
199            
200 kumpf 1.38     /** Remove the specified property from the instance.
201            	@param index - Index to the property to be removed from the
202 kumpf 1.36 	instance.  Normally this is obtained by findProperty();
203            	@exception IndexOutOfBoundsException if the index is outside the
204                    range of properties in this object.
205 mike  1.7      */
206 kumpf 1.36     void removeProperty(Uint32 index);
207 mike  1.7  
208 kumpf 1.38     /**	Gets the number of CIMProperty objects defined for this CIMObject.
209 mike  1.7  	@return	Count of the number of CIMProperty objects in the
210            	CIMObject. Zero indicates that no CIMProperty objects
211 kumpf 1.38 	are contained in the CIMObject.
212 mike  1.7      */
213 kumpf 1.18     Uint32 getPropertyCount() const;
214 mike  1.7  
215 kumpf 1.38     /** Makes a deep copy (clone) of the given object.
216                    @return copy of the CIMObject.
217 kumpf 1.18     */
218                CIMObject clone() const;
219 mike  1.7  
220 kumpf 1.38     /** Compares with another CIM Object.
221                    @param x - CIM object for comparision.
222                    @return true if the objects are identical, false otherwise.
223 mike  1.7      */
224                Boolean identical(const CIMConstObject& x) const;
225            
226 kumpf 1.38     /** Determines if the object has not been initialized.
227                    @return  true if the object has not been initialized,
228                             false otherwise.
229 kumpf 1.33      */
230                Boolean isUninitialized() const;
231 mike  1.7  
232 kumpf 1.38     /** Determines if the object represents a CIMClass.
233                    @return  true if the object represents a CIMClass,
234                             false otherwise.
235 kumpf 1.34      */
236                Boolean isClass () const;
237            
238 kumpf 1.38     /** Determines if the object represents a CIMInstance.
239                    @return  true if the object represents a CIMInstance,
240                             false otherwise
241 kumpf 1.34      */
242                Boolean isInstance () const;
243            
244 mike  1.7  private:
245            
246 kumpf 1.18     CIMObjectRep* _rep;
247 mike  1.7  
248 kumpf 1.18     CIMObject(CIMObjectRep* rep);
249 mike  1.7  
250 kumpf 1.18     void _checkRep() const;
251 mike  1.7  
252                friend class CIMConstObject;
253                friend class CIMClass;
254                friend class CIMConstClass;
255                friend class CIMInstance;
256                friend class CIMConstInstance;
257            };
258            
259 kumpf 1.25 #define PEGASUS_ARRAY_T CIMObject
260            # include <Pegasus/Common/ArrayInter.h>
261            #undef PEGASUS_ARRAY_T
262            
263 mike  1.7  ////////////////////////////////////////////////////////////////////////////////
264            //
265            // CIMConstObject
266            //
267            ////////////////////////////////////////////////////////////////////////////////
268            
269 kumpf 1.38 ///
270 mike  1.7  class PEGASUS_COMMON_LINKAGE CIMConstObject
271            {
272            public:
273            
274 kumpf 1.38     ///
275 kumpf 1.18     CIMConstObject();
276 mike  1.7  
277 kumpf 1.38     ///
278 kumpf 1.18     CIMConstObject(const CIMConstObject& x);
279 mike  1.7  
280 kumpf 1.38     ///
281 kumpf 1.18     CIMConstObject(const CIMObject& x);
282 mike  1.7  
283 kumpf 1.38     /** Constructs a CIMObject instance from a CIMClass instance.
284 mike  1.7      */
285                CIMConstObject(const CIMClass& x);
286            
287 kumpf 1.38     /** Constructs a CIMObject instance from a CIMInstance instance.
288 mike  1.7      */
289                CIMConstObject(const CIMInstance& x);
290            
291 kumpf 1.38     /** Constructs a CIMObject instance from a CIMConstClass instance.
292 mike  1.7      */
293                CIMConstObject(const CIMConstClass& x);
294            
295 kumpf 1.38     /** Constructs a CIMObject instance from a CIMConstInstance instance.
296 mike  1.7      */
297                CIMConstObject(const CIMConstInstance& x);
298            
299 kumpf 1.38     ///
300 kumpf 1.18     CIMConstObject& operator=(const CIMConstObject& x);
301 mike  1.7  
302 kumpf 1.38     ///
303 kumpf 1.18     ~CIMConstObject();
304            
305 kumpf 1.38     ///
306 kumpf 1.32     const CIMName& getClassName() const;
307 kumpf 1.18 
308 kumpf 1.38     ///
309 kumpf 1.22     const CIMObjectPath& getPath() const;
310 kumpf 1.18 
311 kumpf 1.38     ///
312 kumpf 1.32     Uint32 findQualifier(const CIMName& name) const;
313 kumpf 1.18 
314 kumpf 1.38     ///
315 kumpf 1.36     CIMConstQualifier getQualifier(Uint32 index) const;
316 kumpf 1.18 
317 kumpf 1.38     ///
318 kumpf 1.18     Uint32 getQualifierCount() const;
319            
320 kumpf 1.38     ///
321 kumpf 1.32     Uint32 findProperty(const CIMName& name) const;
322 kumpf 1.18 
323 kumpf 1.38     ///
324 kumpf 1.36     CIMConstProperty getProperty(Uint32 index) const;
325 kumpf 1.18 
326 kumpf 1.38     ///
327 kumpf 1.18     Uint32 getPropertyCount() const;
328            
329 kumpf 1.38     ///
330 kumpf 1.18     CIMObject clone() const;
331            
332 kumpf 1.38     ///
333 kumpf 1.18     Boolean identical(const CIMConstObject& x) const;
334            
335 kumpf 1.38     ///
336 kumpf 1.33     Boolean isUninitialized() const;
337 kumpf 1.35 
338 kumpf 1.38     ///
339 kumpf 1.35     Boolean isClass() const;
340            
341 kumpf 1.38     ///
342 kumpf 1.35     Boolean isInstance() const;
343 mike  1.6  
344            private:
345            
346 kumpf 1.18     CIMObjectRep* _rep;
347 mike  1.6  
348 kumpf 1.18     void _checkRep() const;
349 mike  1.6  
350 mike  1.7      friend class CIMObject;
351                friend class CIMClass;
352                friend class CIMConstClass;
353                friend class CIMInstance;
354                friend class CIMConstInstance;
355 mike  1.6  };
356            
357            PEGASUS_NAMESPACE_END
358            
359 mike  1.7  #endif /* Pegasus_Object_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2