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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2