(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 karl  1.40     /** Creates CIMObject instance with null values (default constructor).
 71 mike  1.7      */
 72 kumpf 1.18     CIMObject();
 73 mike  1.6  
 74 karl  1.40     /** Creates a new CIMObject instance (copy constructor).
 75                @param x Specifies the name of the CIMObject instance to create.
 76 mike  1.7      */
 77 kumpf 1.18     CIMObject(const CIMObject& x);
 78 mike  1.6  
 79 karl  1.40     /** Construction of a CIMObject instance based on the CIMClass object.
 80 mike  1.7      */
 81                CIMObject(const CIMClass& x);
 82 mike  1.6  
 83 karl  1.40     /** Construction of a CIMObject instance based on the CIMInstance object.
 84 mike  1.7      */
 85                CIMObject(const CIMInstance& x);
 86 mike  1.6  
 87 karl  1.40     /** Assign the values of the CIMObject instance to CIMObject.
 88                @param x Specifies the name of the CIMObject instance.
 89 mike  1.7      */
 90 kumpf 1.18     CIMObject& operator=(const CIMObject& x);
 91 mike  1.6  
 92 karl  1.40     /** Destroys CIMObject.
 93 mike  1.7      */
 94 kumpf 1.18     ~CIMObject();
 95 mike  1.7  
 96 kumpf 1.38     /**	Gets the ClassName of the object.
 97 karl  1.40 	@return ClassName of the object in a CIMName parameter. For example, 
 98 karl  1.13 	<pre>
 99 kumpf 1.32 	    CIMName className;
100 karl  1.13 	    CIMClass myclass("myclass", "superclass");
101            	    className = myclass.getClassName;
102            	</pre>
103 mike  1.7      */
104 kumpf 1.32     const CIMName& getClassName() const;
105 mike  1.7  
106 karl  1.40     /** REVIEWERS: Insert description here.
107                */
108 kumpf 1.22     const CIMObjectPath& getPath() const;
109 kumpf 1.24 
110 kumpf 1.38     /** Sets the object path for the object.
111 karl  1.40         @param  path Specifies the CIMObjectPath that contains the object path.
112 kumpf 1.38     */
113 kumpf 1.24     void setPath (const CIMObjectPath & path);
114 chip  1.12 
115 kumpf 1.38     /**	Adds the CIMQualifier object to the instance.
116 karl  1.40 	@param qualifier CIMQualifier object to add to instance.
117            	@return The resulting CIMObject.
118            	@exception AlreadyExistsException True if the CIMQualifier already 
119                    exists in the instance; otherwise, false.
120 mike  1.7      */
121 kumpf 1.18     CIMObject& addQualifier(const CIMQualifier& qualifier);
122 mike  1.7  
123 kumpf 1.38     /**	Searches the instance for the qualifier object
124 mike  1.7          defined by the input parameter.
125 karl  1.40 	@param name CIMName that defines the qualifier object to be found.
126            	@return  Position of the qualifier to use in subsequent
127 mike  1.7  	operations or PEG_NOT_FOUND if the qualifier is not found.
128                */
129 kumpf 1.32     Uint32 findQualifier(const CIMName& name) const;
130 mike  1.7  
131 kumpf 1.38     /**	Retrieves the qualifier object defined by the input parameter. 
132 karl  1.40 	@param  index Specifies the index for the qualifier object. The index to 
133 kumpf 1.38         qualifier objects is zero-origin and continuous so that 
134                    incrementing loops can be used to get all qualifier
135            	objects in a CIMInstance.
136            	@return CIMQualifier object defined by the index.
137 karl  1.40 	@exception IndexOutOfBoundsException True if the index
138            	is out of bounds; otherwise, false.
139 mike  1.7      */
140 kumpf 1.36     CIMQualifier getQualifier(Uint32 index);
141 mike  1.7  
142 kumpf 1.38     /** Retrieves the qualifier object defined by the input parameter.  
143 karl  1.40         @param index Specifies the index for the qualifier object. The index to 
144 kumpf 1.38         qualifier objects is zero-origin and continuous so that 
145                    incrementing loops can be used to get all qualifier
146            	objects in a CIMInstance.
147            	@return CIMConstQualifier object defined by the index.
148 karl  1.40 	@exception IndexOutOfBoundsException True if the index
149            	is out of bounds; otherwise, false.
150 mike  1.7      */
151 kumpf 1.36     CIMConstQualifier getQualifier(Uint32 index) const;
152 kumpf 1.18 
153 karl  1.40     /** REVIEWERS: Insert description here.
154                */
155 kumpf 1.36     void removeQualifier(Uint32 index);
156 chip  1.11 	
157 kumpf 1.38     /** Gets the number of CIMQualifier objects defined for 
158                    this CIMObject.
159 kumpf 1.17 	@return	Count of the number of CIMQualifier objects in the
160 mike  1.7  	CIMObject.
161                */
162 kumpf 1.18     Uint32 getQualifierCount() const;
163 mike  1.7  
164 kumpf 1.38     /**	Adds a property object defined by the input parameter to 
165                    the CIMObject.
166 karl  1.40 	@param x Property Object to be added. See the CIM Property
167 kumpf 1.38 	class for definition of the property object.
168 karl  1.40 	@return The resulting CIMObject.
169            	@exception AlreadyExistsException True if the property already exists
170                    otherwise, false.
171 mike  1.7      */
172 kumpf 1.18     CIMObject& addProperty(const CIMProperty& x);
173 mike  1.7  
174 kumpf 1.38     /**	Searches the CIMProperty objects in the
175            	CIMObject for a property object with the name defined by the
176            	input parameter.
177 karl  1.40 	@param name CIMName with the name of the property object to be found.
178 kumpf 1.38 	@return Position in the CIM object of the property object if found or
179 mike  1.7  	PEG_NOT_FOUND if no property object found with the name defined by the
180 kumpf 1.38 	input parameter.
181 mike  1.7      */
182 kumpf 1.32     Uint32 findProperty(const CIMName& name) const;
183 mike  1.7  
184 kumpf 1.38     /**	Gets the CIMProperty object in the CIMObject defined
185            	by the input parameter.
186 karl  1.40 	@param index Specifies the index to the property object in the CIMObject.
187 mike  1.7      	The index to qualifier objects is zero-origin and continuous
188            	so that incrementing loops can be used to get all qualifier
189            	objects in a CIMObject.
190            	@return CIMProperty object corresponding to the index.
191 karl  1.40 	@exception IndexOutOfBoundsException True if the index
192            	is out of bounds; otherwise, false.
193 mike  1.7      */
194 kumpf 1.36     CIMProperty getProperty(Uint32 index);
195 mike  1.7  
196 kumpf 1.38     /**	Gets the CIMproperty object in the CIMObject defined
197                    by the input parameter.
198 karl  1.40         @param index Specifies the index to the property object in the CIMObject.
199 kumpf 1.36         @return CIMProperty object corresponding to the index.
200 karl  1.40         @exception IndexOutOfBoundsException True if the index is outside the
201                    range of properties in this object; otherwise, false.
202 kumpf 1.36     */
203                CIMConstProperty getProperty(Uint32 index) const;
204            
205 kumpf 1.38     /** Remove the specified property from the instance.
206 karl  1.40 	@param index Specifies the index to the property to be removed from the
207 kumpf 1.36 	instance.  Normally this is obtained by findProperty();
208 karl  1.40 	@exception IndexOutOfBoundsException True if the index is outside the
209                    range of properties in this object; otherwise, false.
210 mike  1.7      */
211 kumpf 1.36     void removeProperty(Uint32 index);
212 mike  1.7  
213 kumpf 1.38     /**	Gets the number of CIMProperty objects defined for this CIMObject.
214 mike  1.7  	@return	Count of the number of CIMProperty objects in the
215            	CIMObject. Zero indicates that no CIMProperty objects
216 kumpf 1.38 	are contained in the CIMObject.
217 mike  1.7      */
218 kumpf 1.18     Uint32 getPropertyCount() const;
219 mike  1.7  
220 kumpf 1.38     /** Makes a deep copy (clone) of the given object.
221 karl  1.40         @return Copy of the CIMObject.
222 kumpf 1.18     */
223                CIMObject clone() const;
224 mike  1.7  
225 kumpf 1.38     /** Compares with another CIM Object.
226 karl  1.40         @param x CIM object for comparison.
227                    @return True if the objects are identical; otherwise, false.
228 mike  1.7      */
229                Boolean identical(const CIMConstObject& x) const;
230            
231 kumpf 1.38     /** Determines if the object has not been initialized.
232 karl  1.40         @return  True if the object has not been initialized; otherwise, false.
233                           
234 kumpf 1.33      */
235                Boolean isUninitialized() const;
236 mike  1.7  
237 kumpf 1.38     /** Determines if the object represents a CIMClass.
238 karl  1.40         @return  True if the object represents a CIMClass; otherwise, false.
239 kumpf 1.34      */
240                Boolean isClass () const;
241            
242 kumpf 1.38     /** Determines if the object represents a CIMInstance.
243 karl  1.40         @return  True if the object represents a CIMInstance; otherwise, false.
244 kumpf 1.34      */
245                Boolean isInstance () const;
246            
247 mike  1.7  private:
248            
249 kumpf 1.18     CIMObjectRep* _rep;
250 mike  1.7  
251 kumpf 1.18     CIMObject(CIMObjectRep* rep);
252 mike  1.7  
253 kumpf 1.18     void _checkRep() const;
254 mike  1.7  
255                friend class CIMConstObject;
256                friend class CIMClass;
257                friend class CIMConstClass;
258                friend class CIMInstance;
259                friend class CIMConstInstance;
260            };
261            
262 kumpf 1.25 #define PEGASUS_ARRAY_T CIMObject
263            # include <Pegasus/Common/ArrayInter.h>
264            #undef PEGASUS_ARRAY_T
265            
266 mike  1.7  ////////////////////////////////////////////////////////////////////////////////
267            //
268            // CIMConstObject
269            //
270            ////////////////////////////////////////////////////////////////////////////////
271            
272 karl  1.40 /**
273            REVIEWERS: Add class defintion here
274            */
275 mike  1.7  class PEGASUS_COMMON_LINKAGE CIMConstObject
276            {
277            public:
278            
279 karl  1.40     /** Constructs a new CIMConstObject with null values (default constructor).
280                */
281 kumpf 1.18     CIMConstObject();
282 mike  1.7  
283 karl  1.40     /** Constructs a new CIMConstObject.
284                @param x Specifies the name of the CIMConstObject instance to create.
285                */
286 kumpf 1.18     CIMConstObject(const CIMConstObject& x);
287 mike  1.7  
288 karl  1.40     /** Constructs a new CIMConstObject from a CIMObject instance.
289                @param x Specifies the name of the CIMObject instance to use to create
290                the CIMConstObject instance.
291                */
292 kumpf 1.18     CIMConstObject(const CIMObject& x);
293 mike  1.7  
294 kumpf 1.38     /** Constructs a CIMObject instance from a CIMClass instance.
295 karl  1.40     @param x Specifies the name of the CIMClass instance.
296 mike  1.7      */
297                CIMConstObject(const CIMClass& x);
298            
299 kumpf 1.38     /** Constructs a CIMObject instance from a CIMInstance instance.
300 karl  1.40     @param x Specifies the name of the CIMInstance instance.
301 mike  1.7      */
302                CIMConstObject(const CIMInstance& x);
303            
304 kumpf 1.38     /** Constructs a CIMObject instance from a CIMConstClass instance.
305 karl  1.40     @param x Specifies the name of the CIMConstClass instance.
306 mike  1.7      */
307                CIMConstObject(const CIMConstClass& x);
308            
309 kumpf 1.38     /** Constructs a CIMObject instance from a CIMConstInstance instance.
310 karl  1.40     @param x Specifies the name of the CIMConstInstance instance.
311 mike  1.7      */
312                CIMConstObject(const CIMConstInstance& x);
313            
314 karl  1.40     /** REVIEWERS: Insert description here.
315                @param x Specifies the name of the CIMConstObject instance.
316                */
317 kumpf 1.18     CIMConstObject& operator=(const CIMConstObject& x);
318 mike  1.7  
319 karl  1.40     /** CIMConstObject destructor.
320                */
321 kumpf 1.18     ~CIMConstObject();
322            
323 karl  1.40     /** REVIEWERS: Insert description here.
324                */
325 kumpf 1.32     const CIMName& getClassName() const;
326 kumpf 1.18 
327 karl  1.40     /** REVIEWERS: Insert description here.
328                */
329 kumpf 1.22     const CIMObjectPath& getPath() const;
330 kumpf 1.18 
331 karl  1.40     /** REVIEWERS: Insert description here.
332                @param name Specifies the name of the CIMName instance.
333                */
334 kumpf 1.32     Uint32 findQualifier(const CIMName& name) const;
335 kumpf 1.18 
336 karl  1.40     /** REVIEWERS: Insert description here.
337                @param index Specifies the name of the Uint32 instance.
338                */
339 kumpf 1.36     CIMConstQualifier getQualifier(Uint32 index) const;
340 kumpf 1.18 
341 karl  1.40     /** REVIEWERS: Insert description here.
342                */
343 kumpf 1.18     Uint32 getQualifierCount() const;
344            
345 karl  1.40     /** REVIEWERS: Insert description here.
346                @param name Specifies the name of the CIMName instance.
347                */
348 kumpf 1.32     Uint32 findProperty(const CIMName& name) const;
349 kumpf 1.18 
350 karl  1.40     /** REVIEWERS: Insert description here.
351                @param index Specifies the name of the Uint32 instance.
352                */
353 kumpf 1.36     CIMConstProperty getProperty(Uint32 index) const;
354 kumpf 1.18 
355 karl  1.40     /** REVIEWERS: Insert description here.
356                */
357 kumpf 1.18     Uint32 getPropertyCount() const;
358            
359 karl  1.40     /** REVIEWERS: Insert description here.
360                */
361 kumpf 1.18     CIMObject clone() const;
362            
363 karl  1.40     /** REVIEWERS: Insert description here.
364                */
365 kumpf 1.18     Boolean identical(const CIMConstObject& x) const;
366            
367 karl  1.40     /** REVIEWERS: Insert description here.
368                */
369 kumpf 1.33     Boolean isUninitialized() const;
370 kumpf 1.35 
371 karl  1.40     /** REVIEWERS: Insert description here.
372                */
373 kumpf 1.35     Boolean isClass() const;
374            
375 karl  1.40     /** REVIEWERS: Insert description here.
376                */
377 kumpf 1.35     Boolean isInstance() const;
378 mike  1.6  
379            private:
380            
381 kumpf 1.18     CIMObjectRep* _rep;
382 mike  1.6  
383 kumpf 1.18     void _checkRep() const;
384 mike  1.6  
385 mike  1.7      friend class CIMObject;
386                friend class CIMClass;
387                friend class CIMConstClass;
388                friend class CIMInstance;
389                friend class CIMConstInstance;
390 mike  1.6  };
391            
392            PEGASUS_NAMESPACE_END
393            
394 mike  1.7  #endif /* Pegasus_Object_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2