1 thilo.boehm 1.1.2.1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 thilo.boehm 1.1.2.1 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //////////////////////////////////////////////////////////////////////////
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef _SCMOINSTANCE_H_
33 #define _SCMOINSTANCE_H_
34
35
36 #include <Pegasus/Common/Config.h>
37 #include <Pegasus/Common/Linkage.h>
38 #include <Pegasus/Common/SCMO.h>
|
39 thilo.boehm 1.1.2.2 #include <Pegasus/Common/SCMOClass.h>
|
40 r.kieninger 1.1.2.10 #include <Pegasus/Common/Union.h>
|
41 thilo.boehm 1.1.2.1
42 PEGASUS_NAMESPACE_BEGIN
43
44 #define PEGASUS_SCMB_INSTANCE_MAGIC 0xD00D1234
45
46 class SCMOClass;
47
48 class PEGASUS_COMMON_LINKAGE SCMOInstance
49 {
50 public:
51
52 /**
|
53 thilo.boehm 1.1.2.19 * A SCMOInstance can only be created by a SCMOClass
54 */
55 SCMOInstance();
56
57 /**
|
58 thilo.boehm 1.1.2.1 * Creating a SCMOInstance using a SCMOClass.
59 * @param baseClass A SCMOClass.
60 */
61 SCMOInstance(SCMOClass baseClass);
62
63 /**
64 * Copy constructor for the SCMO instance, used to implement refcounting.
65 * @param theSCMOClass The instance for which to create a copy
66 * @return
67 */
68 SCMOInstance(const SCMOInstance& theSCMOInstance )
69 {
70 inst.hdr = theSCMOInstance.inst.hdr;
71 Ref();
72 }
73
74 /**
75 * Destructor is decrementing the refcount. If refcount is zero, the
76 * singele chunk memory object is deallocated.
77 */
78 ~SCMOInstance()
79 thilo.boehm 1.1.2.1 {
80 Unref();
81 }
82
83 /**
84 * Builds a SCMOInstance based on this SCMOClass.
85 * The method arguments determine whether qualifiers are included,
86 * the class origin attributes are included,
87 * and which properties are included in the new instance.
88 * @param baseClass The SCMOClass of this instance.
89 * @param includeQualifiers A Boolean indicating whether qualifiers in
90 * the class definition (and its properties) are to be added to the
91 * instance. The TOINSTANCE flavor is ignored.
92 * @param includeClassOrigin A Boolean indicating whether ClassOrigin
93 * attributes are to be added to the instance.
94 * @param propertyList Is an NULL terminated array of char* to property
95 * names defining the properties that are included in the created instance.
96 * If the propertyList is NULL, all properties are included to the instance.
97 * If the propertyList is empty, no properties are added.
98 *
99 * Note that this function does NOT generate an error if a property name
100 thilo.boehm 1.1.2.1 * is supplied that is NOT in the class;
101 * it simply does not add that property to the instance.
102 *
103 */
104 SCMOInstance(
105 SCMOClass baseClass,
106 Boolean includeQualifiers,
107 Boolean includeClassOrigin,
108 const char** propertyList);
109
110 /**
111 * Builds a SCMOInstance from the given SCMOClass and copies all
112 * CIMInstance data into the new SCMOInstance.
113 * @param baseClass The SCMOClass of this instance.
114 * @param cimInstance A CIMInstace of the same class.
|
115 thilo.boehm 1.1.2.4 * @exception Exception if class name and name space does not match.
116 * @exception
117 * Exception if CIMInstance has more key bindings then the SCMOClass.
118 * @exception
119 * Exception if a key binding is not found as a key property
120 * of the SCMOClass.
121 * @exception Exception if a key binding does not match
122 * the class definition.
123 * @exception Exception if a property is not part of class definition.
124 * @exception Exception if a property does not match the class definition.
|
125 thilo.boehm 1.1.2.1 */
126 SCMOInstance(SCMOClass baseClass, const CIMInstance& cimInstance);
127
128 /**
|
129 thilo.boehm 1.1.2.4 * Builds a SCMOInstance from the given SCMOClass and copies all
130 * CIMObjectPath data into the new SCMOInstance.
131 * @param baseClass The SCMOClass of this instance.
132 * @param cimInstance A CIMObjectpath of the same class.
133 * @exception Exception if class name and name space does not match.
134 * @exception
135 * Exception if CIMInstance has more key bindings then the SCMOClass.
136 * @exception
137 * Exception if a key binding is not found as a key property
138 * of the SCMOClass.
139 * @exception Exception if a key binding does not match
140 * the class definition.
141 */
142 SCMOInstance(SCMOClass baseClass, const CIMObjectPath& cimObj);
143
144 /**
|
145 thilo.boehm 1.1.2.1 * Converts the SCMOInstance into a CIMInstance.
146 * It is a deep copy of the SCMOInstance into the CIMInstance.
147 * @param cimInstance An empty CIMInstance.
148 */
|
149 thilo.boehm 1.1.2.6 SCMO_RC getCIMInstance(CIMInstance& cimInstance) const;
|
150 thilo.boehm 1.1.2.1
151 /**
152 * Makes a deep copy of the instance.
153 * This creates a new copy of the instance.
|
154 thilo.boehm 1.1.2.5 * @param objectPathOnly If set to true, only the object path relevant parts
155 * host name and key bindings are part of the cloned instance.
|
156 thilo.boehm 1.1.2.1 * @return A new copy of the SCMOInstance object.
157 */
|
158 thilo.boehm 1.1.2.5 SCMOInstance clone(Boolean objectPathOnly = false) const;
|
159 thilo.boehm 1.1.2.1
160 /**
|
161 r.kieninger 1.1.2.9 * Retrieves the objectpath part of the SCMOInstance as an instance
162 * of class CIMObjectPath. .
163 * @param cimObj Reference to an instantiated CIMObjectPath to be
164 * populated with the data from the SCMOInstance.
165 * @return void
166 */
167 void getCIMObjectPath(CIMObjectPath& cimObj) const;
168
169 /**
|
170 thilo.boehm 1.1.2.1 * Returns the number of properties of the instance.
171 * @param Number of properties
172 */
173 Uint32 getPropertyCount() const;
174
175 /**
176 * Gets the property name, type, and value addressed by a positional index.
177 * The property name and value has to be copied by the caller !
178 * @param pos The positional index of the property
179 * @param pname Returns the property name as '\0' terminated string.
180 * Has to be copied by caller.
181 * It is set to NULL if rc != SCMO_OK.
182 * @param pvalue Returns a pointer to the value of property.
|
183 thilo.boehm 1.1.2.13 * The value is strored in a SCMBUnion
184 * and has to be copied by the caller !
|
185 thilo.boehm 1.1.2.1 * It returns NULL if rc != SCMO_OK.
|
186 thilo.boehm 1.1.2.24 *
|
187 thilo.boehm 1.1.2.1 * If the value is an array, the
188 * value array is stored in continuous memory.
|
189 thilo.boehm 1.1.2.13 * e.g. (SCMBUnion*)value[0 to size-1]
|
190 thilo.boehm 1.1.2.24 *
191 * If the value is type of CIMTYPE_STRING,
192 * the string is referenced by the structure
193 * SCMBUnion.extString:
194 * pchar contains the absolut pointer to the string
195 * length contains the size of the string
|
196 thilo.boehm 1.1.2.13 * without trailing '\0'.
197 * Only for strings the caller has to free pvalue !
|
198 thilo.boehm 1.1.2.1 * @param type Returns the CIMType of the property
199 * It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
200 * @param isArray Returns if the value is an array.
201 * It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
202 * @param size Returns the size of the array.
203 * If it is not an array, 0 is returned.
204 * It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
205 *
206 * @return SCMO_OK
207 * SCMO_NULL_VALUE : The value is a null value.
208 * SCMO_INDEX_OUT_OF_BOUND : Given index not found
209 *
210 */
211 SCMO_RC getPropertyAt(
212 Uint32 pos,
213 const char** pname,
214 CIMType& type,
|
215 thilo.boehm 1.1.2.13 const SCMBUnion** pvalue,
|
216 thilo.boehm 1.1.2.1 Boolean& isArray,
217 Uint32& size ) const;
218
219 /**
|
220 marek 1.1.2.11 * Gets the property name, type, and value addressed by a positional index.
221 * The property name and value has to be copied by the caller !
222 * @param pos The positional index of the property
223 * @param pname Returns the property name as '\0' terminated string.
224 * Has to be copied by caller.
225 * It is set to NULL if rc != SCMO_OK.
226 * @param value Returns an absolute pointer to the value of property.
227 * Sub-pointers are NOT resolved!
228 * The value has to be copied by the caller !
229 * It returns NULL if rc != SCMO_OK.
230 * @param valueBase Returns an absolute pointer to the base of value,
|
231 thilo.boehm 1.1.2.12 * because subsequent pointers in the value are NOT
|
232 marek 1.1.2.11 * resolved.
233 * @param propDef Returns an absolute pointer to the property definition
234 * Sub-pointers are NOT resolved!
235 * It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
236 *
237 * @return SCMO_OK
238 * SCMO_NULL_VALUE : The value is a null value.
239 * SCMO_INDEX_OUT_OF_BOUND : Given index not found
240 *
241 */
242 SCMO_RC getPropertyAt(
243 Uint32 pos,
244 SCMBValue** value,
245 const char ** valueBase,
246 SCMBClassProperty ** propDef) const;
247
248 /**
|
249 thilo.boehm 1.1.2.1 * Gets the type and value of the named property.
250 * The value has to be copied by the caller !
251 * @param name The property name
252 * @param pvalue Returns a pointer to the value of property.
|
253 thilo.boehm 1.1.2.13 * The value is strored in a SCMBUnion
254 * and has to be copied by the caller !
|
255 thilo.boehm 1.1.2.1 * It returns NULL if rc != SCMO_OK.
|
256 thilo.boehm 1.1.2.24 *
|
257 thilo.boehm 1.1.2.1 * If the value is an array, the
258 * value array is stored in continuous memory.
|
259 thilo.boehm 1.1.2.13 * e.g. (SCMBUnion*)value[0 to size-1]
|
260 thilo.boehm 1.1.2.24 *
261 * If the value is type of CIMTYPE_STRING,
262 * the string is referenced by the structure
263 * SCMBUnion.extString:
264 * pchar contains the absolut pointer to the string
265 * length contains the size of the string
|
266 thilo.boehm 1.1.2.13 * without trailing '\0'.
267 * Only for strings the caller has to free pvalue !
|
268 thilo.boehm 1.1.2.1 * @param type Returns the CIMType of the property
269 * It is invalid if rc == SCMO_NOT_FOUND.
270 * @param isArray Returns if the value is an array.
271 * It is invalid if rc == SCMO_NOT_FOUND.
272 * @param size Returns the size of the array.
273 * If it is not an array, 0 is returned.
274 * It is invalid if rc == SCMO_NOT_FOUND.
275 *
276 * @return SCMO_OK
277 * SCMO_NULL_VALUE : The value is a null value.
278 * SCMO_NOT_FOUND : Given property name not found.
279 */
280 SCMO_RC getProperty(
281 const char* name,
282 CIMType& type,
|
283 thilo.boehm 1.1.2.13 const SCMBUnion** pvalue,
|
284 thilo.boehm 1.1.2.1 Boolean& isArray,
285 Uint32& size ) const;
286
287 /**
288 * Set/replace a property in the instance.
289 * If the class origin is specified, it is honored at identifying
290 * the property within the instance.
291 * Note: Only properties which are already part of the instance/class can
292 * be set/replaced.
293 * @param name The name of the property to be set.
294 * @param type The CIMType of the property
|
295 thilo.boehm 1.1.2.13 * @param value A pointer to the value to be set at the named property.
296 * The value has to be in a SCMBUnion.
297 * The value is copied into the instance
298 * If the value == NULL, a null value is assumed.
|
299 thilo.boehm 1.1.2.24 * If the value is an array, the value array has to be
|
300 thilo.boehm 1.1.2.13 * stored in continuous memory.
301 * e.g. (SCMBUnion*)value[0 to size-1]
|
302 thilo.boehm 1.1.2.24 *
303 * To store an array of size 0, The value pointer has to
|
304 thilo.boehm 1.1.2.13 * not NULL ( value != NULL ) but the size has to be 0
305 * (size == 0).
|
306 thilo.boehm 1.1.2.24 *
307 * If the value is type of CIMTYPE_STRING,
308 * the string is referenced by the structure
309 * SCMBUnion.extString:
310 * pchar contains the absolut pointer to the string
311 * length contains the size of the string
|
312 thilo.boehm 1.1.2.13 * without trailing '\0'.
|
313 thilo.boehm 1.1.2.1 * @param isArray Indicate that the value is an array. Default false.
314 * @param size Returns the size of the array. If not an array this
315 * this parameter is ignorer. Default 0.
316 * @param origin The class originality of the property.
317 * If NULL, then it is ignorred. Default NULL.
318 * @return SCMO_OK
319 * SCMO_NOT_SAME_ORIGIN : The property name was found, but
320 * the origin was not the same.
321 * SCMO_NOT_FOUND : Given property name not found.
322 * SCMO_WRONG_TYPE : Named property has the wrong type.
323 * SCMO_NOT_AN_ARRAY : Named property is not an array.
324 * SCMO_IS_AN_ARRAY : Named property is an array.
325 */
326 SCMO_RC setPropertyWithOrigin(
327 const char* name,
328 CIMType type,
|
329 thilo.boehm 1.1.2.14 const SCMBUnion* value,
|
330 thilo.boehm 1.1.2.1 Boolean isArray=false,
331 Uint32 size = 0,
332 const char* origin = NULL);
333
334 /**
|
335 thilo.boehm 1.1.2.3 * Rebuild of the key bindings from the property values
|
336 thilo.boehm 1.1.2.1 * if no or incomplete key properties are set on the instance.
|
337 thilo.boehm 1.1.2.3 * @exception NoSuchProperty
|
338 thilo.boehm 1.1.2.1 */
|
339 thilo.boehm 1.1.2.2 void buildKeyBindingsFromProperties();
|
340 thilo.boehm 1.1.2.1
341 /**
342 * Set/replace a property filter on an instance.
343 * The filter is a white list of property names.
344 * A property part of the list can be accessed by name or index and
345 * is eligible to be returned to requester.
346 * Key properties can not be filtered. They are always a part of the
347 * instance. If a key property is not part of the property list,
348 * it will not be filtered out.
349 * @param propertyList Is an NULL terminated array of char* to
350 * property names
351 */
352 void setPropertyFilter(const char **propertyList);
353
354 /**
355 * Gets the hash index for the named property. Filtering is ignored.
356 * @param theName The property name
357 * @param pos Returns the hash index.
358 * @return SCMO_OK
359 * SCMO_INVALID_PARAMETER: name was a NULL pointer.
360 * SCMO_NOT_FOUND : Given property name not found.
361 thilo.boehm 1.1.2.1 */
362 SCMO_RC getPropertyNodeIndex(const char* name, Uint32& pos) const;
363
364 /**
365 * Set/replace a property in the instance at node index.
|
366 thilo.boehm 1.1.2.4 * Note: If node is filtered, the property is not set but the return value
|
367 thilo.boehm 1.1.2.1 * is still SCMO_OK.
368 * @param index The node index.
369 * @param type The CIMType of the property
|
370 thilo.boehm 1.1.2.13 * @param pInVal A pointer to the value to be set at the named property.
371 * The value has to be in a SCMBUnion.
372 * The value is copied into the instance
373 * If the value == NULL, a null value is assumed.
|
374 thilo.boehm 1.1.2.24 * If the value is an array, the value array has to be
|
375 thilo.boehm 1.1.2.13 * stored in continuous memory.
376 * e.g. (SCMBUnion*)value[0 to size-1]
|
377 thilo.boehm 1.1.2.24 *
378 * To store an array of size 0, The value pointer has to
|
379 thilo.boehm 1.1.2.13 * not NULL ( value != NULL ) but the size has to be 0
380 * (size == 0).
|
381 thilo.boehm 1.1.2.24 *
382 * If the value is type of CIMTYPE_STRING,
383 * the string is referenced by the structure
384 * SCMBUnion.extString:
385 * pchar contains the absolut pointer to the string
386 * length contains the size of the string
|
387 thilo.boehm 1.1.2.13 * without trailing '\0'.
|
388 thilo.boehm 1.1.2.1 * @param isArray Indicate that the value is an array. Default false.
389 * @param size The size of the array. If not an array this
390 * this parameter is ignorer. Default 0.
391 * @return SCMO_OK
392 * SCMO_INDEX_OUT_OF_BOUND : Given index not found
393 * SCMO_WRONG_TYPE : The property at given node index
394 * has the wrong type.
395 * SCMO_NOT_AN_ARRAY : The property at given node index
396 * is not an array.
397 * SCMO_IS_AN_ARRAY : The property at given node index
398 * is an array.
399 */
400 SCMO_RC setPropertyWithNodeIndex(
401 Uint32 node,
402 CIMType type,
|
403 thilo.boehm 1.1.2.14 const SCMBUnion* pInVal,
|
404 thilo.boehm 1.1.2.1 Boolean isArray=false,
405 Uint32 size = 0);
406
407 /**
|
408 r.kieninger 1.1.2.10 * Set/replace the named key binding using binary data
409 * @param name The key binding name.
410 * @param type The type as CIMType.
|
411 thilo.boehm 1.1.2.12 * @param keyvalue A pointer to the binary key value.
|
412 r.kieninger 1.1.2.10 * The value is copied into the instance
413 * If the value == NULL, a null value is assumed.
|
414 thilo.boehm 1.1.2.13 * @param keyvalue A pointer to the value to be set at the key binding,
415 * The keyvalue has to be in a SCMBUnion.
416 * The keyvalue is copied into the instance.
417 * If the keyvalue == NULL, a null value is assumed.
|
418 thilo.boehm 1.1.2.24 *
419 * If the keyvalue is type of CIMTYPE_STRING,
420 * the string is referenced by the structure
421 * SCMBUnion.extString:
422 * pchar contains the absolut pointer to the string
423 * length contains the size of the string
|
424 thilo.boehm 1.1.2.13 * without trailing '\0'.
|
425 r.kieninger 1.1.2.10 * @return SCMO_OK
426 * SCMO_INVALID_PARAMETER : Given name or pvalue
427 * is a NULL pointer.
428 * SCMO_TYPE_MISSMATCH : Given type does not
429 * match to key binding type
430 * SCMO_NOT_FOUND : Given property name not found.
431 */
432 SCMO_RC setKeyBinding(
433 const char* name,
434 CIMType type,
|
435 thilo.boehm 1.1.2.14 const SCMBUnion* keyvalue);
|
436 r.kieninger 1.1.2.10
437 /**
438 * Set/replace the key binding at node
|
439 thilo.boehm 1.1.2.7 * @param node The node index of the key.
|
440 r.kieninger 1.1.2.10 * @param type The type as CIMType.
|
441 thilo.boehm 1.1.2.13 * @param keyvalue A pointer to the value to be set at the key binding,
442 * The keyvalue has to be in a SCMBUnion.
443 * The keyvalue is copied into the instance.
444 * If the keyvalue == NULL, a null value is assumed.
|
445 thilo.boehm 1.1.2.24 *
446 * If the keyvalue is type of CIMTYPE_STRING,
447 * the string is referenced by the structure
448 * SCMBUnion.extString:
449 * pchar contains the absolut pointer to the string
450 * length contains the size of the string
|
451 thilo.boehm 1.1.2.13 * without trailing '\0'.
|
452 r.kieninger 1.1.2.10 * @return SCMO_OK
453 * SCMO_INVALID_PARAMETER : Given pvalue is a NULL pointer.
454 * SCMO_TYPE_MISSMATCH : Given type does not
455 * match to key binding type
456 * SCMO_INDEX_OUT_OF_BOUND : Given index is our of range.
457 */
458 SCMO_RC setKeyBindingAt(
459 Uint32 node,
460 CIMType type,
|
461 thilo.boehm 1.1.2.14 const SCMBUnion* keyvalue);
|
462 r.kieninger 1.1.2.10
463 /**
|
464 thilo.boehm 1.1.2.1 * Gets the key binding count.
465 * @return the number of key bindings set.
466 */
|
467 marek 1.1.2.11 Uint32 getKeyBindingCount() const;
|
468 thilo.boehm 1.1.2.1
469 /**
470 * Get the indexed key binding.
471 * @parm idx The key bining index
472 * @parm pname Returns the name.
473 * Has to be copied by caller.
474 * It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
|
475 thilo.boehm 1.1.2.12 * @param type Returns the type as CIMType.
|
476 thilo.boehm 1.1.2.1 * It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
|
477 thilo.boehm 1.1.2.12 * @param keyvalue A pointer to the binary key value.
|
478 thilo.boehm 1.1.2.1 * Has to be copied by caller.
479 * It is only valid if rc == SCMO_OK.
480 * @return SCMO_OK
481 * SCMO_NULL_VALUE : The key binding is not set.
482 * SCMO_INDEX_OUT_OF_BOUND : Given index not found
483 *
484 */
485 SCMO_RC getKeyBindingAt(
486 Uint32 idx,
487 const char** pname,
|
488 thilo.boehm 1.1.2.12 CIMType& type,
|
489 thilo.boehm 1.1.2.13 const SCMBUnion** keyvalue) const;
|
490 thilo.boehm 1.1.2.1
491 /**
492 * Get the named key binding.
493 * @parm name The name of the key binding.
|
494 thilo.boehm 1.1.2.12 * @param type Returns the type as CIMType.
|
495 thilo.boehm 1.1.2.1 * It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
|
496 thilo.boehm 1.1.2.13 * @param keyvalue Returns a pointer to the value of keybinding.
497 * The value is strored in a SCMBUnion
498 * and has to be copied by the caller !
499 * It returns NULL if rc != SCMO_OK.
|
500 thilo.boehm 1.1.2.24 *
501 * If the value is type of CIMTYPE_STRING,
502 * the string is referenced by the structure
503 * SCMBUnion.extString:
504 * pchar contains the absolut pointer to the string
505 * length contains the size of the string
|
506 thilo.boehm 1.1.2.13 * without trailing '\0'.
507 * Only for strings the caller has to free pvalue !
|
508 thilo.boehm 1.1.2.12 * @param keyvalue A pointer to the binary key value.
|
509 thilo.boehm 1.1.2.1 * Has to be copied by caller.
510 * It is only valid if rc == SCMO_OK.
511 * @return SCMO_OK
512 * SCMO_NULL_VALUE : The key binding is not set.
513 * SCMO_NOT_FOUND : Given property name not found.
514 */
515 SCMO_RC getKeyBinding(
516 const char* name,
|
517 thilo.boehm 1.1.2.12 CIMType& ptype,
|
518 thilo.boehm 1.1.2.13 const SCMBUnion** keyvalue) const;
|
519 thilo.boehm 1.1.2.1
520 /**
|
521 thilo.boehm 1.1.2.24 * Determines whether the c++ object has been initialized.
522 * @return True if the c++ object has not been initialized, false otherwise.
|
523 thilo.boehm 1.1.2.1 */
|
524 thilo.boehm 1.1.2.17 Boolean isUninitialized( ) const {return (0 == inst.base); };
|
525 thilo.boehm 1.1.2.1
526 /**
|
527 thilo.boehm 1.1.2.24 * Determines whether the instance is used as a class container.
528 * @return True if the instance is used as a class container only.
529 */
|
530 thilo.boehm 1.1.2.25 Boolean getIsClassOnly( ) const
|
531 thilo.boehm 1.1.2.24 {
532 return inst.hdr->flags.isClassOnly;
533 }
534
535 /**
|
536 thilo.boehm 1.1.2.25 * To mark if this instance is a class only container.
|
537 thilo.boehm 1.1.2.24 */
|
538 thilo.boehm 1.1.2.25 void setIsClassOnly( Boolean b )
|
539 thilo.boehm 1.1.2.24 {
|
540 thilo.boehm 1.1.2.25 inst.hdr->flags.isClassOnly = b;
|
541 thilo.boehm 1.1.2.24 }
542
543 /**
|
544 thilo.boehm 1.1.2.1 * Determies if two objects are referencing to the same instance
545 * @return True if the objects are referencing to the some instance.
546 */
547 Boolean isSame(SCMOInstance& theInstance) const;
548
549 /**
|
550 thilo.boehm 1.1.2.21 * Sets the provided host name at the instance.
551 * @param hostName The host name as UTF8.
552 */
553 void setHostName(const char* hostName);
554
555 /**
|
556 thilo.boehm 1.1.2.26 * Sets the provided host name unchecked at the instance.
557 * @param hostName The host name as UTF8.
558 * @param len The strlen of the host name.
559 */
560 void setHostName_l(const char* hostName, Uint32 len);
561
562 /**
|
563 thilo.boehm 1.1.2.1 * Get the host name of the instance. The caller has to make a copy !
564 * @return The host name as UTF8.
565 */
566 const char* getHostName() const;
567
568 /**
|
569 thilo.boehm 1.1.2.21 * Get the host name of the instance.
|
570 thilo.boehm 1.1.2.27 * @param Return strlen of result string.
|
571 thilo.boehm 1.1.2.21 * @return The class name as UTF8.
|
572 thilo.boehm 1.1.2.1 */
|
573 thilo.boehm 1.1.2.21 const char* getHostName_l(Uint64 & length) const;
574
|
575 thilo.boehm 1.1.2.24 /**
|
576 thilo.boehm 1.1.2.21 * Sets the provided class name at the instance. By caling this function
|
577 thilo.boehm 1.1.2.24 * the instance is in an inconsitacne state and is maked as isCompromised.
|
578 thilo.boehm 1.1.2.21 * @param className The class name as UTF8.
579 */
580 void setClassName(const char* className);
|
581 thilo.boehm 1.1.2.1
582 /**
|
583 marek 1.1.2.11 * Get the class name of the instance. The caller has to make a copy !
|
584 thilo.boehm 1.1.2.1 * @return The class name as UTF8.
585 */
586 const char* getClassName() const;
587
588 /**
|
589 marek 1.1.2.11 * Get the class name of the instance. The caller has to make a copy !
|
590 thilo.boehm 1.1.2.27 * @param Return strlen of result string.
|
591 thilo.boehm 1.1.2.21 * @return The class name as UTF8.
|
592 marek 1.1.2.11 */
593 const char* getClassName_l(Uint64 & length) const;
594
|
595 thilo.boehm 1.1.2.24 /**
596 * Sets the provided name space name at the instance.
597 * By caling this function the instance is in an inconsitacne state and
598 * is maked as isCompromised.
|
599 thilo.boehm 1.1.2.21 * @param nameSpaceName The name space name as UTF8.
600 */
601 void setNameSpace(const char* nameSpace);
602
|
603 marek 1.1.2.11 /**
|
604 thilo.boehm 1.1.2.26 * Sets the provided name space name unchecked at the instance.
605 * By caling this function the instance is in an inconsitacne state and
606 * is maked as isCompromised.
607 * @param nameSpaceName The name space name as UTF8.
608 * @param len The strlen of the name space.
609 */
610 void setNameSpace_l(const char* nameSpace, Uint32 len);
611
612 /**
|
613 thilo.boehm 1.1.2.1 * Get the name space of the instance. The caller has to make a copy !
614 * @return The name space as UTF8.
615 */
616 const char* getNameSpace() const;
617
618 /**
|
619 thilo.boehm 1.1.2.21 * Get the class name of the instance. The caller has to make a copy !
|
620 thilo.boehm 1.1.2.27 * @param Return strlen of result string.
|
621 thilo.boehm 1.1.2.21 * @return The class name as UTF8.
622 */
623 const char* getNameSpace_l(Uint64 & length) const;
624
|
625 thilo.boehm 1.1.2.24 /**
|
626 thilo.boehm 1.1.2.21 * Is the name space or class name of the instance the origianl values
627 * set by the used SCMOClass.
628 * The class name and/or name space may differ with the associated class.
|
629 thilo.boehm 1.1.2.24 * @return true if name space or class name was set manually by
|
630 thilo.boehm 1.1.2.21 * setNameSpace() or setClassName()
631 */
|
632 thilo.boehm 1.1.2.22 Boolean isCompromised() const
|
633 thilo.boehm 1.1.2.21 {
634 return inst.hdr->flags.isCompromised;
|
635 thilo.boehm 1.1.2.22 };
|
636 thilo.boehm 1.1.2.21
|
637 thilo.boehm 1.1.2.23
|
638 thilo.boehm 1.1.2.24 /**
|
639 thilo.boehm 1.1.2.23 * Mark the instance as a non validated instance.
640 */
|
641 thilo.boehm 1.1.2.24 void markAsCompromised()
|
642 thilo.boehm 1.1.2.23 {
643 inst.hdr->flags.isCompromised = true;
644 };
645
|
646 thilo.boehm 1.1.2.21 /**
|
647 thilo.boehm 1.1.2.1 * To indicate the export processing ( eg. XMLWriter )
648 * to include qualifiers for this instance.
649 */
650 void includeQualifiers()
651 {
652 inst.hdr->flags.includeQualifiers = true;
653 };
654
655 /**
656 * To indicate the export processing ( eg. XMLWriter )
657 * to NOT to include (exclude) qualifiers for this instance.
658 */
659 void excludeQualifiers()
660 {
661 inst.hdr->flags.includeQualifiers = false;
662 }
663
664 /**
665 * To indicate the export processing ( eg. XMLWriter )
666 * to include class origins for this instance.
667 */
668 thilo.boehm 1.1.2.1 void includeClassOrigins()
669 {
670 inst.hdr->flags.includeClassOrigin = true;
671 };
672
673 /**
674 * To indicate the export processing ( eg. XMLWriter )
675 * to NOT to include (exclude) class origins for this instance.
676 */
677 void excludeClassOrigins()
678 {
679 inst.hdr->flags.includeClassOrigin = false;
680 }
681
682 private:
683
684 void Ref()
685 {
686 inst.hdr->refCount++;
687 // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
688 };
689 thilo.boehm 1.1.2.1
|
690 thilo.boehm 1.1.2.17 void Unref()
691 {
692 if (inst.hdr->refCount.decAndTestIfZero())
693 {
694 // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
695 // All external references has to be destroyed.
696 _destroyExternalReferences();
697 // The class has also be dereferenced.
698 delete inst.hdr->theClass;
699 free(inst.base);
700 inst.base=NULL;
701 }
702 else
703 {
704 // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
705 }
706
707 };
708
|
709 thilo.boehm 1.1.2.16
710 void _destroyExternalReferences();
|
711 thilo.boehm 1.1.2.1
|
712 thilo.boehm 1.1.2.20 void _copyExternalReferences();
713
|
714 thilo.boehm 1.1.2.15 void _initSCMOInstance(SCMOClass* pClass);
|
715 thilo.boehm 1.1.2.1
|
716 thilo.boehm 1.1.2.15 void _setCIMInstance(const CIMInstance& cimInstance);
|
717 thilo.boehm 1.1.2.1
718 SCMO_RC _getPropertyAtNodeIndex(
|
719 thilo.boehm 1.1.2.15 Uint32 pos,
720 const char** pname,
721 CIMType& type,
722 const SCMBUnion** pvalue,
723 Boolean& isArray,
724 Uint32& size ) const;
|
725 thilo.boehm 1.1.2.1
726 void _setPropertyAtNodeIndex(
727 Uint32 pos,
728 CIMType type,
|
729 thilo.boehm 1.1.2.14 const SCMBUnion* pInVal,
|
730 thilo.boehm 1.1.2.1 Boolean isArray,
731 Uint32 size);
732
|
733 thilo.boehm 1.1.2.21 void _setCIMValueAtNodeIndex(
|
734 thilo.boehm 1.1.2.24 Uint32 node,
|
735 thilo.boehm 1.1.2.21 CIMValueRep* valRep,
736 CIMType realType);
|
737 thilo.boehm 1.1.2.4
|
738 thilo.boehm 1.1.2.16 static void _getCIMValueFromSCMBUnion(
|
739 thilo.boehm 1.1.2.12 CIMValue& cimV,
740 const CIMType type,
741 const Boolean isNull,
742 const Boolean isArray,
743 const Uint32 arraySize,
744 const SCMBUnion& scmbUn,
|
745 thilo.boehm 1.1.2.16 const char * base);
|
746 thilo.boehm 1.1.2.12
|
747 thilo.boehm 1.1.2.16 static void _getCIMValueFromSCMBValue(
|
748 thilo.boehm 1.1.2.6 CIMValue& cimV,
749 const SCMBValue& scmbV,
|
750 thilo.boehm 1.1.2.16 const char * base);
|
751 thilo.boehm 1.1.2.6
752 CIMProperty _getCIMPropertyAtNodeIndex(Uint32 nodeIdx) const;
753
|
754 thilo.boehm 1.1.2.4 void _setCIMObjectPath(const CIMObjectPath& cimObj);
755
|
756 thilo.boehm 1.1.2.13 SCMBUnion* _resolveSCMBUnion(
|
757 thilo.boehm 1.1.2.1 CIMType type,
758 Boolean isArray,
759 Uint32 size,
760 Uint64 start,
761 char* base) const;
762
763 void _setSCMBUnion(
|
764 thilo.boehm 1.1.2.14 const SCMBUnion* pInVal,
|
765 thilo.boehm 1.1.2.1 CIMType type,
766 Boolean isArray,
767 Uint32 size,
|
768 thilo.boehm 1.1.2.12 SCMBUnion & u);
|
769 thilo.boehm 1.1.2.1
|
770 thilo.boehm 1.1.2.16 static void _setUnionValue(
|
771 thilo.boehm 1.1.2.4 Uint64 start,
772 SCMBMgmt_Header** pmem,
773 CIMType type,
|
774 thilo.boehm 1.1.2.21 Uint64 startNS,
775 Uint64 lenNS,
|
776 thilo.boehm 1.1.2.4 Union& u);
777
|
778 thilo.boehm 1.1.2.12 static void _setUnionArrayValue(
|
779 thilo.boehm 1.1.2.4 Uint64 start,
780 SCMBMgmt_Header** pmem,
781 CIMType type,
782 Uint32& n,
|
783 thilo.boehm 1.1.2.21 Uint64 startNS,
784 Uint64 lenNS,
|
785 thilo.boehm 1.1.2.4 Union& u);
786
|
787 thilo.boehm 1.1.2.12 SCMO_RC _getKeyBindingDataAtNodeIndex(
|
788 marek 1.1.2.11 Uint32 node,
789 const char** pname,
790 Uint32 & pnameLen,
|
791 thilo.boehm 1.1.2.12 CIMType& type,
792 const SCMBUnion** pdata) const;
|
793 marek 1.1.2.11
|
794 thilo.boehm 1.1.2.5 void _copyKeyBindings(SCMOInstance& targetInst) const;
795
|
796 thilo.boehm 1.1.2.1 Uint32 _initPropFilterWithKeys();
797
798 void _setPropertyInPropertyFilter(Uint32 i);
799
800 Boolean _isPropertyInFilter(Uint32 i) const;
801
802 void _clearPropertyFilter();
803
|
804 thilo.boehm 1.1.2.3 void _setKeyBindingFromSCMBUnion(
|
805 thilo.boehm 1.1.2.4 CIMType type,
|
806 thilo.boehm 1.1.2.12 const SCMBUnion& u,
807 const char * uBase,
808 SCMBKeyBindingValue& keyData);
809
|
810 thilo.boehm 1.1.2.23 SCMO_RC _setKeyBindingFromString(
|
811 thilo.boehm 1.1.2.24 const char* name,
812 CIMType type,
|
813 thilo.boehm 1.1.2.23 String cimKeyBinding);
814
815 SCMBUserKeyBindingElement* _getUserDefinedKeyBinding(
816 const char* name,
817 Uint32 nameLen,
818 CIMType type);
819
820 void _setUserDefinedKeyBinding(
821 SCMBUserKeyBindingElement& theInsertElement,
822 char* elementBase);
823 /**
|
824 thilo.boehm 1.1.2.24 * Set a SCMO user defined key binding using the class CIM type tolerating
825 * CIM key binding types converted to CIM types by fuction
826 * _CIMTypeFromKeyBindingType().
827 *
|
828 thilo.boehm 1.1.2.23 * @parm classType The type of the key binding in the class definition
829 * @parm setType The type of the key binding to be set.
830 * @param keyValue A pointer to the key binding to be set.
831 * @param kbValue Out parameter, the SCMO keybinding to be set.
|
832 thilo.boehm 1.1.2.24 *
|
833 thilo.boehm 1.1.2.23 **/
834 SCMO_RC _setKeyBindingTypeTolerate(
835 CIMType classType,
836 CIMType setType,
837 const SCMBUnion* keyValue,
838 SCMBKeyBindingValue& kbValue);
839
840 CIMType _CIMTypeFromKeyBindingType(
|
841 thilo.boehm 1.1.2.24 const char* key,
|
842 thilo.boehm 1.1.2.23 CIMKeyBinding::Type t);
843
844 SCMO_RC _getUserKeyBindingNodeIndex(Uint32& node, const char* name) const;
845
846 SCMBUserKeyBindingElement* _getUserDefinedKeyBindingAt(Uint32 index) const;
|
847 thilo.boehm 1.1.2.12
|
848 thilo.boehm 1.1.2.18 Boolean _setCimKeyBindingStringToSCMOKeyBindingValue(
|
849 thilo.boehm 1.1.2.16 const String& kbs,
|
850 thilo.boehm 1.1.2.12 CIMType type,
851 SCMBKeyBindingValue& scmoKBV
852 );
853
|
854 thilo.boehm 1.1.2.2
|
855 thilo.boehm 1.1.2.1 union{
856 // To access the instance main structure
857 SCMBInstance_Main *hdr;
858 // To access the memory management header
859 SCMBMgmt_Header *mem;
860 // Generic access pointer
861 char *base;
862 }inst;
863
864 friend class SCMOClass;
865 friend class SCMODump;
|
866 thilo.boehm 1.1.2.20 friend class SCMOXmlWriter;
|
867 thilo.boehm 1.1.2.1 };
868
869
|
870 thilo.boehm 1.1.2.19 #define PEGASUS_ARRAY_T SCMOInstance
871 # include <Pegasus/Common/ArrayInter.h>
872 #undef PEGASUS_ARRAY_T
873
|
874 thilo.boehm 1.1.2.1 PEGASUS_NAMESPACE_END
875
876
877 #endif
|