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