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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2