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 chip 1.9 /** This class either refers to a CIMInstance or a CIMClass.
|
59 mike 1.7
60 The CIMObjectRep data member points to either a CIMInstanceRep or
61 CIMClassRep.
|
62 mike 1.6 */
63 class PEGASUS_COMMON_LINKAGE CIMObject
64 {
65 public:
66
|
67 mike 1.7 /** Constructor.
68 */
|
69 kumpf 1.18 CIMObject();
|
70 mike 1.6
|
71 mike 1.7 /** Copy constructor.
72 */
|
73 kumpf 1.18 CIMObject(const CIMObject& x);
|
74 mike 1.6
|
75 mike 1.7 /** Construction from CIMClass.
76 */
77 CIMObject(const CIMClass& x);
|
78 mike 1.6
|
79 mike 1.7 /** Construction from CIMInstance.
80 */
81 CIMObject(const CIMInstance& x);
|
82 mike 1.6
|
83 mike 1.7 /** Assignment operator.
84 */
|
85 kumpf 1.18 CIMObject& operator=(const CIMObject& x);
|
86 mike 1.6
|
87 mike 1.7 /** Assignment operator.
88 */
89 CIMObject& operator=(const CIMClass& x);
90
91 /** Assignment operator.
92 */
93 CIMObject& operator=(const CIMInstance& x);
94
|
95 chip 1.9 /** Destructor.
|
96 mike 1.7 */
|
97 kumpf 1.18 ~CIMObject();
|
98 mike 1.7
|
99 karl 1.13 /** Accessor for ClassName component of the object.
100 @return - Returns the ClassName of the object in
|
101 kumpf 1.32 a CIMName parameter.
|
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 kumpf 1.22 const CIMObjectPath& getPath() const;
|
111 kumpf 1.24
112 /**
113 Sets the object path for the object
114 @param path CIMObjectPath containing the object path
115 */
116 void setPath (const CIMObjectPath & path);
|
117 chip 1.12
|
118 mike 1.7 /** addQualifier - Adds the CIMQualifier object to the instance.
119 Thows an exception of the CIMQualifier already exists in the instance
120 @param CIMQualifier object to add to instance
|
121 kumpf 1.29 @return the resulting object.
|
122 mike 1.7 @exception Throws AlreadyExists.
123 */
|
124 kumpf 1.18 CIMObject& addQualifier(const CIMQualifier& qualifier);
|
125 mike 1.7
126 /** findQualifier - Searches the instance for the qualifier object
127 defined by the input parameter.
|
128 kumpf 1.32 @param CIMName defining the qualifier object to be found.
|
129 mike 1.7 @return - Position of the qualifier to be used in subsequent
130 operations or PEG_NOT_FOUND if the qualifier is not found.
131 */
|
132 kumpf 1.32 Uint32 findQualifier(const CIMName& name) const;
|
133 mike 1.7
134 /** getQualifier - Retrieves the qualifier object defined by the
135 index input parameter. @ index for the qualifier object.
136 The index to qualifier objects is zero-origin and continuous
137 so that incrementing loops can be used to get all qualifier
138 objects in a CIMInstnace.
139 @return: Returns qualifier object defined by index.
140 @exception Throws the OutOfBounds exception if the index
141 is out of bounds
142 */
|
143 kumpf 1.18 CIMQualifier getQualifier(Uint32 pos);
|
144 mike 1.7
145 /** getQualifier - Retrieves the qualifier object defined by the
146 index input parameter. @ index for the qualifier object.
147 The index to qualifier objects is zero-origin and continuous
148 so that incrementing loops can be used to get all qualifier
149 objects in a CIMInstnace.
150 @return: Returns qualifier object defined by index.
151 @exception Throws the OutOfBounds exception if the index
152 is out of bounds
153 */
|
154 kumpf 1.18 CIMConstQualifier getQualifier(Uint32 pos) const;
155
156 void removeQualifier(Uint32 pos);
|
157 chip 1.11
|
158 kumpf 1.17 /** getQualifierCount - Gets the number of CIMQualifier objects
|
159 mike 1.7 defined for this CIMObject.
|
160 kumpf 1.17 @return Count of the number of CIMQualifier objects in the
|
161 mike 1.7 CIMObject.
162 @exception Throws the OutOfBounds exception if the index
163 is out of bounds
164 */
|
165 kumpf 1.18 Uint32 getQualifierCount() const;
|
166 mike 1.7
167 /** addProperty - Adds a property object defined by the input
168 parameter to the CIMObject
169 @param Property Object to be added. See the CIM Property
170 class for definition of the property object
|
171 kumpf 1.29 @return the resulting object.
|
172 mike 1.7 @exception Throws the exception AlreadyExists if the property
173 already exists.
174 */
|
175 kumpf 1.18 CIMObject& addProperty(const CIMProperty& x);
|
176 mike 1.7
177 /** findProperty - Searches the CIMProperty objects installed in the
178 CIMObject for property objects with the name defined by the
179 input.
|
180 kumpf 1.32 @param CIMName with the name of the property object to be found
|
181 mike 1.7 @return Position in the CIM object to the property object if found or
182 PEG_NOT_FOUND if no property object found with the name defined by the
183 input.
184 */
|
185 kumpf 1.32 Uint32 findProperty(const CIMName& name) const;
|
186 mike 1.7
|
187 kumpf 1.17 /** getProperty - Gets the CIMProperty object in the CIMObject defined
|
188 mike 1.7 by the input index parameter.
189 @param Index to the property object in the CIMObject.
190 The index to qualifier objects is zero-origin and continuous
191 so that incrementing loops can be used to get all qualifier
192 objects in a CIMObject.
193 @return CIMProperty object corresponding to the index.
194 @exception Throws the OutOfBounds exception if the index
195 is out of bounds
196 */
|
197 kumpf 1.18 CIMProperty getProperty(Uint32 pos);
|
198 mike 1.7
199 /** getProperty - Gets the CIMproperty object in the CIMObject defined
200 by the input index parameter.
201 @param Index to the property object in the CIMObject.
202 The index to qualifier objects is zero-origin and continuous
203 so that incrementing loops can be used to get all qualifier
204 objects in a CIMInstnace.
205 @return CIMProperty object corresponding to the index.
206 @exception Throws the OutOfBounds exception if the index
207 is out of bounds
208 */
|
209 kumpf 1.18 CIMConstProperty getProperty(Uint32 pos) const;
|
210 mike 1.7
211 /** removeProperty - Removes the property represented
212 by the position input parameter from the instance.
213 @param pos Index to the property to be removed from the
214 instance. Normally this is obtained by getProperty();
215 @exception Throws OutofBounds if index is not a property object
216 */
|
217 kumpf 1.18 void removeProperty(Uint32 pos);
|
218 mike 1.7
|
219 kumpf 1.17 /** getPropertyCount - Gets the number of CIMProperty
|
220 mike 1.7 objects defined for this CIMObject.
221 @return Count of the number of CIMProperty objects in the
222 CIMObject. Zero indicates that no CIMProperty objects
223 are contained in the CIMObject
224 @exception Throws the OutOfBounds exception if the index
225 is out of bounds
226
227 */
|
228 kumpf 1.18 Uint32 getPropertyCount() const;
|
229 mike 1.7
|
230 kumpf 1.18 /** Clones the given object.
231 */
232 CIMObject clone() const;
|
233 mike 1.7
234 /** Returns true if the two classes are structurally identical.
235 */
236 Boolean identical(const CIMConstObject& x) const;
237
|
238 kumpf 1.33 /**
239 Determines if the object has not been initialized.
240
241 @return True if the object has not been initialized,
242 False otherwise
243 */
244 Boolean isUninitialized() const;
|
245 mike 1.7
246 private:
247
|
248 kumpf 1.18 CIMObjectRep* _rep;
|
249 mike 1.7
|
250 kumpf 1.18 #ifdef PEGASUS_INTERNALONLY
251 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 kumpf 1.18 #endif
|
261 mike 1.7 };
262
|
263 kumpf 1.25 #define PEGASUS_ARRAY_T CIMObject
264 # include <Pegasus/Common/ArrayInter.h>
265 #undef PEGASUS_ARRAY_T
266
|
267 mike 1.7 ////////////////////////////////////////////////////////////////////////////////
268 //
269 // CIMConstObject
270 //
271 ////////////////////////////////////////////////////////////////////////////////
272
273 class PEGASUS_COMMON_LINKAGE CIMConstObject
274 {
275 public:
276
|
277 kumpf 1.18 CIMConstObject();
|
278 mike 1.7
|
279 kumpf 1.18 CIMConstObject(const CIMConstObject& x);
|
280 mike 1.7
|
281 kumpf 1.18 CIMConstObject(const CIMObject& x);
|
282 mike 1.7
283 /** Construction from CIMClass.
284 */
285 CIMConstObject(const CIMClass& x);
286
287 /** Construction from CIMInstance.
288 */
289 CIMConstObject(const CIMInstance& x);
290
291 /** Construction from CIMClass.
292 */
293 CIMConstObject(const CIMConstClass& x);
294
295 /** Construction from CIMInstance.
296 */
297 CIMConstObject(const CIMConstInstance& x);
298
|
299 kumpf 1.18 CIMConstObject& operator=(const CIMConstObject& x);
300
301 CIMConstObject& operator=(const CIMObject& x);
|
302 mike 1.6
|
303 mike 1.7 CIMConstObject& operator=(const CIMClass& x);
304
305 CIMConstObject& operator=(const CIMConstClass& x);
306
307 CIMConstObject& operator=(const CIMInstance& x);
308
309 CIMConstObject& operator=(const CIMConstInstance& x);
310
|
311 kumpf 1.18 ~CIMConstObject();
312
|
313 kumpf 1.32 const CIMName& getClassName() const;
|
314 kumpf 1.18
|
315 kumpf 1.22 const CIMObjectPath& getPath() const;
|
316 kumpf 1.18
|
317 kumpf 1.32 Uint32 findQualifier(const CIMName& name) const;
|
318 kumpf 1.18
319 CIMConstQualifier getQualifier(Uint32 pos) const;
320
321 Uint32 getQualifierCount() const;
322
|
323 kumpf 1.32 Uint32 findProperty(const CIMName& name) const;
|
324 kumpf 1.18
325 CIMConstProperty getProperty(Uint32 pos) const;
326
327 Uint32 getPropertyCount() const;
328
329 CIMObject clone() const;
330
331 Boolean identical(const CIMConstObject& x) const;
332
|
333 kumpf 1.33 Boolean isUninitialized() const;
|
334 mike 1.6
335 private:
336
|
337 kumpf 1.18 CIMObjectRep* _rep;
|
338 mike 1.6
|
339 kumpf 1.18 #ifdef PEGASUS_INTERNALONLY
340 void _checkRep() const;
|
341 mike 1.6
|
342 mike 1.7 friend class CIMObject;
343 friend class CIMClass;
344 friend class CIMConstClass;
345 friend class CIMInstance;
346 friend class CIMConstInstance;
|
347 kumpf 1.18 #endif
|
348 mike 1.6 };
349
350 PEGASUS_NAMESPACE_END
351
|
352 mike 1.7 #endif /* Pegasus_Object_h */
|