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