1 mike 1.25 //%/////////////////////////////////////////////////////////////////////////////
2 //
|
3 kumpf 1.48 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
|
5 mike 1.25 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 chip 1.29 // 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.25 // 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.48 //
|
13 chip 1.29 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
14 mike 1.25 // 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.29 // 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.25 // 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.38 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
27 kumpf 1.46 // Carol Ann Krug Graves, Hewlett-Packard Company
28 // (carolann_graves@hp.com)
|
29 mike 1.25 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_CIMClass_h
33 #define Pegasus_CIMClass_h
34
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.53 #include <Pegasus/Common/Linkage.h>
37 #include <Pegasus/Common/CIMName.h>
|
38 mike 1.27 #include <Pegasus/Common/CIMObject.h>
|
39 kumpf 1.37 #include <Pegasus/Common/CIMMethod.h>
|
40 mike 1.25
41 PEGASUS_NAMESPACE_BEGIN
42
43 class CIMConstClass;
|
44 kumpf 1.37 class CIMClassRep;
|
45 kumpf 1.51 class Resolver;
|
46 mike 1.25
|
47 mike 1.28
|
48 kumpf 1.62 /** The CIMClass class is used to represent CIM classes in Pegasus.
|
49 mike 1.25 */
50 class PEGASUS_COMMON_LINKAGE CIMClass
51 {
52 public:
53
|
54 kumpf 1.62 /** Creates an uninitialized new CIM object representing a CIM class.
55 The class object created by this constructor can only be used
56 in an operation such as the copy constructor. It cannot be used
57 to create a class by appending names, properties, etc. since it
58 is uninitialized.
59
60 Use one of the other constructors to create an initialized new
61 CIM class object.
62 @exception UninitializedObjectException if an attempt is made to
63 use the unitialized object.
|
64 mike 1.25 */
|
65 kumpf 1.37 CIMClass();
|
66 mike 1.25
|
67 kumpf 1.62 /** Creates a new CIM object representing a CIMClass from the given
68 CIMClass object.
69 @param x CIMClass Object from which to create the CIMClass
|
70 mike 1.25 */
|
71 kumpf 1.37 CIMClass(const CIMClass& x);
|
72 mike 1.25
|
73 kumpf 1.62 /** Creates a new CIMClass object representing a CIMClass from the given
74 CIMObject Object.
75 @param x CIMObject object from which to create the CIMClass object.
|
76 kumpf 1.61 @exception DynamicCastFailedException If a CIMClass can not be
|
77 kumpf 1.62 created from the given CIMObject.
|
78 kumpf 1.61 */
79 PEGASUS_EXPLICIT CIMClass(const CIMObject& x);
|
80 mike 1.27
|
81 kumpf 1.62 /** Creates a new CIM object representing a CIMClass from inputs
82 of a classname and SuperClassName.
83 @param className CIMName representing name of the class being created.
84 @param superClassName CIMName representing name of the SuperClass.
|
85 mike 1.25 <pre>
|
86 kumpf 1.55 CIMClass NewClass("MyClass", "YourClass");
|
87 mike 1.25 </pre>
88 */
89 CIMClass(
|
90 kumpf 1.53 const CIMName& className,
91 const CIMName& superClassName = CIMName());
|
92 kumpf 1.37
|
93 kumpf 1.62 ///
|
94 kumpf 1.37 CIMClass& operator=(const CIMClass& x);
|
95 mike 1.25
96 /// Destructor
|
97 kumpf 1.37 ~CIMClass();
|
98 mike 1.25
|
99 kumpf 1.62 /** Identifies whether or not this CIM class is an association. An
100 association is a relationship between two (or more) classes or
101 instances of two classes. The properties of an association class
102 include pointers, or references, to the two (or more) instances.
103 All CIM classes can be included in one or more associations.
104 @return true if this CIM class is an association, false
105 otherwise.
|
106 mike 1.25 */
|
107 kumpf 1.37 Boolean isAssociation() const;
|
108 mike 1.25
|
109 kumpf 1.62 /** Tests if the CIMClass is abstract.
110 @return true if the CIMClass Object is abstract, false otherwise.
|
111 mike 1.26 */
|
112 kumpf 1.37 Boolean isAbstract() const;
|
113 mike 1.25
|
114 kumpf 1.62 /** Gets the name of the class represented by this CIM object.
115 @return CIMName with the class name.
|
116 mike 1.25 */
|
117 kumpf 1.53 const CIMName& getClassName() const;
|
118 karl 1.32
|
119 kumpf 1.62 ///
|
120 kumpf 1.44 const CIMObjectPath& getPath() const;
|
121 kumpf 1.46
|
122 kumpf 1.62 /** Sets the object path for the class.
123 @param path CIMObjectPath containing the object path.
124 */
|
125 kumpf 1.46 void setPath (const CIMObjectPath & path);
|
126 chip 1.29
|
127 kumpf 1.62 /** Gets the name of the Parent class of this CIM Object.
|
128 kumpf 1.53 @return CIMName with parent class name.
|
129 mike 1.25 */
|
130 kumpf 1.53 const CIMName& getSuperClassName() const;
|
131 mike 1.25
|
132 kumpf 1.62 /** Sets the name of the parent class from the input
133 parameter.
134 @param superClassName - CIMName defining parent class name.
|
135 mike 1.25 */
|
136 kumpf 1.53 void setSuperClassName(const CIMName& superClassName);
|
137 mike 1.25
|
138 kumpf 1.62 /** Adds the specified qualifier to the class and increments the
139 qualifier count. It is illegal to add the same qualifier more
140 than one time.
141 @param qualifier CIMQualifier object representing the qualifier
142 to be added.
143 @return the CIMClass object.
144 @exception AlreadyExistsException if the qualifier already exists.
|
145 mike 1.25 */
|
146 kumpf 1.37 CIMClass& addQualifier(const CIMQualifier& qualifier);
|
147 mike 1.25
|
148 kumpf 1.62 /** Searches for a qualifier with the specified input name if it
149 exists in the class.
150 @param name CIMName of the qualifier to be found
151 @return Index of the qualifier found or PEG_NOT_FOUND
|
152 mike 1.25 if not found.
153 */
|
154 kumpf 1.53 Uint32 findQualifier(const CIMName& name) const;
|
155 kumpf 1.37
|
156 kumpf 1.62 /** Gets the CIMQualifier object defined by the input parameter.
157 @param index Index of the qualifier in the class from the
158 findQualifier method.
159 @return CIMQualifier object representing the qualifier found.
160 On error, CIMQualifier object will be null.
161 @exception IndexOutOfBoundsException exception if the index is
162 outside the range of parameters available from the CIMClass.
|
163 mike 1.25 */
|
164 kumpf 1.60 CIMQualifier getQualifier(Uint32 index);
|
165 mike 1.25
|
166 kumpf 1.62 /** Gets the qualifier defined by the input parameter from the
167 qualifier list for this CIMClass.
168 @param index Index of the qualifier in the CIM class.
169 @return CIMConstQualifier object representing the qualifier
170 found. On error, CIMConstQualifier object will be null.
171 @exception IndexOutOfBoundsException exception if the index is
172 outside the range of parameters available from the CIMClass.
|
173 kumpf 1.57 */
|
174 kumpf 1.60 CIMConstQualifier getQualifier(Uint32 index) const;
|
175 mike 1.25
|
176 kumpf 1.62 /** Removes the qualifier defined by the index parameter.
177 @param index Defines the index of the qualifier to be removed.
178 @exception IndexOutOfBoundsException if the index is outside
179 the range of existing qualifier objects for this class.
|
180 mike 1.25 */
|
181 kumpf 1.60 void removeQualifier(Uint32 index);
|
182 mike 1.25
|
183 kumpf 1.62 /** Gets the count of the number of qualifiers defined in the class.
184 @return the number of qualifiers in the class definition (not
|
185 kumpf 1.49 those on properties or methods)
|
186 mike 1.25 */
|
187 kumpf 1.37 Uint32 getQualifierCount() const;
|
188 mike 1.25
|
189 kumpf 1.62 /** Adds the specified property object to the properties in
190 the CIM class
191 @param x CIMProperty to be added to the CIM Class.
192 @return CIMClass object after the specified property is added.
|
193 mike 1.25 */
|
194 kumpf 1.37 CIMClass& addProperty(const CIMProperty& x);
|
195 mike 1.25
|
196 kumpf 1.62 /** Finds the property object with the name defined by the
197 input parameter in the class.
198 @param name CIMName with the property name to be found.
199 @return Index of the property object found or
|
200 mike 1.25 PEG_NOT_FOUND if the property is not found.
201 */
|
202 kumpf 1.53 Uint32 findProperty(const CIMName& name) const;
|
203 mike 1.25
|
204 kumpf 1.62 /** Gets a property object from the CIMClass.
205 @param index Index for the property object to get.
206 @return CIMProperty object requested.
|
207 kumpf 1.60 @exception IndexOutOfBoundsException if the index is outside
|
208 kumpf 1.62 the range of properties in this class.
|
209 mike 1.25 */
|
210 kumpf 1.60 CIMProperty getProperty(Uint32 index);
|
211 mike 1.25
|
212 kumpf 1.62 /** Gets a property object from the CIMClass.
213 @param index Index for the property object to get.
214 @return CIMProperty object requested.
|
215 kumpf 1.60 @exception IndexOutOfBoundsException if the index is outside
|
216 kumpf 1.62 the range of properties in this class.
|
217 mike 1.25 */
|
218 kumpf 1.60 CIMConstProperty getProperty(Uint32 index) const;
|
219 mike 1.25
|
220 kumpf 1.62 /** Removes the specified property from the class.
221 @param index Index of the property to be removed.
|
222 kumpf 1.60 @exception IndexOutOfBoundsException if the index is outside
|
223 kumpf 1.62 the range of properties in this class.
|
224 mike 1.25 */
|
225 kumpf 1.60 void removeProperty(Uint32 index);
|
226 mike 1.25
|
227 kumpf 1.62 /** Gets the count of the number of properties defined in the class.
228 @return count of number of properties in the class.
|
229 mike 1.25 */
|
230 kumpf 1.37 Uint32 getPropertyCount() const;
|
231 mike 1.25
|
232 kumpf 1.62 /** Adds the method object defined by the input parameter to the
233 class and increments the count of the number of methods in the class.
234 @param name CIMMethod object representing the method to be added.
235 @return the CIMClass object to which the method was added.
236 @exception AlreadyExistsException if the method already exists.
237 @exception UninitializedObjectException if the object is not initialized.
|
238 mike 1.25 */
|
239 kumpf 1.37 CIMClass& addMethod(const CIMMethod& x);
|
240 mike 1.25
|
241 kumpf 1.62 /** Locate the method object defined by the input parameter.
242 @param name CIMName representing the name of the method to be found.
243 @return Position of the method object in the class.
|
244 mike 1.25 */
|
245 kumpf 1.53 Uint32 findMethod(const CIMName& name) const;
|
246 mike 1.25
|
247 kumpf 1.62 /** Gets the method object defined by the input parameter.
248 @param index Index to the method object to get.
249 @return CIMMethod object of the method requested.
|
250 kumpf 1.60 @exception IndexOutOfBoundsException if the index is outside
|
251 kumpf 1.62 the range of methods in this class.
|
252 mike 1.25 */
|
253 kumpf 1.60 CIMMethod getMethod(Uint32 index);
|
254 mike 1.25
|
255 kumpf 1.62 /** Gets the method object defined by the input parameter.
256 @param index Index to the method object to get.
257 @return CIMConstMethod object of the method requested.
258 @exception IndexOutOfBoundsException if the index is outside
259 the range of methods in this class.
|
260 mike 1.25 */
|
261 kumpf 1.60 CIMConstMethod getMethod(Uint32 index) const;
|
262 mike 1.25
|
263 kumpf 1.62 /** Removes the method defined by the index parameter.
264 @param index Defines the index of the method to be removed.
265 @exception IndexOutOfBoundsException if the index is outside
266 the range of methods in this class.
|
267 mike 1.25 */
|
268 kumpf 1.60 void removeMethod(Uint32 index);
|
269 mike 1.25
|
270 kumpf 1.62 /** Gets the count of the number of methods in the class.
271 @return the count of the number of methods in the class object.
|
272 mike 1.25 */
|
273 kumpf 1.37 Uint32 getMethodCount() const;
274
|
275 kumpf 1.62 /// Get names of all keys of this class.
|
276 kumpf 1.53 void getKeyNames(Array<CIMName>& keyNames) const;
|
277 kumpf 1.37
|
278 kumpf 1.62 /** Determines if the object has keys.
279 @return true if the object has keys, false otherwise.
280 */
|
281 kumpf 1.37 Boolean hasKeys() const;
|
282 mike 1.25
|
283 kumpf 1.62 /** Makes a deep copy (clone) of the given object.
284 @return copy of the CIMClass object.
285 */
|
286 kumpf 1.37 CIMClass clone() const;
287
|
288 kumpf 1.62 /** Compares with another CIM class.
289 @param x Class object for the class to be compared.
290 @return true if the classes are identical, false otherwise.
|
291 mike 1.25 */
|
292 kumpf 1.37 Boolean identical(const CIMConstClass& x) const;
|
293 mike 1.25
|
294 kumpf 1.62 /** Determines if the object has not been initialized.
295 @return true if the object has not been initialized,
296 false otherwise.
297 */
|
298 kumpf 1.56 Boolean isUninitialized() const;
|
299 mike 1.25
300 private:
301
|
302 kumpf 1.37 CIMClassRep* _rep;
303
304 CIMClass(CIMClassRep* rep);
305
306 void _checkRep() const;
|
307 mike 1.25
308 friend class CIMConstClass;
309 friend class CIMObject;
|
310 mike 1.27 friend class CIMConstObject;
|
311 kumpf 1.51 friend class Resolver;
|
312 kumpf 1.42 friend class XmlWriter;
|
313 kumpf 1.43 friend class MofWriter;
|
314 mike 1.25 };
315
316 #define PEGASUS_ARRAY_T CIMClass
|
317 kumpf 1.47 #include <Pegasus/Common/ArrayInter.h>
|
318 mike 1.25 #undef PEGASUS_ARRAY_T
319
|
320 kumpf 1.62 /// CIMConstClass
|
321 mike 1.25 class PEGASUS_COMMON_LINKAGE CIMConstClass
322 {
323 public:
324
|
325 kumpf 1.62 ///
|
326 kumpf 1.37 CIMConstClass();
327
|
328 kumpf 1.62 ///
|
329 kumpf 1.37 CIMConstClass(const CIMConstClass& x);
330
|
331 kumpf 1.62 ///
|
332 kumpf 1.37 CIMConstClass(const CIMClass& x);
|
333 mike 1.25
|
334 kumpf 1.62 ///
|
335 kumpf 1.61 PEGASUS_EXPLICIT CIMConstClass(const CIMObject& x);
|
336 mike 1.27
|
337 kumpf 1.62 ///
|
338 kumpf 1.61 PEGASUS_EXPLICIT CIMConstClass(const CIMConstObject& x);
|
339 mike 1.27
|
340 kumpf 1.62 ///
|
341 mike 1.25 CIMConstClass(
|
342 kumpf 1.53 const CIMName& className,
343 const CIMName& superClassName = CIMName());
|
344 kumpf 1.37
|
345 kumpf 1.62 ///
|
346 kumpf 1.37 CIMConstClass& operator=(const CIMConstClass& x);
347
|
348 kumpf 1.62 ///
|
349 kumpf 1.37 CIMConstClass& operator=(const CIMClass& x);
350
|
351 kumpf 1.62 ///
|
352 kumpf 1.37 ~CIMConstClass();
353
|
354 kumpf 1.62 ///
|
355 kumpf 1.37 Boolean isAssociation() const;
356
|
357 kumpf 1.62 ///
|
358 kumpf 1.37 Boolean isAbstract() const;
359
|
360 kumpf 1.62 ///
|
361 kumpf 1.53 const CIMName& getClassName() const;
|
362 kumpf 1.37
|
363 kumpf 1.62 ///
|
364 kumpf 1.44 const CIMObjectPath& getPath() const;
|
365 kumpf 1.37
|
366 kumpf 1.62 ///
|
367 kumpf 1.53 const CIMName& getSuperClassName() const;
|
368 kumpf 1.37
|
369 kumpf 1.62 ///
|
370 kumpf 1.53 Uint32 findQualifier(const CIMName& name) const;
|
371 kumpf 1.37
|
372 kumpf 1.62 ///
|
373 kumpf 1.60 CIMConstQualifier getQualifier(Uint32 index) const;
|
374 kumpf 1.37
|
375 kumpf 1.62 ///
|
376 kumpf 1.37 Uint32 getQualifierCount() const;
377
|
378 kumpf 1.62 ///
|
379 kumpf 1.53 Uint32 findProperty(const CIMName& name) const;
|
380 kumpf 1.37
|
381 kumpf 1.62 ///
|
382 kumpf 1.60 CIMConstProperty getProperty(Uint32 index) const;
|
383 kumpf 1.37
|
384 kumpf 1.62 ///
|
385 kumpf 1.37 Uint32 getPropertyCount() const;
386
|
387 kumpf 1.62 ///
|
388 kumpf 1.53 Uint32 findMethod(const CIMName& name) const;
|
389 kumpf 1.37
|
390 kumpf 1.62 ///
|
391 kumpf 1.60 CIMConstMethod getMethod(Uint32 index) const;
|
392 kumpf 1.37
|
393 kumpf 1.62 ///
|
394 kumpf 1.37 Uint32 getMethodCount() const;
395
|
396 kumpf 1.62 ///
|
397 kumpf 1.53 void getKeyNames(Array<CIMName>& keyNames) const;
|
398 kumpf 1.37
|
399 kumpf 1.62 ///
|
400 kumpf 1.37 Boolean hasKeys() const;
401
|
402 kumpf 1.62 ///
|
403 kumpf 1.37 CIMClass clone() const;
404
|
405 kumpf 1.62 ///
|
406 kumpf 1.37 Boolean identical(const CIMConstClass& x) const;
407
|
408 kumpf 1.62 ///
|
409 kumpf 1.56 Boolean isUninitialized() const;
|
410 mike 1.25
411 private:
412
|
413 kumpf 1.37 CIMClassRep* _rep;
|
414 mike 1.25
|
415 kumpf 1.37 void _checkRep() const;
|
416 mike 1.25
417 friend class CIMClassRep;
418 friend class CIMClass;
419 friend class CIMInstanceRep;
|
420 mike 1.27 friend class CIMObject;
421 friend class CIMConstObject;
|
422 kumpf 1.42 friend class XmlWriter;
|
423 kumpf 1.43 friend class MofWriter;
|
424 mike 1.25 };
425
426 PEGASUS_NAMESPACE_END
427
428 #endif /* Pegasus_CIMClass_h */
|