(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 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.13      *               
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                           *               
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                           *                              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.13      *               
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                           *               
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                           *                              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                           *              If the value is an array, the value array has to be 
300                           *              stored in continuous memory.
301                           *              e.g. (SCMBUnion*)value[0 to size-1]
302                           *              
303                           *              To store an array of size 0, The value pointer has to 
304                           *              not NULL ( value != NULL ) but the size has to be 0
305                           *              (size == 0).
306                           *              
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                           *                              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                           *               If the value is an array, the value array has to be 
375                           *               stored in continuous memory.
376                           *               e.g. (SCMBUnion*)value[0 to size-1]
377                           *               
378                           *              To store an array of size 0, The value pointer has to 
379                           *               not NULL ( value != NULL ) but the size has to be 0
380                           *                (size == 0).
381                           *               
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                           *                                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                           *               
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                           *                                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                           *               
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                           *                                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                           *               
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                           *                              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                           * Determines whether the object has been initialized.
522                           * @return True if the object has not been initialized, false otherwise.
523                           */
524 thilo.boehm 1.1.2.17     Boolean isUninitialized( ) const {return (0 == inst.base); };
525 thilo.boehm 1.1.2.1  
526                          /**
527                           * Determies if two objects are referencing to the same instance
528                           * @return True if the objects are referencing to the some instance.
529                           */
530                          Boolean isSame(SCMOInstance& theInstance) const;
531                      
532                          /**
533                           * Get the host name of the instance. The caller has to make a copy !
534                           * @return The host name as UTF8.
535                           */
536                          const char* getHostName() const;
537                      
538                          /**
539                           * Sets the provided host name at the instance.
540                           * @param hostName The host name as UTF8.
541                           */
542                          void setHostName(const char* hostName);
543                      
544                          /**
545 marek       1.1.2.11      * Get the class name of the instance. The caller has to make a copy !
546 thilo.boehm 1.1.2.1       * @return The class name as UTF8.
547                           */
548                          const char* getClassName() const;
549                      
550                          /**
551 marek       1.1.2.11      * Get the class name of the instance. The caller has to make a copy !
552                           * @return The class name as UTF8. Return length of result string.
553                           */
554                          const char* getClassName_l(Uint64 & length) const;
555                      
556                          /**
557 thilo.boehm 1.1.2.1       * Get the name space of the instance. The caller has to make a copy !
558                           * @return The name space as UTF8.
559                           */
560                          const char* getNameSpace() const;
561                      
562                          /**
563                           *  To indicate the export processing ( eg. XMLWriter )
564                           *  to include qualifiers for this instance.
565                           */
566                          void includeQualifiers()
567                          {
568                              inst.hdr->flags.includeQualifiers = true;
569                          };
570                      
571                          /**
572                           *  To indicate the export processing ( eg. XMLWriter )
573                           *  to NOT to include (exclude) qualifiers for this instance.
574                           */
575                          void excludeQualifiers()
576                          {
577                              inst.hdr->flags.includeQualifiers = false;
578 thilo.boehm 1.1.2.1      }
579                      
580                          /**
581                           *  To indicate the export processing ( eg. XMLWriter )
582                           *  to include class origins for this instance.
583                           */
584                          void includeClassOrigins()
585                          {
586                              inst.hdr->flags.includeClassOrigin = true;
587                          };
588                      
589                          /**
590                           *  To indicate the export processing ( eg. XMLWriter )
591                           *  to NOT to include (exclude) class origins for this instance.
592                           */
593                          void excludeClassOrigins()
594                          {
595                              inst.hdr->flags.includeClassOrigin = false;
596                          }
597                      
598                      private:
599 thilo.boehm 1.1.2.1  
600                          void Ref()
601                          {
602                              inst.hdr->refCount++;
603                              // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
604                          };
605                      
606 thilo.boehm 1.1.2.17     void Unref()
607                          {
608                              if (inst.hdr->refCount.decAndTestIfZero())
609                              {
610                                  // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
611                                  // All external references has to be destroyed.
612                                  _destroyExternalReferences();
613                                  // The class has also be dereferenced.
614                                  delete inst.hdr->theClass;
615                                  free(inst.base);
616                                  inst.base=NULL;
617                              }
618                              else
619                              {
620                                  // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
621                              }
622                      
623                          };
624                      
625 thilo.boehm 1.1.2.16 
626                          void _destroyExternalReferences();
627 thilo.boehm 1.1.2.1  
628 thilo.boehm 1.1.2.20     void _copyExternalReferences();
629                      
630 thilo.boehm 1.1.2.15     void _initSCMOInstance(SCMOClass* pClass);
631 thilo.boehm 1.1.2.1  
632 thilo.boehm 1.1.2.15     void _setCIMInstance(const CIMInstance& cimInstance);
633 thilo.boehm 1.1.2.1  
634                          SCMO_RC _getPropertyAtNodeIndex(
635 thilo.boehm 1.1.2.15         Uint32 pos,
636                              const char** pname,
637                              CIMType& type,
638                              const SCMBUnion** pvalue,
639                              Boolean& isArray,
640                              Uint32& size ) const;
641 thilo.boehm 1.1.2.1  
642                          void _setPropertyAtNodeIndex(
643                              Uint32 pos,
644                              CIMType type,
645 thilo.boehm 1.1.2.14         const SCMBUnion* pInVal,
646 thilo.boehm 1.1.2.1          Boolean isArray,
647                              Uint32 size);
648                      
649 thilo.boehm 1.1.2.4      void _setCIMValueAtNodeIndex(Uint32 node, CIMValueRep* valRep);
650                      
651 thilo.boehm 1.1.2.16     static void _getCIMValueFromSCMBUnion(
652 thilo.boehm 1.1.2.12         CIMValue& cimV,
653                              const CIMType type,
654                              const Boolean isNull,
655                              const Boolean isArray,
656                              const Uint32 arraySize,
657                              const SCMBUnion& scmbUn,
658 thilo.boehm 1.1.2.16         const char * base);
659 thilo.boehm 1.1.2.12 
660 thilo.boehm 1.1.2.16     static void _getCIMValueFromSCMBValue(
661 thilo.boehm 1.1.2.6          CIMValue& cimV,
662                              const SCMBValue& scmbV,
663 thilo.boehm 1.1.2.16         const char * base);
664 thilo.boehm 1.1.2.6  
665                          CIMProperty _getCIMPropertyAtNodeIndex(Uint32 nodeIdx) const;
666                      
667 thilo.boehm 1.1.2.4      void _setCIMObjectPath(const CIMObjectPath& cimObj);
668                      
669 thilo.boehm 1.1.2.13     SCMBUnion* _resolveSCMBUnion(
670 thilo.boehm 1.1.2.1          CIMType type,
671                              Boolean isArray,
672                              Uint32 size,
673                              Uint64 start,
674                              char* base) const;
675                      
676                          void _setSCMBUnion(
677 thilo.boehm 1.1.2.14         const SCMBUnion* pInVal,
678 thilo.boehm 1.1.2.1          CIMType type,
679                              Boolean isArray,
680                              Uint32 size,
681 thilo.boehm 1.1.2.12         SCMBUnion & u);
682 thilo.boehm 1.1.2.1  
683 thilo.boehm 1.1.2.16     static void _setUnionValue(
684 thilo.boehm 1.1.2.4          Uint64 start,
685                              SCMBMgmt_Header** pmem,
686                              CIMType type,
687                              Union& u);
688                      
689 thilo.boehm 1.1.2.12     static void _setUnionArrayValue(
690 thilo.boehm 1.1.2.4          Uint64 start,
691                              SCMBMgmt_Header** pmem,
692                              CIMType type,
693                              Uint32& n,
694                              Union& u);
695                      
696 thilo.boehm 1.1.2.12     SCMO_RC _getKeyBindingDataAtNodeIndex(
697 marek       1.1.2.11         Uint32 node,
698                              const char** pname,
699                              Uint32 & pnameLen,
700 thilo.boehm 1.1.2.12         CIMType& type,
701                              const SCMBUnion** pdata) const;
702 marek       1.1.2.11 
703 thilo.boehm 1.1.2.5      void _copyKeyBindings(SCMOInstance& targetInst) const;
704                      
705 thilo.boehm 1.1.2.1      Uint32 _initPropFilterWithKeys();
706                      
707                          void _setPropertyInPropertyFilter(Uint32 i);
708                      
709                          Boolean _isPropertyInFilter(Uint32 i) const;
710                      
711                          void _clearPropertyFilter();
712                      
713 thilo.boehm 1.1.2.3      void _setKeyBindingFromSCMBUnion(
714 thilo.boehm 1.1.2.4          CIMType type,
715 thilo.boehm 1.1.2.12         const SCMBUnion& u,
716                              const char * uBase,
717                              SCMBKeyBindingValue& keyData);
718                      
719                          SCMO_RC _setKeyBindingFromString(const char* name,String cimKeyBinding);
720                      
721 thilo.boehm 1.1.2.18     Boolean _setCimKeyBindingStringToSCMOKeyBindingValue(
722 thilo.boehm 1.1.2.16         const String& kbs,
723 thilo.boehm 1.1.2.12         CIMType type,
724                              SCMBKeyBindingValue& scmoKBV
725                              );
726                      
727 thilo.boehm 1.1.2.2  
728 thilo.boehm 1.1.2.1      union{
729                              // To access the instance main structure
730                              SCMBInstance_Main *hdr;
731                              // To access the memory management header
732                              SCMBMgmt_Header     *mem;
733                              // Generic access pointer
734                              char *base;
735                          }inst;
736                      
737                          friend class SCMOClass;
738                          friend class SCMODump;
739 thilo.boehm 1.1.2.20     friend class SCMOXmlWriter;
740 thilo.boehm 1.1.2.1  };
741                      
742                      
743 thilo.boehm 1.1.2.19 #define PEGASUS_ARRAY_T SCMOInstance
744                      # include <Pegasus/Common/ArrayInter.h>
745                      #undef PEGASUS_ARRAY_T
746                      
747 thilo.boehm 1.1.2.1  PEGASUS_NAMESPACE_END
748                      
749                      
750                      #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2