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