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