(file) Return to SCMOInstance.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  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                           * Creating a SCMOInstance using a SCMOClass.
 54                           * @param baseClass A SCMOClass.
 55                           */
 56                          SCMOInstance(SCMOClass baseClass);
 57                      
 58                          /**
 59                           * Copy constructor for the SCMO instance, used to implement refcounting.
 60                           * @param theSCMOClass The instance for which to create a copy
 61                           * @return
 62 thilo.boehm 1.1.2.1       */
 63                          SCMOInstance(const SCMOInstance& theSCMOInstance )
 64                          {
 65                              inst.hdr = theSCMOInstance.inst.hdr;
 66                              Ref();
 67                          }
 68                      
 69                          /**
 70                           * Destructor is decrementing the refcount. If refcount is zero, the
 71                           * singele chunk memory object is deallocated.
 72                           */
 73                          ~SCMOInstance()
 74                          {
 75                              Unref();
 76                          }
 77                      
 78                          /**
 79                           * Builds a SCMOInstance based on this SCMOClass.
 80                           * The method arguments determine whether qualifiers are included,
 81                           * the class origin attributes are included,
 82                           * and which properties are included in the new instance.
 83 thilo.boehm 1.1.2.1       * @param baseClass The SCMOClass of this instance.
 84                           * @param includeQualifiers A Boolean indicating whether qualifiers in
 85                           * the class definition (and its properties) are to be added to the
 86                           * instance.  The TOINSTANCE flavor is ignored.
 87                           * @param includeClassOrigin A Boolean indicating whether ClassOrigin
 88                           * attributes are to be added to the instance.
 89                           * @param propertyList Is an NULL terminated array of char* to property
 90                           * names defining the properties that are included in the created instance.
 91                           * If the propertyList is NULL, all properties are included to the instance.
 92                           * If the propertyList is empty, no properties are added.
 93                           *
 94                           * Note that this function does NOT generate an error if a property name
 95                           * is supplied that is NOT in the class;
 96                           * it simply does not add that property to the instance.
 97                           *
 98                           */
 99                          SCMOInstance(
100                              SCMOClass baseClass,
101                              Boolean includeQualifiers,
102                              Boolean includeClassOrigin,
103                              const char** propertyList);
104 thilo.boehm 1.1.2.1  
105                          /**
106                           * Builds a SCMOInstance from the given SCMOClass and copies all
107                           * CIMInstance data into the new SCMOInstance.
108                           * @param baseClass The SCMOClass of this instance.
109                           * @param cimInstance A CIMInstace of the same class.
110 thilo.boehm 1.1.2.4       * @exception Exception if class name and name space does not match.
111                           * @exception
112                           *     Exception if CIMInstance has more key bindings then the SCMOClass.
113                           * @exception
114                           *     Exception if a key binding is not found as a key property
115                           *     of the SCMOClass.
116                           * @exception Exception if a key binding does not match
117                           *     the class definition.
118                           * @exception Exception if a property is not part of class definition.
119                           * @exception Exception if a property does not match the class definition.
120 thilo.boehm 1.1.2.1       */
121                          SCMOInstance(SCMOClass baseClass, const CIMInstance& cimInstance);
122                      
123                          /**
124 thilo.boehm 1.1.2.4       * Builds a SCMOInstance from the given SCMOClass and copies all
125                           * CIMObjectPath data into the new SCMOInstance.
126                           * @param baseClass The SCMOClass of this instance.
127                           * @param cimInstance A CIMObjectpath of the same class.
128                           * @exception Exception if class name and name space does not match.
129                           * @exception
130                           *     Exception if CIMInstance has more key bindings then the SCMOClass.
131                           * @exception
132                           *     Exception if a key binding is not found as a key property
133                           *     of the SCMOClass.
134                           * @exception Exception if a key binding does not match
135                           *     the class definition.
136                           */
137                          SCMOInstance(SCMOClass baseClass, const CIMObjectPath& cimObj);
138                      
139                          /**
140 thilo.boehm 1.1.2.1       * Converts the SCMOInstance into a CIMInstance.
141                           * It is a deep copy of the SCMOInstance into the CIMInstance.
142                           * @param cimInstance An empty CIMInstance.
143                           */
144 thilo.boehm 1.1.2.6      SCMO_RC getCIMInstance(CIMInstance& cimInstance) const;
145 thilo.boehm 1.1.2.1  
146                          /**
147                           * Makes a deep copy of the instance.
148                           * This creates a new copy of the instance.
149 thilo.boehm 1.1.2.5       * @param objectPathOnly If set to true, only the object path relevant parts
150                           *     host name and key bindings are part of the cloned instance.
151 thilo.boehm 1.1.2.1       * @return A new copy of the SCMOInstance object.
152                           */
153 thilo.boehm 1.1.2.5      SCMOInstance clone(Boolean objectPathOnly = false) const;
154 thilo.boehm 1.1.2.1  
155                          /**
156 r.kieninger 1.1.2.9       * Retrieves the objectpath part of the SCMOInstance as an instance
157                           * of class CIMObjectPath.                .
158                           * @param cimObj Reference to an instantiated CIMObjectPath to be
159                           *     populated with the data from the SCMOInstance.
160                           * @return void
161                           */
162                          void getCIMObjectPath(CIMObjectPath& cimObj) const;
163                      
164                          /**
165 thilo.boehm 1.1.2.1       * Returns the number of properties of the instance.
166                           * @param Number of properties
167                           */
168                          Uint32 getPropertyCount() const;
169                      
170                          /**
171                           * Gets the property name, type, and value addressed by a positional index.
172                           * The property name and value has to be copied by the caller !
173                           * @param pos The positional index of the property
174                           * @param pname Returns the property name as '\0' terminated string.
175                           *              Has to be copied by caller.
176                           *              It is set to NULL if rc != SCMO_OK.
177                           * @param pvalue Returns a pointer to the value of property.
178 thilo.boehm 1.1.2.13      *               The value is strored in a SCMBUnion
179                           *                and has to be copied by the caller !
180 thilo.boehm 1.1.2.1       *               It returns NULL if rc != SCMO_OK.
181 thilo.boehm 1.1.2.13      *               
182 thilo.boehm 1.1.2.1       *               If the value is an array, the
183                           *               value array is stored in continuous memory.
184 thilo.boehm 1.1.2.13      *               e.g. (SCMBUnion*)value[0 to size-1]
185                           *               
186                           *               If the value is type of CIMTYPE_STRING, 
187                           *               the string is referenced by the structure 
188                           *               SCMBUnion.extString: 
189                           *                       pchar contains the absolut pointer to the string 
190                           *                       length contains the size of the string 
191                           *                              without trailing '\0'.
192                           *               Only for strings the caller has to free pvalue !
193 thilo.boehm 1.1.2.1       * @param type Returns the CIMType of the property
194                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
195                           * @param isArray Returns if the value is an array.
196                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
197                           * @param size Returns the size of the array.
198                           *             If it is not an array, 0 is returned.
199                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
200                           *
201                           * @return     SCMO_OK
202                           *             SCMO_NULL_VALUE : The value is a null value.
203                           *             SCMO_INDEX_OUT_OF_BOUND : Given index not found
204                           *
205                           */
206                          SCMO_RC getPropertyAt(
207                              Uint32 pos,
208                              const char** pname,
209                              CIMType& type,
210 thilo.boehm 1.1.2.13         const SCMBUnion** pvalue,
211 thilo.boehm 1.1.2.1          Boolean& isArray,
212                              Uint32& size ) const;
213                      
214                          /**
215 marek       1.1.2.11      * Gets the property name, type, and value addressed by a positional index.
216                           * The property name and value has to be copied by the caller !
217                           * @param pos The positional index of the property
218                           * @param pname Returns the property name as '\0' terminated string.
219                           *              Has to be copied by caller.
220                           *              It is set to NULL if rc != SCMO_OK.
221                           * @param value Returns an absolute pointer to the value of property.
222                           *                  Sub-pointers are NOT resolved!
223                           *               The value has to be copied by the caller !
224                           *               It returns NULL if rc != SCMO_OK.
225                           * @param valueBase Returns an absolute pointer to the base of value,
226 thilo.boehm 1.1.2.12      *                  because subsequent pointers in the value are NOT
227 marek       1.1.2.11      *                  resolved.
228                           * @param propDef Returns an absolute pointer to the property definition
229                           *                  Sub-pointers are NOT resolved!
230                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
231                           *
232                           * @return     SCMO_OK
233                           *             SCMO_NULL_VALUE : The value is a null value.
234                           *             SCMO_INDEX_OUT_OF_BOUND : Given index not found
235                           *
236                           */
237                          SCMO_RC getPropertyAt(
238                              Uint32 pos,
239                              SCMBValue** value,
240                              const char ** valueBase,
241                              SCMBClassProperty ** propDef) const;
242                      
243                          /**
244 thilo.boehm 1.1.2.1       * Gets the type and value of the named property.
245                           * The value has to be copied by the caller !
246                           * @param name The property name
247                           * @param pvalue Returns a pointer to the value of property.
248 thilo.boehm 1.1.2.13      *               The value is strored in a SCMBUnion
249                           *                and has to be copied by the caller !
250 thilo.boehm 1.1.2.1       *               It returns NULL if rc != SCMO_OK.
251 thilo.boehm 1.1.2.13      *               
252 thilo.boehm 1.1.2.1       *               If the value is an array, the
253                           *               value array is stored in continuous memory.
254 thilo.boehm 1.1.2.13      *               e.g. (SCMBUnion*)value[0 to size-1]
255                           *               
256                           *               If the value is type of CIMTYPE_STRING, 
257                           *               the string is referenced by the structure 
258                           *               SCMBUnion.extString: 
259                           *                       pchar contains the absolut pointer to the string 
260                           *                       length contains the size of the string 
261                           *                              without trailing '\0'.
262                           *               Only for strings the caller has to free pvalue !
263 thilo.boehm 1.1.2.1       * @param type Returns the CIMType of the property
264                           *             It is invalid if rc == SCMO_NOT_FOUND.
265                           * @param isArray Returns if the value is an array.
266                           *             It is invalid if rc == SCMO_NOT_FOUND.
267                           * @param size Returns the size of the array.
268                           *             If it is not an array, 0 is returned.
269                           *             It is invalid if rc == SCMO_NOT_FOUND.
270                           *
271                           * @return     SCMO_OK
272                           *             SCMO_NULL_VALUE : The value is a null value.
273                           *             SCMO_NOT_FOUND : Given property name not found.
274                           */
275                          SCMO_RC getProperty(
276                              const char* name,
277                              CIMType& type,
278 thilo.boehm 1.1.2.13         const SCMBUnion** pvalue,
279 thilo.boehm 1.1.2.1          Boolean& isArray,
280                              Uint32& size ) const;
281                      
282                          /**
283                           * Set/replace a property in the instance.
284                           * If the class origin is specified, it is honored at identifying
285                           * the property within the instance.
286                           * Note: Only properties which are already part of the instance/class can
287                           * be set/replaced.
288                           * @param name The name of the property to be set.
289                           * @param type The CIMType of the property
290 thilo.boehm 1.1.2.13      * @param value A pointer to the value to be set at the named property.
291                           *              The value has to be in a SCMBUnion.
292                           *              The value is copied into the instance
293                           *              If the value == NULL, a null value is assumed.
294                           *              If the value is an array, the value array has to be 
295                           *              stored in continuous memory.
296                           *              e.g. (SCMBUnion*)value[0 to size-1]
297                           *              
298                           *              To store an array of size 0, The value pointer has to 
299                           *              not NULL ( value != NULL ) but the size has to be 0
300                           *              (size == 0).
301                           *              
302                           *              If the value is type of CIMTYPE_STRING, 
303                           *              the string is referenced by the structure 
304                           *              SCMBUnion.extString: 
305                           *                       pchar contains the absolut pointer to the string 
306                           *                       length contains the size of the string 
307                           *                              without trailing '\0'.
308 thilo.boehm 1.1.2.1       * @param isArray Indicate that the value is an array. Default false.
309                           * @param size Returns the size of the array. If not an array this
310                           *         this parameter is ignorer. Default 0.
311                           * @param origin The class originality of the property.
312                           *               If NULL, then it is ignorred. Default NULL.
313                           * @return     SCMO_OK
314                           *             SCMO_NOT_SAME_ORIGIN : The property name was found, but
315                           *                                    the origin was not the same.
316                           *             SCMO_NOT_FOUND : Given property name not found.
317                           *             SCMO_WRONG_TYPE : Named property has the wrong type.
318                           *             SCMO_NOT_AN_ARRAY : Named property is not an array.
319                           *             SCMO_IS_AN_ARRAY  : Named property is an array.
320                           */
321                          SCMO_RC setPropertyWithOrigin(
322                              const char* name,
323                              CIMType type,
324 thilo.boehm 1.1.2.14         const SCMBUnion* value,
325 thilo.boehm 1.1.2.1          Boolean isArray=false,
326                              Uint32 size = 0,
327                              const char* origin = NULL);
328                      
329                          /**
330 thilo.boehm 1.1.2.3       * Rebuild of the key bindings from the property values
331 thilo.boehm 1.1.2.1       * if no or incomplete key properties are set on the instance.
332 thilo.boehm 1.1.2.3       * @exception NoSuchProperty
333 thilo.boehm 1.1.2.1       */
334 thilo.boehm 1.1.2.2      void buildKeyBindingsFromProperties();
335 thilo.boehm 1.1.2.1  
336                          /**
337                           * Set/replace a property filter on an instance.
338                           * The filter is a white list of property names.
339                           * A property part of the list can be accessed by name or index and
340                           * is eligible to be returned to requester.
341                           * Key properties can not be filtered. They are always a part of the
342                           * instance. If a key property is not part of the property list,
343                           * it will not be filtered out.
344                           * @param propertyList Is an NULL terminated array of char* to
345                           * property names
346                           */
347                          void setPropertyFilter(const char **propertyList);
348                      
349                          /**
350                           * Gets the hash index for the named property. Filtering is ignored.
351                           * @param theName The property name
352                           * @param pos Returns the hash index.
353                           * @return     SCMO_OK
354                           *             SCMO_INVALID_PARAMETER: name was a NULL pointer.
355                           *             SCMO_NOT_FOUND : Given property name not found.
356 thilo.boehm 1.1.2.1       */
357                          SCMO_RC getPropertyNodeIndex(const char* name, Uint32& pos) const;
358                      
359                          /**
360                           * Set/replace a property in the instance at node index.
361 thilo.boehm 1.1.2.4       * Note: If node is filtered, the property is not set but the return value
362 thilo.boehm 1.1.2.1       * is still SCMO_OK.
363                           * @param index The node index.
364                           * @param type The CIMType of the property
365 thilo.boehm 1.1.2.13      * @param pInVal A pointer to the value to be set at the named property.
366                           *               The value has to be in a SCMBUnion.
367                           *               The value is copied into the instance
368                           *               If the value == NULL, a null value is assumed.
369                           *               If the value is an array, the value array has to be 
370                           *               stored in continuous memory.
371                           *               e.g. (SCMBUnion*)value[0 to size-1]
372                           *               
373                           *              To store an array of size 0, The value pointer has to 
374                           *               not NULL ( value != NULL ) but the size has to be 0
375                           *                (size == 0).
376                           *               
377                           *               If the value is type of CIMTYPE_STRING, 
378                           *               the string is referenced by the structure 
379                           *               SCMBUnion.extString: 
380                           *                        pchar contains the absolut pointer to the string 
381                           *                       length contains the size of the string 
382                           *                                without trailing '\0'.
383 thilo.boehm 1.1.2.1       * @param isArray Indicate that the value is an array. Default false.
384                           * @param size The size of the array. If not an array this
385                           *         this parameter is ignorer. Default 0.
386                           * @return     SCMO_OK
387                           *             SCMO_INDEX_OUT_OF_BOUND : Given index not found
388                           *             SCMO_WRONG_TYPE : The property at given node index
389                           *                               has the wrong type.
390                           *             SCMO_NOT_AN_ARRAY : The property at given node index
391                           *                                 is not an array.
392                           *             SCMO_IS_AN_ARRAY  : The property at given node index
393                           *                                 is an array.
394                           */
395                          SCMO_RC setPropertyWithNodeIndex(
396                              Uint32 node,
397                              CIMType type,
398 thilo.boehm 1.1.2.14         const SCMBUnion* pInVal,
399 thilo.boehm 1.1.2.1          Boolean isArray=false,
400                              Uint32 size = 0);
401                      
402                          /**
403 r.kieninger 1.1.2.10      * Set/replace the named key binding using binary data
404                           * @param name The key binding name.
405                           * @param type The type as CIMType.
406 thilo.boehm 1.1.2.12      * @param keyvalue A pointer to the binary key value.
407 r.kieninger 1.1.2.10      *         The value is copied into the instance
408                           *         If the value == NULL, a null value is assumed.
409 thilo.boehm 1.1.2.13      * @param keyvalue A pointer to the value to be set at the key binding,
410                           *               The keyvalue has to be in a SCMBUnion.
411                           *               The keyvalue is copied into the instance.
412                           *               If the keyvalue == NULL, a null value is assumed.
413                           *               
414                           *               If the keyvalue is type of CIMTYPE_STRING, 
415                           *               the string is referenced by the structure 
416                           *               SCMBUnion.extString: 
417                           *                        pchar contains the absolut pointer to the string 
418                           *                       length contains the size of the string 
419                           *                                without trailing '\0'.
420 r.kieninger 1.1.2.10      * @return     SCMO_OK
421                           *             SCMO_INVALID_PARAMETER : Given name or pvalue
422                           *                                      is a NULL pointer.
423                           *             SCMO_TYPE_MISSMATCH : Given type does not
424                           *                                   match to key binding type
425                           *             SCMO_NOT_FOUND : Given property name not found.
426                           */
427                          SCMO_RC setKeyBinding(
428                              const char* name,
429                              CIMType type,
430 thilo.boehm 1.1.2.14         const SCMBUnion* keyvalue);
431 r.kieninger 1.1.2.10 
432                          /**
433                           * Set/replace the key binding at node
434 thilo.boehm 1.1.2.7       * @param node The node index of the key.
435 r.kieninger 1.1.2.10      * @param type The type as CIMType.
436 thilo.boehm 1.1.2.13      * @param keyvalue A pointer to the value to be set at the key binding,
437                           *               The keyvalue has to be in a SCMBUnion.
438                           *               The keyvalue is copied into the instance.
439                           *               If the keyvalue == NULL, a null value is assumed.
440                           *               
441                           *               If the keyvalue is type of CIMTYPE_STRING, 
442                           *               the string is referenced by the structure 
443                           *               SCMBUnion.extString: 
444                           *                        pchar contains the absolut pointer to the string 
445                           *                       length contains the size of the string 
446                           *                                without trailing '\0'.
447 r.kieninger 1.1.2.10      * @return     SCMO_OK
448                           *             SCMO_INVALID_PARAMETER : Given pvalue is a NULL pointer.
449                           *             SCMO_TYPE_MISSMATCH : Given type does not
450                           *                                   match to key binding type
451                           *             SCMO_INDEX_OUT_OF_BOUND : Given index is our of range.
452                           */
453                          SCMO_RC setKeyBindingAt(
454                              Uint32 node,
455                              CIMType type,
456 thilo.boehm 1.1.2.14         const SCMBUnion* keyvalue);
457 r.kieninger 1.1.2.10 
458                          /**
459 thilo.boehm 1.1.2.1       * Gets the key binding count.
460                           * @return the number of key bindings set.
461                           */
462 marek       1.1.2.11     Uint32 getKeyBindingCount() const;
463 thilo.boehm 1.1.2.1  
464                          /**
465                           * Get the indexed key binding.
466                           * @parm idx The key bining index
467                           * @parm pname Returns the name.
468                           *             Has to be copied by caller.
469                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
470 thilo.boehm 1.1.2.12      * @param type Returns the type as CIMType.
471 thilo.boehm 1.1.2.1       *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
472 thilo.boehm 1.1.2.12      * @param keyvalue A pointer to the binary key value.
473 thilo.boehm 1.1.2.1       *             Has to be copied by caller.
474                           *             It is only valid if rc == SCMO_OK.
475                           * @return     SCMO_OK
476                           *             SCMO_NULL_VALUE : The key binding is not set.
477                           *             SCMO_INDEX_OUT_OF_BOUND : Given index not found
478                           *
479                           */
480                          SCMO_RC getKeyBindingAt(
481                              Uint32 idx,
482                              const char** pname,
483 thilo.boehm 1.1.2.12         CIMType& type,
484 thilo.boehm 1.1.2.13         const SCMBUnion** keyvalue) const;
485 thilo.boehm 1.1.2.1  
486                          /**
487                           * Get the named key binding.
488                           * @parm name The name of the key binding.
489 thilo.boehm 1.1.2.12      * @param type Returns the type as CIMType.
490 thilo.boehm 1.1.2.1       *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
491 thilo.boehm 1.1.2.13      * @param keyvalue Returns a pointer to the value of keybinding.
492                           *               The value is strored in a SCMBUnion
493                           *                and has to be copied by the caller !
494                           *               It returns NULL if rc != SCMO_OK.
495                           *               
496                           *               If the value is type of CIMTYPE_STRING, 
497                           *               the string is referenced by the structure 
498                           *               SCMBUnion.extString: 
499                           *                       pchar contains the absolut pointer to the string 
500                           *                       length contains the size of the string 
501                           *                              without trailing '\0'.
502                           *               Only for strings the caller has to free pvalue !
503 thilo.boehm 1.1.2.12      * @param keyvalue A pointer to the binary key value.
504 thilo.boehm 1.1.2.1       *             Has to be copied by caller.
505                           *             It is only valid if rc == SCMO_OK.
506                           * @return     SCMO_OK
507                           *             SCMO_NULL_VALUE : The key binding is not set.
508                           *             SCMO_NOT_FOUND : Given property name not found.
509                           */
510                          SCMO_RC getKeyBinding(
511                              const char* name,
512 thilo.boehm 1.1.2.12         CIMType& ptype,
513 thilo.boehm 1.1.2.13         const SCMBUnion** keyvalue) const;
514 thilo.boehm 1.1.2.1  
515                          /**
516                           * Determines whether the object has been initialized.
517                           * @return True if the object has not been initialized, false otherwise.
518                           */
519 thilo.boehm 1.1.2.17     Boolean isUninitialized( ) const {return (0 == inst.base); };
520 thilo.boehm 1.1.2.1  
521                          /**
522                           * Determies if two objects are referencing to the same instance
523                           * @return True if the objects are referencing to the some instance.
524                           */
525                          Boolean isSame(SCMOInstance& theInstance) const;
526                      
527                          /**
528                           * Get the host name of the instance. The caller has to make a copy !
529                           * @return The host name as UTF8.
530                           */
531                          const char* getHostName() const;
532                      
533                          /**
534                           * Sets the provided host name at the instance.
535                           * @param hostName The host name as UTF8.
536                           */
537                          void setHostName(const char* hostName);
538                      
539                          /**
540 marek       1.1.2.11      * Get the class name of the instance. The caller has to make a copy !
541 thilo.boehm 1.1.2.1       * @return The class name as UTF8.
542                           */
543                          const char* getClassName() const;
544                      
545                          /**
546 marek       1.1.2.11      * Get the class name of the instance. The caller has to make a copy !
547                           * @return The class name as UTF8. Return length of result string.
548                           */
549                          const char* getClassName_l(Uint64 & length) const;
550                      
551                          /**
552 thilo.boehm 1.1.2.1       * Get the name space of the instance. The caller has to make a copy !
553                           * @return The name space as UTF8.
554                           */
555                          const char* getNameSpace() const;
556                      
557                          /**
558                           *  To indicate the export processing ( eg. XMLWriter )
559                           *  to include qualifiers for this instance.
560                           */
561                          void includeQualifiers()
562                          {
563                              inst.hdr->flags.includeQualifiers = true;
564                          };
565                      
566                          /**
567                           *  To indicate the export processing ( eg. XMLWriter )
568                           *  to NOT to include (exclude) qualifiers for this instance.
569                           */
570                          void excludeQualifiers()
571                          {
572                              inst.hdr->flags.includeQualifiers = false;
573 thilo.boehm 1.1.2.1      }
574                      
575                          /**
576                           *  To indicate the export processing ( eg. XMLWriter )
577                           *  to include class origins for this instance.
578                           */
579                          void includeClassOrigins()
580                          {
581                              inst.hdr->flags.includeClassOrigin = true;
582                          };
583                      
584                          /**
585                           *  To indicate the export processing ( eg. XMLWriter )
586                           *  to NOT to include (exclude) class origins for this instance.
587                           */
588                          void excludeClassOrigins()
589                          {
590                              inst.hdr->flags.includeClassOrigin = false;
591                          }
592                      
593                      private:
594 thilo.boehm 1.1.2.1  
595                          void Ref()
596                          {
597                              inst.hdr->refCount++;
598                              // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
599                          };
600                      
601 thilo.boehm 1.1.2.17     void Unref()
602                          {
603                              if (inst.hdr->refCount.decAndTestIfZero())
604                              {
605                                  // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
606                                  // All external references has to be destroyed.
607                                  _destroyExternalReferences();
608                                  // The class has also be dereferenced.
609                                  delete inst.hdr->theClass;
610                                  free(inst.base);
611                                  inst.base=NULL;
612                              }
613                              else
614                              {
615                                  // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
616                              }
617                      
618                          };
619                      
620 thilo.boehm 1.1.2.16 
621                          void _destroyExternalReferences();
622 thilo.boehm 1.1.2.1  
623                          /**
624                           * A SCMOInstance can only be created by a SCMOClass
625                           */
626                          SCMOInstance();
627                      
628 thilo.boehm 1.1.2.15     void _initSCMOInstance(SCMOClass* pClass);
629 thilo.boehm 1.1.2.1  
630 thilo.boehm 1.1.2.15     void _setCIMInstance(const CIMInstance& cimInstance);
631 thilo.boehm 1.1.2.1  
632                          SCMO_RC _getPropertyAtNodeIndex(
633 thilo.boehm 1.1.2.15         Uint32 pos,
634                              const char** pname,
635                              CIMType& type,
636                              const SCMBUnion** pvalue,
637                              Boolean& isArray,
638                              Uint32& size ) const;
639 thilo.boehm 1.1.2.1  
640                          void _setPropertyAtNodeIndex(
641                              Uint32 pos,
642                              CIMType type,
643 thilo.boehm 1.1.2.14         const SCMBUnion* pInVal,
644 thilo.boehm 1.1.2.1          Boolean isArray,
645                              Uint32 size);
646                      
647 thilo.boehm 1.1.2.4      void _setCIMValueAtNodeIndex(Uint32 node, CIMValueRep* valRep);
648                      
649 thilo.boehm 1.1.2.16     static void _getCIMValueFromSCMBUnion(
650 thilo.boehm 1.1.2.12         CIMValue& cimV,
651                              const CIMType type,
652                              const Boolean isNull,
653                              const Boolean isArray,
654                              const Uint32 arraySize,
655                              const SCMBUnion& scmbUn,
656 thilo.boehm 1.1.2.16         const char * base);
657 thilo.boehm 1.1.2.12 
658 thilo.boehm 1.1.2.16     static void _getCIMValueFromSCMBValue(
659 thilo.boehm 1.1.2.6          CIMValue& cimV,
660                              const SCMBValue& scmbV,
661 thilo.boehm 1.1.2.16         const char * base);
662 thilo.boehm 1.1.2.6  
663                          CIMProperty _getCIMPropertyAtNodeIndex(Uint32 nodeIdx) const;
664                      
665 thilo.boehm 1.1.2.4      void _setCIMObjectPath(const CIMObjectPath& cimObj);
666                      
667 thilo.boehm 1.1.2.13     SCMBUnion* _resolveSCMBUnion(
668 thilo.boehm 1.1.2.1          CIMType type,
669                              Boolean isArray,
670                              Uint32 size,
671                              Uint64 start,
672                              char* base) const;
673                      
674                          void _setSCMBUnion(
675 thilo.boehm 1.1.2.14         const SCMBUnion* pInVal,
676 thilo.boehm 1.1.2.1          CIMType type,
677                              Boolean isArray,
678                              Uint32 size,
679 thilo.boehm 1.1.2.12         SCMBUnion & u);
680 thilo.boehm 1.1.2.1  
681 thilo.boehm 1.1.2.16     static void _setUnionValue(
682 thilo.boehm 1.1.2.4          Uint64 start,
683                              SCMBMgmt_Header** pmem,
684                              CIMType type,
685                              Union& u);
686                      
687 thilo.boehm 1.1.2.12     static void _setUnionArrayValue(
688 thilo.boehm 1.1.2.4          Uint64 start,
689                              SCMBMgmt_Header** pmem,
690                              CIMType type,
691                              Uint32& n,
692                              Union& u);
693                      
694 thilo.boehm 1.1.2.12     SCMO_RC _getKeyBindingDataAtNodeIndex(
695 marek       1.1.2.11         Uint32 node,
696                              const char** pname,
697                              Uint32 & pnameLen,
698 thilo.boehm 1.1.2.12         CIMType& type,
699                              const SCMBUnion** pdata) const;
700 marek       1.1.2.11 
701 thilo.boehm 1.1.2.5      void _copyKeyBindings(SCMOInstance& targetInst) const;
702                      
703 thilo.boehm 1.1.2.1      Uint32 _initPropFilterWithKeys();
704                      
705                          void _setPropertyInPropertyFilter(Uint32 i);
706                      
707                          Boolean _isPropertyInFilter(Uint32 i) const;
708                      
709                          void _clearPropertyFilter();
710                      
711 thilo.boehm 1.1.2.3      void _setKeyBindingFromSCMBUnion(
712 thilo.boehm 1.1.2.4          CIMType type,
713 thilo.boehm 1.1.2.12         const SCMBUnion& u,
714                              const char * uBase,
715                              SCMBKeyBindingValue& keyData);
716                      
717                          SCMO_RC _setKeyBindingFromString(const char* name,String cimKeyBinding);
718                      
719 thilo.boehm 1.1.2.18     Boolean _setCimKeyBindingStringToSCMOKeyBindingValue(
720 thilo.boehm 1.1.2.16         const String& kbs,
721 thilo.boehm 1.1.2.12         CIMType type,
722                              SCMBKeyBindingValue& scmoKBV
723                              );
724                      
725 thilo.boehm 1.1.2.2  
726 thilo.boehm 1.1.2.1      union{
727                              // To access the instance main structure
728                              SCMBInstance_Main *hdr;
729                              // To access the memory management header
730                              SCMBMgmt_Header     *mem;
731                              // Generic access pointer
732                              char *base;
733                          }inst;
734                      
735                          friend class SCMOClass;
736                          friend class SCMODump;
737 marek       1.1.2.11     friend class SCMOXmlWriter;
738 thilo.boehm 1.1.2.1  };
739                      
740                      
741                      PEGASUS_NAMESPACE_END
742                      
743                      
744                      #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2