(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.24      *
187 thilo.boehm 1.1.2.1       *               If the value is an array, the
188                           *               value array is stored in continuous memory.
189 thilo.boehm 1.1.2.13      *               e.g. (SCMBUnion*)value[0 to size-1]
190 thilo.boehm 1.1.2.24      *
191                           *               If the value is type of CIMTYPE_STRING,
192                           *               the string is referenced by the structure
193                           *               SCMBUnion.extString:
194                           *                       pchar contains the absolut pointer to the string
195                           *                       length contains the size of the string
196 thilo.boehm 1.1.2.13      *                              without trailing '\0'.
197                           *               Only for strings the caller has to free pvalue !
198 thilo.boehm 1.1.2.1       * @param type Returns the CIMType of the property
199                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
200                           * @param isArray Returns if the value is an array.
201                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
202                           * @param size Returns the size of the array.
203                           *             If it is not an array, 0 is returned.
204                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
205                           *
206                           * @return     SCMO_OK
207                           *             SCMO_NULL_VALUE : The value is a null value.
208                           *             SCMO_INDEX_OUT_OF_BOUND : Given index not found
209                           *
210                           */
211                          SCMO_RC getPropertyAt(
212                              Uint32 pos,
213                              const char** pname,
214                              CIMType& type,
215 thilo.boehm 1.1.2.13         const SCMBUnion** pvalue,
216 thilo.boehm 1.1.2.1          Boolean& isArray,
217                              Uint32& size ) const;
218                      
219                          /**
220 marek       1.1.2.11      * Gets the property name, type, and value addressed by a positional index.
221                           * The property name and value has to be copied by the caller !
222                           * @param pos The positional index of the property
223                           * @param pname Returns the property name as '\0' terminated string.
224                           *              Has to be copied by caller.
225                           *              It is set to NULL if rc != SCMO_OK.
226                           * @param value Returns an absolute pointer to the value of property.
227                           *                  Sub-pointers are NOT resolved!
228                           *               The value has to be copied by the caller !
229                           *               It returns NULL if rc != SCMO_OK.
230                           * @param valueBase Returns an absolute pointer to the base of value,
231 thilo.boehm 1.1.2.12      *                  because subsequent pointers in the value are NOT
232 marek       1.1.2.11      *                  resolved.
233                           * @param propDef Returns an absolute pointer to the property definition
234                           *                  Sub-pointers are NOT resolved!
235                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
236                           *
237                           * @return     SCMO_OK
238                           *             SCMO_NULL_VALUE : The value is a null value.
239                           *             SCMO_INDEX_OUT_OF_BOUND : Given index not found
240                           *
241                           */
242                          SCMO_RC getPropertyAt(
243                              Uint32 pos,
244                              SCMBValue** value,
245                              const char ** valueBase,
246                              SCMBClassProperty ** propDef) const;
247                      
248                          /**
249 thilo.boehm 1.1.2.1       * Gets the type and value of the named property.
250                           * The value has to be copied by the caller !
251                           * @param name The property name
252                           * @param pvalue Returns a pointer to the value of property.
253 thilo.boehm 1.1.2.13      *               The value is strored in a SCMBUnion
254                           *                and has to be copied by the caller !
255 thilo.boehm 1.1.2.1       *               It returns NULL if rc != SCMO_OK.
256 thilo.boehm 1.1.2.24      *
257 thilo.boehm 1.1.2.1       *               If the value is an array, the
258                           *               value array is stored in continuous memory.
259 thilo.boehm 1.1.2.13      *               e.g. (SCMBUnion*)value[0 to size-1]
260 thilo.boehm 1.1.2.24      *
261                           *               If the value is type of CIMTYPE_STRING,
262                           *               the string is referenced by the structure
263                           *               SCMBUnion.extString:
264                           *                       pchar contains the absolut pointer to the string
265                           *                       length contains the size of the string
266 thilo.boehm 1.1.2.13      *                              without trailing '\0'.
267                           *               Only for strings the caller has to free pvalue !
268 thilo.boehm 1.1.2.1       * @param type Returns the CIMType of the property
269                           *             It is invalid if rc == SCMO_NOT_FOUND.
270                           * @param isArray Returns if the value is an array.
271                           *             It is invalid if rc == SCMO_NOT_FOUND.
272                           * @param size Returns the size of the array.
273                           *             If it is not an array, 0 is returned.
274                           *             It is invalid if rc == SCMO_NOT_FOUND.
275                           *
276                           * @return     SCMO_OK
277                           *             SCMO_NULL_VALUE : The value is a null value.
278                           *             SCMO_NOT_FOUND : Given property name not found.
279                           */
280                          SCMO_RC getProperty(
281                              const char* name,
282                              CIMType& type,
283 thilo.boehm 1.1.2.13         const SCMBUnion** pvalue,
284 thilo.boehm 1.1.2.1          Boolean& isArray,
285                              Uint32& size ) const;
286                      
287                          /**
288                           * Set/replace a property in the instance.
289                           * If the class origin is specified, it is honored at identifying
290                           * the property within the instance.
291                           * Note: Only properties which are already part of the instance/class can
292                           * be set/replaced.
293                           * @param name The name of the property to be set.
294                           * @param type The CIMType of the property
295 thilo.boehm 1.1.2.13      * @param value A pointer to the value to be set at the named property.
296                           *              The value has to be in a SCMBUnion.
297                           *              The value is copied into the instance
298                           *              If the value == NULL, a null value is assumed.
299 thilo.boehm 1.1.2.24      *              If the value is an array, the value array has to be
300 thilo.boehm 1.1.2.13      *              stored in continuous memory.
301                           *              e.g. (SCMBUnion*)value[0 to size-1]
302 thilo.boehm 1.1.2.24      *
303                           *              To store an array of size 0, The value pointer has to
304 thilo.boehm 1.1.2.13      *              not NULL ( value != NULL ) but the size has to be 0
305                           *              (size == 0).
306 thilo.boehm 1.1.2.24      *
307                           *              If the value is type of CIMTYPE_STRING,
308                           *              the string is referenced by the structure
309                           *              SCMBUnion.extString:
310                           *                       pchar contains the absolut pointer to the string
311                           *                       length contains the size of the string
312 thilo.boehm 1.1.2.13      *                              without trailing '\0'.
313 thilo.boehm 1.1.2.1       * @param isArray Indicate that the value is an array. Default false.
314                           * @param size Returns the size of the array. If not an array this
315                           *         this parameter is ignorer. Default 0.
316                           * @param origin The class originality of the property.
317                           *               If NULL, then it is ignorred. Default NULL.
318                           * @return     SCMO_OK
319                           *             SCMO_NOT_SAME_ORIGIN : The property name was found, but
320                           *                                    the origin was not the same.
321                           *             SCMO_NOT_FOUND : Given property name not found.
322                           *             SCMO_WRONG_TYPE : Named property has the wrong type.
323                           *             SCMO_NOT_AN_ARRAY : Named property is not an array.
324                           *             SCMO_IS_AN_ARRAY  : Named property is an array.
325                           */
326                          SCMO_RC setPropertyWithOrigin(
327                              const char* name,
328                              CIMType type,
329 thilo.boehm 1.1.2.14         const SCMBUnion* value,
330 thilo.boehm 1.1.2.1          Boolean isArray=false,
331                              Uint32 size = 0,
332                              const char* origin = NULL);
333                      
334                          /**
335 thilo.boehm 1.1.2.3       * Rebuild of the key bindings from the property values
336 thilo.boehm 1.1.2.1       * if no or incomplete key properties are set on the instance.
337 thilo.boehm 1.1.2.3       * @exception NoSuchProperty
338 thilo.boehm 1.1.2.1       */
339 thilo.boehm 1.1.2.2      void buildKeyBindingsFromProperties();
340 thilo.boehm 1.1.2.1  
341                          /**
342                           * Set/replace a property filter on an instance.
343                           * The filter is a white list of property names.
344                           * A property part of the list can be accessed by name or index and
345                           * is eligible to be returned to requester.
346                           * Key properties can not be filtered. They are always a part of the
347                           * instance. If a key property is not part of the property list,
348                           * it will not be filtered out.
349                           * @param propertyList Is an NULL terminated array of char* to
350                           * property names
351                           */
352                          void setPropertyFilter(const char **propertyList);
353                      
354                          /**
355                           * Gets the hash index for the named property. Filtering is ignored.
356                           * @param theName The property name
357                           * @param pos Returns the hash index.
358                           * @return     SCMO_OK
359                           *             SCMO_INVALID_PARAMETER: name was a NULL pointer.
360                           *             SCMO_NOT_FOUND : Given property name not found.
361 thilo.boehm 1.1.2.1       */
362                          SCMO_RC getPropertyNodeIndex(const char* name, Uint32& pos) const;
363                      
364                          /**
365                           * Set/replace a property in the instance at node index.
366 thilo.boehm 1.1.2.4       * Note: If node is filtered, the property is not set but the return value
367 thilo.boehm 1.1.2.1       * is still SCMO_OK.
368                           * @param index The node index.
369                           * @param type The CIMType of the property
370 thilo.boehm 1.1.2.13      * @param pInVal A pointer to the value to be set at the named property.
371                           *               The value has to be in a SCMBUnion.
372                           *               The value is copied into the instance
373                           *               If the value == NULL, a null value is assumed.
374 thilo.boehm 1.1.2.24      *               If the value is an array, the value array has to be
375 thilo.boehm 1.1.2.13      *               stored in continuous memory.
376                           *               e.g. (SCMBUnion*)value[0 to size-1]
377 thilo.boehm 1.1.2.24      *
378                           *              To store an array of size 0, The value pointer has to
379 thilo.boehm 1.1.2.13      *               not NULL ( value != NULL ) but the size has to be 0
380                           *                (size == 0).
381 thilo.boehm 1.1.2.24      *
382                           *               If the value is type of CIMTYPE_STRING,
383                           *               the string is referenced by the structure
384                           *               SCMBUnion.extString:
385                           *                        pchar contains the absolut pointer to the string
386                           *                       length contains the size of the string
387 thilo.boehm 1.1.2.13      *                                without trailing '\0'.
388 thilo.boehm 1.1.2.1       * @param isArray Indicate that the value is an array. Default false.
389                           * @param size The size of the array. If not an array this
390                           *         this parameter is ignorer. Default 0.
391                           * @return     SCMO_OK
392                           *             SCMO_INDEX_OUT_OF_BOUND : Given index not found
393                           *             SCMO_WRONG_TYPE : The property at given node index
394                           *                               has the wrong type.
395                           *             SCMO_NOT_AN_ARRAY : The property at given node index
396                           *                                 is not an array.
397                           *             SCMO_IS_AN_ARRAY  : The property at given node index
398                           *                                 is an array.
399                           */
400                          SCMO_RC setPropertyWithNodeIndex(
401                              Uint32 node,
402                              CIMType type,
403 thilo.boehm 1.1.2.14         const SCMBUnion* pInVal,
404 thilo.boehm 1.1.2.1          Boolean isArray=false,
405                              Uint32 size = 0);
406                      
407                          /**
408 r.kieninger 1.1.2.10      * Set/replace the named key binding using binary data
409                           * @param name The key binding name.
410                           * @param type The type as CIMType.
411 thilo.boehm 1.1.2.12      * @param keyvalue A pointer to the binary key value.
412 r.kieninger 1.1.2.10      *         The value is copied into the instance
413                           *         If the value == NULL, a null value is assumed.
414 thilo.boehm 1.1.2.13      * @param keyvalue A pointer to the value to be set at the key binding,
415                           *               The keyvalue has to be in a SCMBUnion.
416                           *               The keyvalue is copied into the instance.
417                           *               If the keyvalue == NULL, a null value is assumed.
418 thilo.boehm 1.1.2.24      *
419                           *               If the keyvalue is type of CIMTYPE_STRING,
420                           *               the string is referenced by the structure
421                           *               SCMBUnion.extString:
422                           *                        pchar contains the absolut pointer to the string
423                           *                       length contains the size of the string
424 thilo.boehm 1.1.2.13      *                                without trailing '\0'.
425 r.kieninger 1.1.2.10      * @return     SCMO_OK
426                           *             SCMO_INVALID_PARAMETER : Given name or pvalue
427                           *                                      is a NULL pointer.
428                           *             SCMO_TYPE_MISSMATCH : Given type does not
429                           *                                   match to key binding type
430                           *             SCMO_NOT_FOUND : Given property name not found.
431                           */
432                          SCMO_RC setKeyBinding(
433                              const char* name,
434                              CIMType type,
435 thilo.boehm 1.1.2.14         const SCMBUnion* keyvalue);
436 r.kieninger 1.1.2.10 
437                          /**
438                           * Set/replace the key binding at node
439 thilo.boehm 1.1.2.7       * @param node The node index of the key.
440 r.kieninger 1.1.2.10      * @param type The type as CIMType.
441 thilo.boehm 1.1.2.13      * @param keyvalue A pointer to the value to be set at the key binding,
442                           *               The keyvalue has to be in a SCMBUnion.
443                           *               The keyvalue is copied into the instance.
444                           *               If the keyvalue == NULL, a null value is assumed.
445 thilo.boehm 1.1.2.24      *
446                           *               If the keyvalue is type of CIMTYPE_STRING,
447                           *               the string is referenced by the structure
448                           *               SCMBUnion.extString:
449                           *                        pchar contains the absolut pointer to the string
450                           *                       length contains the size of the string
451 thilo.boehm 1.1.2.13      *                                without trailing '\0'.
452 r.kieninger 1.1.2.10      * @return     SCMO_OK
453                           *             SCMO_INVALID_PARAMETER : Given pvalue is a NULL pointer.
454                           *             SCMO_TYPE_MISSMATCH : Given type does not
455                           *                                   match to key binding type
456                           *             SCMO_INDEX_OUT_OF_BOUND : Given index is our of range.
457                           */
458                          SCMO_RC setKeyBindingAt(
459                              Uint32 node,
460                              CIMType type,
461 thilo.boehm 1.1.2.14         const SCMBUnion* keyvalue);
462 r.kieninger 1.1.2.10 
463                          /**
464 thilo.boehm 1.1.2.1       * Gets the key binding count.
465                           * @return the number of key bindings set.
466                           */
467 marek       1.1.2.11     Uint32 getKeyBindingCount() const;
468 thilo.boehm 1.1.2.1  
469                          /**
470                           * Get the indexed key binding.
471                           * @parm idx The key bining index
472                           * @parm pname Returns the name.
473                           *             Has to be copied by caller.
474                           *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
475 thilo.boehm 1.1.2.12      * @param type Returns the type as CIMType.
476 thilo.boehm 1.1.2.1       *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
477 thilo.boehm 1.1.2.12      * @param keyvalue A pointer to the binary key value.
478 thilo.boehm 1.1.2.1       *             Has to be copied by caller.
479                           *             It is only valid if rc == SCMO_OK.
480                           * @return     SCMO_OK
481                           *             SCMO_NULL_VALUE : The key binding is not set.
482                           *             SCMO_INDEX_OUT_OF_BOUND : Given index not found
483                           *
484                           */
485                          SCMO_RC getKeyBindingAt(
486                              Uint32 idx,
487                              const char** pname,
488 thilo.boehm 1.1.2.12         CIMType& type,
489 thilo.boehm 1.1.2.13         const SCMBUnion** keyvalue) const;
490 thilo.boehm 1.1.2.1  
491                          /**
492                           * Get the named key binding.
493                           * @parm name The name of the key binding.
494 thilo.boehm 1.1.2.12      * @param type Returns the type as CIMType.
495 thilo.boehm 1.1.2.1       *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
496 thilo.boehm 1.1.2.13      * @param keyvalue Returns a pointer to the value of keybinding.
497                           *               The value is strored in a SCMBUnion
498                           *                and has to be copied by the caller !
499                           *               It returns NULL if rc != SCMO_OK.
500 thilo.boehm 1.1.2.24      *
501                           *               If the value is type of CIMTYPE_STRING,
502                           *               the string is referenced by the structure
503                           *               SCMBUnion.extString:
504                           *                       pchar contains the absolut pointer to the string
505                           *                       length contains the size of the string
506 thilo.boehm 1.1.2.13      *                              without trailing '\0'.
507                           *               Only for strings the caller has to free pvalue !
508 thilo.boehm 1.1.2.12      * @param keyvalue A pointer to the binary key value.
509 thilo.boehm 1.1.2.1       *             Has to be copied by caller.
510                           *             It is only valid if rc == SCMO_OK.
511                           * @return     SCMO_OK
512                           *             SCMO_NULL_VALUE : The key binding is not set.
513                           *             SCMO_NOT_FOUND : Given property name not found.
514                           */
515                          SCMO_RC getKeyBinding(
516                              const char* name,
517 thilo.boehm 1.1.2.12         CIMType& ptype,
518 thilo.boehm 1.1.2.13         const SCMBUnion** keyvalue) const;
519 thilo.boehm 1.1.2.1  
520                          /**
521 thilo.boehm 1.1.2.24      * Determines whether the c++ object has been initialized.
522                           * @return True if the c++ object has not been initialized, false otherwise.
523 thilo.boehm 1.1.2.1       */
524 thilo.boehm 1.1.2.17     Boolean isUninitialized( ) const {return (0 == inst.base); };
525 thilo.boehm 1.1.2.1  
526                          /**
527 thilo.boehm 1.1.2.24      * Determines whether the instance is used as a class container.
528                           * @return True if the instance is used as a class container only.
529                           */
530                          Boolean isClassOnly( ) const
531                          {
532                              return inst.hdr->flags.isClassOnly;
533                          }
534                      
535                          /**
536                           * Mark this instance to be a class only container.
537                           */
538                          void setClassOnly( )
539                          {
540                              inst.hdr->flags.isClassOnly = true;
541                          }
542                      
543                          /**
544                           * Mark this instance is a real instance.
545                           */
546                          void clearClassOnly( )
547                          {
548 thilo.boehm 1.1.2.24         inst.hdr->flags.isClassOnly = false;
549                          }
550                      
551                          /**
552 thilo.boehm 1.1.2.1       * Determies if two objects are referencing to the same instance
553                           * @return True if the objects are referencing to the some instance.
554                           */
555                          Boolean isSame(SCMOInstance& theInstance) const;
556                      
557                          /**
558 thilo.boehm 1.1.2.21      * Sets the provided host name at the instance.
559                           * @param hostName The host name as UTF8.
560                           */
561                          void setHostName(const char* hostName);
562                      
563                          /**
564 thilo.boehm 1.1.2.1       * Get the host name of the instance. The caller has to make a copy !
565                           * @return The host name as UTF8.
566                           */
567                          const char* getHostName() const;
568                      
569                          /**
570 thilo.boehm 1.1.2.21      * Get the host name of the instance.
571                           * @param Return length of result string.
572                           * @return The class name as UTF8.
573 thilo.boehm 1.1.2.1       */
574 thilo.boehm 1.1.2.21     const char* getHostName_l(Uint64 & length) const;
575                      
576 thilo.boehm 1.1.2.24     /**
577 thilo.boehm 1.1.2.21      * Sets the provided class name at the instance. By caling this function
578 thilo.boehm 1.1.2.24      * the instance is in an inconsitacne state and is maked as isCompromised.
579 thilo.boehm 1.1.2.21      * @param className The class name as UTF8.
580                           */
581                          void setClassName(const char* className);
582 thilo.boehm 1.1.2.1  
583                          /**
584 marek       1.1.2.11      * Get the class name of the instance. The caller has to make a copy !
585 thilo.boehm 1.1.2.1       * @return The class name as UTF8.
586                           */
587                          const char* getClassName() const;
588                      
589                          /**
590 marek       1.1.2.11      * Get the class name of the instance. The caller has to make a copy !
591 thilo.boehm 1.1.2.21      * @param Return length of result string.
592                           * @return The class name as UTF8.
593 marek       1.1.2.11      */
594                          const char* getClassName_l(Uint64 & length) const;
595                      
596 thilo.boehm 1.1.2.24     /**
597                           * Sets the provided name space name at the instance.
598                           * By caling this function the instance is in an inconsitacne state and
599                           * is maked as isCompromised.
600 thilo.boehm 1.1.2.21      * @param nameSpaceName The name space name as UTF8.
601                           */
602                          void setNameSpace(const char* nameSpace);
603                      
604 marek       1.1.2.11     /**
605 thilo.boehm 1.1.2.1       * Get the name space of the instance. The caller has to make a copy !
606                           * @return The name space as UTF8.
607                           */
608                          const char* getNameSpace() const;
609                      
610                          /**
611 thilo.boehm 1.1.2.21      * Get the class name of the instance. The caller has to make a copy !
612                           * @param Return length of result string.
613                           * @return The class name as UTF8.
614                           */
615                          const char* getNameSpace_l(Uint64 & length) const;
616                      
617 thilo.boehm 1.1.2.24     /**
618 thilo.boehm 1.1.2.21      * Is the name space or class name of the instance the origianl values
619                           * set by the used SCMOClass.
620                           * The class name and/or name space may differ with the associated class.
621 thilo.boehm 1.1.2.24      * @return true if name space or class name was set manually by
622 thilo.boehm 1.1.2.21      *          setNameSpace() or setClassName()
623                           */
624 thilo.boehm 1.1.2.22     Boolean isCompromised() const
625 thilo.boehm 1.1.2.21     {
626                              return inst.hdr->flags.isCompromised;
627 thilo.boehm 1.1.2.22     };
628 thilo.boehm 1.1.2.21 
629 thilo.boehm 1.1.2.23 
630 thilo.boehm 1.1.2.24     /**
631 thilo.boehm 1.1.2.23      * Mark the instance as a non validated instance.
632                           */
633 thilo.boehm 1.1.2.24     void markAsCompromised()
634 thilo.boehm 1.1.2.23     {
635                              inst.hdr->flags.isCompromised = true;
636                          };
637                      
638 thilo.boehm 1.1.2.21     /**
639 thilo.boehm 1.1.2.1       *  To indicate the export processing ( eg. XMLWriter )
640                           *  to include qualifiers for this instance.
641                           */
642                          void includeQualifiers()
643                          {
644                              inst.hdr->flags.includeQualifiers = true;
645                          };
646                      
647                          /**
648                           *  To indicate the export processing ( eg. XMLWriter )
649                           *  to NOT to include (exclude) qualifiers for this instance.
650                           */
651                          void excludeQualifiers()
652                          {
653                              inst.hdr->flags.includeQualifiers = false;
654                          }
655                      
656                          /**
657                           *  To indicate the export processing ( eg. XMLWriter )
658                           *  to include class origins for this instance.
659                           */
660 thilo.boehm 1.1.2.1      void includeClassOrigins()
661                          {
662                              inst.hdr->flags.includeClassOrigin = true;
663                          };
664                      
665                          /**
666                           *  To indicate the export processing ( eg. XMLWriter )
667                           *  to NOT to include (exclude) class origins for this instance.
668                           */
669                          void excludeClassOrigins()
670                          {
671                              inst.hdr->flags.includeClassOrigin = false;
672                          }
673                      
674                      private:
675                      
676                          void Ref()
677                          {
678                              inst.hdr->refCount++;
679                              // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
680                          };
681 thilo.boehm 1.1.2.1  
682 thilo.boehm 1.1.2.17     void Unref()
683                          {
684                              if (inst.hdr->refCount.decAndTestIfZero())
685                              {
686                                  // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
687                                  // All external references has to be destroyed.
688                                  _destroyExternalReferences();
689                                  // The class has also be dereferenced.
690                                  delete inst.hdr->theClass;
691                                  free(inst.base);
692                                  inst.base=NULL;
693                              }
694                              else
695                              {
696                                  // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
697                              }
698                      
699                          };
700                      
701 thilo.boehm 1.1.2.16 
702                          void _destroyExternalReferences();
703 thilo.boehm 1.1.2.1  
704 thilo.boehm 1.1.2.20     void _copyExternalReferences();
705                      
706 thilo.boehm 1.1.2.15     void _initSCMOInstance(SCMOClass* pClass);
707 thilo.boehm 1.1.2.1  
708 thilo.boehm 1.1.2.15     void _setCIMInstance(const CIMInstance& cimInstance);
709 thilo.boehm 1.1.2.1  
710                          SCMO_RC _getPropertyAtNodeIndex(
711 thilo.boehm 1.1.2.15         Uint32 pos,
712                              const char** pname,
713                              CIMType& type,
714                              const SCMBUnion** pvalue,
715                              Boolean& isArray,
716                              Uint32& size ) const;
717 thilo.boehm 1.1.2.1  
718                          void _setPropertyAtNodeIndex(
719                              Uint32 pos,
720                              CIMType type,
721 thilo.boehm 1.1.2.14         const SCMBUnion* pInVal,
722 thilo.boehm 1.1.2.1          Boolean isArray,
723                              Uint32 size);
724                      
725 thilo.boehm 1.1.2.21     void _setCIMValueAtNodeIndex(
726 thilo.boehm 1.1.2.24         Uint32 node,
727 thilo.boehm 1.1.2.21         CIMValueRep* valRep,
728                              CIMType realType);
729 thilo.boehm 1.1.2.4  
730 thilo.boehm 1.1.2.16     static void _getCIMValueFromSCMBUnion(
731 thilo.boehm 1.1.2.12         CIMValue& cimV,
732                              const CIMType type,
733                              const Boolean isNull,
734                              const Boolean isArray,
735                              const Uint32 arraySize,
736                              const SCMBUnion& scmbUn,
737 thilo.boehm 1.1.2.16         const char * base);
738 thilo.boehm 1.1.2.12 
739 thilo.boehm 1.1.2.16     static void _getCIMValueFromSCMBValue(
740 thilo.boehm 1.1.2.6          CIMValue& cimV,
741                              const SCMBValue& scmbV,
742 thilo.boehm 1.1.2.16         const char * base);
743 thilo.boehm 1.1.2.6  
744                          CIMProperty _getCIMPropertyAtNodeIndex(Uint32 nodeIdx) const;
745                      
746 thilo.boehm 1.1.2.4      void _setCIMObjectPath(const CIMObjectPath& cimObj);
747                      
748 thilo.boehm 1.1.2.13     SCMBUnion* _resolveSCMBUnion(
749 thilo.boehm 1.1.2.1          CIMType type,
750                              Boolean isArray,
751                              Uint32 size,
752                              Uint64 start,
753                              char* base) const;
754                      
755                          void _setSCMBUnion(
756 thilo.boehm 1.1.2.14         const SCMBUnion* pInVal,
757 thilo.boehm 1.1.2.1          CIMType type,
758                              Boolean isArray,
759                              Uint32 size,
760 thilo.boehm 1.1.2.12         SCMBUnion & u);
761 thilo.boehm 1.1.2.1  
762 thilo.boehm 1.1.2.16     static void _setUnionValue(
763 thilo.boehm 1.1.2.4          Uint64 start,
764                              SCMBMgmt_Header** pmem,
765                              CIMType type,
766 thilo.boehm 1.1.2.21         Uint64 startNS,
767                              Uint64 lenNS,
768 thilo.boehm 1.1.2.4          Union& u);
769                      
770 thilo.boehm 1.1.2.12     static void _setUnionArrayValue(
771 thilo.boehm 1.1.2.4          Uint64 start,
772                              SCMBMgmt_Header** pmem,
773                              CIMType type,
774                              Uint32& n,
775 thilo.boehm 1.1.2.21         Uint64 startNS,
776                              Uint64 lenNS,
777 thilo.boehm 1.1.2.4          Union& u);
778                      
779 thilo.boehm 1.1.2.12     SCMO_RC _getKeyBindingDataAtNodeIndex(
780 marek       1.1.2.11         Uint32 node,
781                              const char** pname,
782                              Uint32 & pnameLen,
783 thilo.boehm 1.1.2.12         CIMType& type,
784                              const SCMBUnion** pdata) const;
785 marek       1.1.2.11 
786 thilo.boehm 1.1.2.5      void _copyKeyBindings(SCMOInstance& targetInst) const;
787                      
788 thilo.boehm 1.1.2.1      Uint32 _initPropFilterWithKeys();
789                      
790                          void _setPropertyInPropertyFilter(Uint32 i);
791                      
792                          Boolean _isPropertyInFilter(Uint32 i) const;
793                      
794                          void _clearPropertyFilter();
795                      
796 thilo.boehm 1.1.2.3      void _setKeyBindingFromSCMBUnion(
797 thilo.boehm 1.1.2.4          CIMType type,
798 thilo.boehm 1.1.2.12         const SCMBUnion& u,
799                              const char * uBase,
800                              SCMBKeyBindingValue& keyData);
801                      
802 thilo.boehm 1.1.2.23     SCMO_RC _setKeyBindingFromString(
803 thilo.boehm 1.1.2.24         const char* name,
804                              CIMType type,
805 thilo.boehm 1.1.2.23         String cimKeyBinding);
806                      
807                          SCMBUserKeyBindingElement* _getUserDefinedKeyBinding(
808                              const char* name,
809                              Uint32 nameLen,
810                              CIMType type);
811                      
812                          void _setUserDefinedKeyBinding(
813                              SCMBUserKeyBindingElement& theInsertElement,
814                              char* elementBase);
815                          /**
816 thilo.boehm 1.1.2.24      * Set a SCMO user defined key binding using the class CIM type tolerating
817                           * CIM key binding types converted to CIM types by fuction
818                           *  _CIMTypeFromKeyBindingType().
819                           *
820 thilo.boehm 1.1.2.23      * @parm classType The type of the key binding in the class definition
821                           * @parm setType The type of the key binding to be set.
822                           * @param keyValue A pointer to the key binding to be set.
823                           * @param kbValue Out parameter, the SCMO keybinding to be set.
824 thilo.boehm 1.1.2.24      *
825 thilo.boehm 1.1.2.23      **/
826                          SCMO_RC _setKeyBindingTypeTolerate(
827                              CIMType classType,
828                              CIMType setType,
829                              const SCMBUnion* keyValue,
830                              SCMBKeyBindingValue& kbValue);
831                      
832                          CIMType _CIMTypeFromKeyBindingType(
833 thilo.boehm 1.1.2.24         const char* key,
834 thilo.boehm 1.1.2.23         CIMKeyBinding::Type t);
835                      
836                          SCMO_RC _getUserKeyBindingNodeIndex(Uint32& node, const char* name) const;
837                      
838                          SCMBUserKeyBindingElement* _getUserDefinedKeyBindingAt(Uint32 index) const;
839 thilo.boehm 1.1.2.12 
840 thilo.boehm 1.1.2.18     Boolean _setCimKeyBindingStringToSCMOKeyBindingValue(
841 thilo.boehm 1.1.2.16         const String& kbs,
842 thilo.boehm 1.1.2.12         CIMType type,
843                              SCMBKeyBindingValue& scmoKBV
844                              );
845                      
846 thilo.boehm 1.1.2.2  
847 thilo.boehm 1.1.2.1      union{
848                              // To access the instance main structure
849                              SCMBInstance_Main *hdr;
850                              // To access the memory management header
851                              SCMBMgmt_Header     *mem;
852                              // Generic access pointer
853                              char *base;
854                          }inst;
855                      
856                          friend class SCMOClass;
857                          friend class SCMODump;
858 thilo.boehm 1.1.2.20     friend class SCMOXmlWriter;
859 thilo.boehm 1.1.2.1  };
860                      
861                      
862 thilo.boehm 1.1.2.19 #define PEGASUS_ARRAY_T SCMOInstance
863                      # include <Pegasus/Common/ArrayInter.h>
864                      #undef PEGASUS_ARRAY_T
865                      
866 thilo.boehm 1.1.2.1  PEGASUS_NAMESPACE_END
867                      
868                      
869                      #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2