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 // REVIEW: redocument.
48
|
49 mike 1.25 /** The CIMClass class is used to represent CIM classes in Pegasus. In CIM,
50 a class object may be a class or an associator. A CIM class must contain a
51 name and may contain methods, properties, and qualifiers. It is a template
52 for creating a CIM instance. A CIM class represents a collection of CIM
53 instances, all of which support a common type (for example, a set of
54 properties, methods, and associations).
55 */
56 class PEGASUS_COMMON_LINKAGE CIMClass
57 {
58 public:
59
60 /** Constructor - Creates an uninitiated a new CIM object
61 reprenting a CIM class. The class object created by this
62 constructor can only be used in an operation such as the
63 copy constructor. It cannot be used to create a class by
64 appending names, properties, etc. since it is unitiated.
65
66 Use one of the other constructors to create an initiated new CIM class
67 object.
|
68 kumpf 1.49 @exception "unitialized handle" if this
|
69 mike 1.25 unitialized handle is used
70 */
|
71 kumpf 1.37 CIMClass();
|
72 mike 1.25
73 /** Constructor - Creates a class from a previous class
74 */
|
75 kumpf 1.37 CIMClass(const CIMClass& x);
|
76 mike 1.25
|
77 kumpf 1.61 /** Constructor - Creates a Class object from the given CIMObject
78 @param x CIMObject from which to create the CIMClass
79 @exception DynamicCastFailedException If a CIMClass can not be
80 created from the given CIMObject
81 */
82 PEGASUS_EXPLICIT CIMClass(const CIMObject& x);
|
83 mike 1.27
|
84 mike 1.28 /** Constructor - Creates a Class from inputs of a classname and
|
85 mike 1.25 SuperClassName
|
86 kumpf 1.55 @param className CIMName representing name of the class being created
|
87 kumpf 1.53 @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 */
93 CIMClass(
|
94 kumpf 1.53 const CIMName& className,
95 const CIMName& superClassName = CIMName());
|
96 kumpf 1.37
97 /** Assignment operator.
98 */
99 CIMClass& operator=(const CIMClass& x);
|
100 mike 1.25
101 /// Destructor
|
102 kumpf 1.37 ~CIMClass();
|
103 mike 1.25
104 /** isAssociation - Identifies whether or not this CIM class
105 is an association. An association is a relationship between two
106 (or more) classes or instances of two classes. The properties of an
107 association class include pointers, or references, to the two (or
108 more) instances. All CIM classes can be included in one or more
109 associations.
110 @return Boolean True if this CIM class belongs to an association;
111 otherwise, false.
112 */
|
113 kumpf 1.37 Boolean isAssociation() const;
|
114 mike 1.25
|
115 mike 1.26 /** isAbstract Test if the CIMClass is abstract.
116 @return - True if the CIMClass Object is abstract
117 SeeAlso: Abstract
118 */
|
119 kumpf 1.37 Boolean isAbstract() const;
|
120 mike 1.25
|
121 kumpf 1.49 // ATTN: COMMENT. Why not just get name so we have common method for all.
|
122 mike 1.25 /** getClassName Gets the name of the class
|
123 kumpf 1.56 @return Returns CIMName with the class name.
|
124 mike 1.25 */
|
125 kumpf 1.53 const CIMName& getClassName() const;
|
126 karl 1.32
|
127 kumpf 1.44 const CIMObjectPath& getPath() const;
|
128 kumpf 1.46
129 /**
130 Sets the object path for the class
131 @param path CIMObjectPath containing the object path
132 */
133 void setPath (const CIMObjectPath & path);
|
134 chip 1.29
|
135 mike 1.26 /** getSuperClassName - Gets the name of the Parent
|
136 kumpf 1.53 @return CIMName with parent class name.
|
137 mike 1.25 */
|
138 kumpf 1.53 const CIMName& getSuperClassName() const;
|
139 mike 1.25
|
140 mike 1.26 /** setSuperClassName - Sets the name of the parent class from
|
141 kumpf 1.49 the input parameter. \REF{CLASSNAME}.
|
142 kumpf 1.53 @param CIMName defining parent name.
|
143 mike 1.25 */
|
144 kumpf 1.53 void setSuperClassName(const CIMName& superClassName);
|
145 mike 1.25
146 /** addQualifier - Adds the specified qualifier to the class
147 and increments the qualifier count. It is illegal to add the same
148 qualifier more than one time.
149 @param qualifier CIMQualifier object representing the qualifier to be
150 added
151 @return Returns handle of the class object
|
152 kumpf 1.58 @exception AlreadyExistsException.
|
153 mike 1.25 */
|
154 kumpf 1.37 CIMClass& addQualifier(const CIMQualifier& qualifier);
|
155 mike 1.25
156 /** findQualifier - Searches for a qualifier with the specified `
157 input name if it exists in the class
158 @param name CIMName of the qualifier
159 to be found @return Position of the qualifier in the Class.
160 @return Returns index of the qualifier found or PEG_NOT_FOUND
161 if not found.
162 */
|
163 kumpf 1.53 Uint32 findQualifier(const CIMName& name) const;
|
164 kumpf 1.37
|
165 kumpf 1.57 /** getQualifier - Gets the CIMQualifier object defined
|
166 mike 1.25 by the input parameter
|
167 kumpf 1.60 @param index defines the index of the qualifier in the class from the
|
168 mike 1.25 findQualifier method
|
169 mike 1.28 @return CIMQualifier object representing the qualifier found. On error,
170 CIMQualifier handle will be null.
|
171 mike 1.25 */
|
172 kumpf 1.60 CIMQualifier getQualifier(Uint32 index);
|
173 mike 1.25
|
174 karl 1.31 /** getQualifier - Gets the qualifier defined by the input parameter
|
175 kumpf 1.57 from the qualifier list for this CIMClass.
176 */
|
177 kumpf 1.60 CIMConstQualifier getQualifier(Uint32 index) const;
|
178 mike 1.25
179 /** removeQualifier - Removes the qualifier defined by the
180 index parameter.
181 @param Defines the index of the qualifier to be removed.
182 @return There is no return.
|
183 kumpf 1.60 @exception IndexOutOfBoundsException if the index is outside
|
184 mike 1.25 the range of existing qualifier objects for this class
185 */
|
186 kumpf 1.60 void removeQualifier(Uint32 index);
|
187 mike 1.25
188 /** getQualifierCount - Returns the number of qualifiers
189 in the class.
|
190 kumpf 1.49 @return the number of qualifiers on the class definition (not
191 those on properties or methods)
|
192 mike 1.25 */
|
193 kumpf 1.37 Uint32 getQualifierCount() const;
|
194 mike 1.25
195 /** addProperty - Adds the specified property object to the
196 properties in the CIM class
197 */
|
198 kumpf 1.37 CIMClass& addProperty(const CIMProperty& x);
|
199 mike 1.25
|
200 mike 1.26 /** findProperty - Finds the property object with the
|
201 mike 1.25 name defined by the input parameter in the class.
|
202 kumpf 1.53 @param CIMName parameter with the property name.
|
203 kumpf 1.60 @return index representing the property object found or
|
204 mike 1.25 PEG_NOT_FOUND if the property is not found.
205 */
|
206 kumpf 1.53 Uint32 findProperty(const CIMName& name) const;
|
207 mike 1.25
208 /** getProperty - Returns a property representing the property
209 defined by the input parameter
|
210 kumpf 1.60 @param index Index for this property
|
211 mike 1.25 @return CIMProperty object
|
212 kumpf 1.60 @exception IndexOutOfBoundsException if the index is outside
213 the range of properties in this class
|
214 mike 1.25 */
|
215 kumpf 1.60 CIMProperty getProperty(Uint32 index);
|
216 mike 1.25
217 /**getProperty Gets a property object from the CIMClass
|
218 kumpf 1.60 @param index The index of the property object to get.
|
219 mike 1.25 @return Returns handle of the property object requested
|
220 kumpf 1.60 @exception IndexOutOfBoundsException if the index is outside
221 the range of properties in this class
|
222 mike 1.25 */
|
223 kumpf 1.60 CIMConstProperty getProperty(Uint32 index) const;
|
224 mike 1.25
|
225 kumpf 1.60 /** removeProperty - Remove the specified property from the class
226 @param index Index of the property to be removed
227 @exception IndexOutOfBoundsException if the index is outside
228 the range of properties in this class
|
229 mike 1.25 */
|
230 kumpf 1.60 void removeProperty(Uint32 index);
|
231 mike 1.25
232 /** getPropertyCount - Gets the count of the number of properties
233 defined in the class.
|
234 kumpf 1.60 @return count of number of properties in the class
|
235 mike 1.25 */
|
236 kumpf 1.37 Uint32 getPropertyCount() const;
|
237 mike 1.25
238 /** addMethod - Adds the method object defined by the input
239 parameter to the class and increments the count of the number of
240 methods in the class
241 @param method object representing the method to be added
242 @return Returns the CIMClass object to which the method was added.
|
243 kumpf 1.58 @exception AlreadyExistsException if the method already exists
244 @exception UninitializedObjectException if the object is not initialized
|
245 mike 1.25 */
|
246 kumpf 1.37 CIMClass& addMethod(const CIMMethod& x);
|
247 mike 1.25
248 /** findMethod - Locate the method object defined by the
249 name input
|
250 kumpf 1.53 @param CIMName representing the name of the method to be found
|
251 mike 1.25 @return Position of the method object in the class to be used in
252 subsequent getmethod, etc. operations
253 */
|
254 kumpf 1.53 Uint32 findMethod(const CIMName& name) const;
|
255 mike 1.25
256 /** getMethod - Gets the method object defined by the
257 input parameter.
|
258 kumpf 1.60 @param index Index to the method object to get
|
259 mike 1.26 @return Returns handle of the method requested
|
260 kumpf 1.60 @exception IndexOutOfBoundsException if the index is outside
261 the range of methods in this class
|
262 mike 1.25 */
|
263 kumpf 1.60 CIMMethod getMethod(Uint32 index);
|
264 mike 1.25
265 /** getMethod Gets the method object defined by the input
266 parameter. This is the const version.
267 */
268
|
269 kumpf 1.60 CIMConstMethod getMethod(Uint32 index) const;
|
270 mike 1.25
271 /** removeMethod - Removes the method defined by the
272 index parameter.
273 @param Defines the index of the method to be removed.
274 @return There is no return.
275 @exception Throw OutOfBound exception if the index is outside
276 the range of existing method objects for this class
277 */
|
278 kumpf 1.60 void removeMethod(Uint32 index);
|
279 mike 1.25
|
280 mike 1.26 /** getMethodCount - Count of the number of methods in the class
|
281 mike 1.25 @return integer representing the number of methods in the class object.
282 */
|
283 kumpf 1.37 Uint32 getMethodCount() const;
284
285 /** Get names of all keys of this class. */
|
286 kumpf 1.53 void getKeyNames(Array<CIMName>& keyNames) const;
|
287 kumpf 1.37
288 Boolean hasKeys() const;
|
289 mike 1.25
|
290 kumpf 1.37 /** Makes a deep copy (clone) of the given object. */
291 CIMClass clone() const;
292
|
293 kumpf 1.49 // ATTN: Clarify exactly what identical means
|
294 kumpf 1.37 /** identical - Compares with another class
295 @param Class object for the class to be compared
296 @return True if the classes are identical
|
297 mike 1.25 */
|
298 kumpf 1.37 Boolean identical(const CIMConstClass& x) const;
|
299 mike 1.25
|
300 kumpf 1.56 /**
301 Determines if the object has not been initialized.
302
303 @return True if the object has not been initialized,
304 False otherwise
305 */
306 Boolean isUninitialized() const;
|
307 mike 1.25
308 private:
309
|
310 kumpf 1.37 CIMClassRep* _rep;
311
312 CIMClass(CIMClassRep* rep);
313
314 void _checkRep() const;
|
315 mike 1.25
316 friend class CIMConstClass;
317 friend class CIMObject;
|
318 mike 1.27 friend class CIMConstObject;
|
319 kumpf 1.51 friend class Resolver;
|
320 kumpf 1.42 friend class XmlWriter;
|
321 kumpf 1.43 friend class MofWriter;
|
322 mike 1.25 };
323
324 #define PEGASUS_ARRAY_T CIMClass
|
325 kumpf 1.47 #include <Pegasus/Common/ArrayInter.h>
|
326 mike 1.25 #undef PEGASUS_ARRAY_T
327
|
328 kumpf 1.49 // ATTN document this
329 /** CIMConstClass
|
330 mike 1.25 */
331 class PEGASUS_COMMON_LINKAGE CIMConstClass
332 {
333 public:
334
|
335 kumpf 1.37 CIMConstClass();
336
337 CIMConstClass(const CIMConstClass& x);
338
339 CIMConstClass(const CIMClass& x);
|
340 mike 1.25
|
341 kumpf 1.61 PEGASUS_EXPLICIT CIMConstClass(const CIMObject& x);
|
342 mike 1.27
|
343 kumpf 1.61 PEGASUS_EXPLICIT CIMConstClass(const CIMConstObject& x);
|
344 mike 1.27
|
345 mike 1.25 CIMConstClass(
|
346 kumpf 1.53 const CIMName& className,
347 const CIMName& superClassName = CIMName());
|
348 kumpf 1.37
349 CIMConstClass& operator=(const CIMConstClass& x);
350
351 CIMConstClass& operator=(const CIMClass& x);
352
353 ~CIMConstClass();
354
355 Boolean isAssociation() const;
356
357 Boolean isAbstract() const;
358
|
359 kumpf 1.53 const CIMName& getClassName() const;
|
360 kumpf 1.37
|
361 kumpf 1.44 const CIMObjectPath& getPath() const;
|
362 kumpf 1.37
|
363 kumpf 1.53 const CIMName& getSuperClassName() const;
|
364 kumpf 1.37
|
365 kumpf 1.53 Uint32 findQualifier(const CIMName& name) const;
|
366 kumpf 1.37
|
367 kumpf 1.60 CIMConstQualifier getQualifier(Uint32 index) const;
|
368 kumpf 1.37
369 Uint32 getQualifierCount() const;
370
|
371 kumpf 1.53 Uint32 findProperty(const CIMName& name) const;
|
372 kumpf 1.37
|
373 kumpf 1.60 CIMConstProperty getProperty(Uint32 index) const;
|
374 kumpf 1.37
375 Uint32 getPropertyCount() const;
376
|
377 kumpf 1.53 Uint32 findMethod(const CIMName& name) const;
|
378 kumpf 1.37
|
379 kumpf 1.60 CIMConstMethod getMethod(Uint32 index) const;
|
380 kumpf 1.37
381 Uint32 getMethodCount() const;
382
|
383 kumpf 1.53 void getKeyNames(Array<CIMName>& keyNames) const;
|
384 kumpf 1.37
385 Boolean hasKeys() const;
386
387 CIMClass clone() const;
388
389 Boolean identical(const CIMConstClass& x) const;
390
|
391 kumpf 1.56 Boolean isUninitialized() const;
|
392 mike 1.25
393 private:
394
|
395 kumpf 1.37 CIMClassRep* _rep;
|
396 mike 1.25
|
397 kumpf 1.37 void _checkRep() const;
|
398 mike 1.25
399 friend class CIMClassRep;
400 friend class CIMClass;
401 friend class CIMInstanceRep;
|
402 mike 1.27 friend class CIMObject;
403 friend class CIMConstObject;
|
404 kumpf 1.42 friend class XmlWriter;
|
405 kumpf 1.43 friend class MofWriter;
|
406 mike 1.25 };
407
408 PEGASUS_NAMESPACE_END
409
410 #endif /* Pegasus_CIMClass_h */
|