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