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

Diff for /pegasus/src/Pegasus/Common/SCMOInstance.h between version 1.1.2.13 and 1.1.2.30

version 1.1.2.13, 2009/09/18 09:11:11 version 1.1.2.30, 2009/10/27 18:38:08
Line 50 
Line 50 
 public: public:
  
     /**     /**
        * A SCMOInstance can only be created by a SCMOClass
        */
       SCMOInstance();
   
       /**
      * Creating a SCMOInstance using a SCMOClass.      * Creating a SCMOInstance using a SCMOClass.
      * @param baseClass A SCMOClass.      * @param baseClass A SCMOClass.
      */      */
Line 212 
Line 217 
         Uint32& size ) const;         Uint32& size ) const;
  
     /**     /**
      * Gets the property name, type, and value addressed by a positional index.  
      * The property name and value has to be copied by the caller !  
      * @param pos The positional index of the property  
      * @param pname Returns the property name as '\0' terminated string.  
      *              Has to be copied by caller.  
      *              It is set to NULL if rc != SCMO_OK.  
      * @param value Returns an absolute pointer to the value of property.  
      *                  Sub-pointers are NOT resolved!  
      *               The value has to be copied by the caller !  
      *               It returns NULL if rc != SCMO_OK.  
      * @param valueBase Returns an absolute pointer to the base of value,  
      *                  because subsequent pointers in the value are NOT  
      *                  resolved.  
      * @param propDef Returns an absolute pointer to the property definition  
      *                  Sub-pointers are NOT resolved!  
      *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.  
      *  
      * @return     SCMO_OK  
      *             SCMO_NULL_VALUE : The value is a null value.  
      *             SCMO_INDEX_OUT_OF_BOUND : Given index not found  
      *  
      */  
     SCMO_RC getPropertyAt(  
         Uint32 pos,  
         SCMBValue** value,  
         const char ** valueBase,  
         SCMBClassProperty ** propDef) const;  
   
     /**  
      * Gets the type and value of the named property.      * Gets the type and value of the named property.
      * The value has to be copied by the caller !      * The value has to be copied by the caller !
      * @param name The property name      * @param name The property name
Line 321 
Line 297 
     SCMO_RC setPropertyWithOrigin(     SCMO_RC setPropertyWithOrigin(
         const char* name,         const char* name,
         CIMType type,         CIMType type,
         SCMBUnion* value,          const SCMBUnion* value,
         Boolean isArray=false,         Boolean isArray=false,
         Uint32 size = 0,         Uint32 size = 0,
         const char* origin = NULL);         const char* origin = NULL);
Line 395 
Line 371 
     SCMO_RC setPropertyWithNodeIndex(     SCMO_RC setPropertyWithNodeIndex(
         Uint32 node,         Uint32 node,
         CIMType type,         CIMType type,
         SCMBUnion* pInVal,          const SCMBUnion* pInVal,
         Boolean isArray=false,         Boolean isArray=false,
         Uint32 size = 0);         Uint32 size = 0);
  
Line 427 
Line 403 
     SCMO_RC setKeyBinding(     SCMO_RC setKeyBinding(
         const char* name,         const char* name,
         CIMType type,         CIMType type,
         SCMBUnion* keyvalue);          const SCMBUnion* keyvalue);
  
     /**     /**
      * Set/replace the key binding at node      * Set/replace the key binding at node
Line 453 
Line 429 
     SCMO_RC setKeyBindingAt(     SCMO_RC setKeyBindingAt(
         Uint32 node,         Uint32 node,
         CIMType type,         CIMType type,
         SCMBUnion* keyvalue);          const SCMBUnion* keyvalue);
  
     /**     /**
      * Gets the key binding count.      * Gets the key binding count.
Line 513 
Line 489 
         const SCMBUnion** keyvalue) const;         const SCMBUnion** keyvalue) const;
  
     /**     /**
      * Determines whether the object has been initialized.       * Determines whether the c++ object has been initialized.
      * @return True if the object has not been initialized, false otherwise.       * @return True if the c++ object has not been initialized, false otherwise.
        */
       Boolean isUninitialized( ) const {return (0 == inst.base); };
   
       /**
        * Determines whether the instance is used as a class container.
        * @return True if the instance is used as a class container only.
      */      */
     Boolean isUninitialized( ) const {return (inst.base == NULL); };      Boolean getIsClassOnly( ) const
       {
           return inst.hdr->flags.isClassOnly;
       }
   
       /**
        * To mark if this instance is a class only container.
        */
       void setIsClassOnly( Boolean b )
       {
           inst.hdr->flags.isClassOnly = b;
       }
  
     /**     /**
      * Determies if two objects are referencing to the same instance      * Determies if two objects are referencing to the same instance
Line 525 
Line 518 
     Boolean isSame(SCMOInstance& theInstance) const;     Boolean isSame(SCMOInstance& theInstance) const;
  
     /**     /**
        * Sets the provided host name at the instance.
        * @param hostName The host name as UTF8.
        */
       void setHostName(const char* hostName);
   
       /**
        * Sets the provided host name unchecked at the instance.
        * @param hostName The host name as UTF8.
        * @param len The strlen of the host name.
        */
       void setHostName_l(const char* hostName, Uint32 len);
   
       /**
      * Get the host name of the instance. The caller has to make a copy !      * Get the host name of the instance. The caller has to make a copy !
      * @return The host name as UTF8.      * @return The host name as UTF8.
      */      */
     const char* getHostName() const;     const char* getHostName() const;
  
     /**     /**
      * Sets the provided host name at the instance.       * Get the host name of the instance.
      * @param hostName The host name as UTF8.       * @param Return strlen of result string.
        * @return The class name as UTF8.
      */      */
     void setHostName(const char* hostName);      const char* getHostName_l(Uint64 & length) const;
   
       /**
        * Sets the provided class name at the instance. By caling this function
        * the instance is in an inconsitacne state and is maked as isCompromised.
        * @param className The class name as UTF8.
        */
       void setClassName(const char* className);
   
       /**
        * Sets the provided class name at the instance. By caling this function
        * the instance is in an inconsitacne state and is maked as isCompromised.
        * @param className The class name as UTF8.
        * @param len The strlen of the name space.
        */
       void setClassName_l(const char* className, Uint64 len);
  
     /**     /**
      * Get the class name of the instance. The caller has to make a copy !      * Get the class name of the instance. The caller has to make a copy !
Line 544 
Line 566 
  
     /**     /**
      * Get the class name of the instance. The caller has to make a copy !      * Get the class name of the instance. The caller has to make a copy !
      * @return The class name as UTF8. Return length of result string.       * @param Return strlen of result string.
        * @return The class name as UTF8.
      */      */
     const char* getClassName_l(Uint64 & length) const;     const char* getClassName_l(Uint64 & length) const;
  
     /**     /**
        * Sets the provided name space name at the instance.
        * By caling this function the instance is in an inconsitacne state and
        * is maked as isCompromised.
        * @param nameSpaceName The name space name as UTF8.
        */
       void setNameSpace(const char* nameSpace);
   
       /**
        * Sets the provided name space name unchecked at the instance.
        * By caling this function the instance is in an inconsitacne state and
        * is maked as isCompromised.
        * @param nameSpaceName The name space name as UTF8.
        * @param len The strlen of the name space.
        */
       void setNameSpace_l(const char* nameSpace, Uint32 len);
   
       /**
      * Get the name space of the instance. The caller has to make a copy !      * Get the name space of the instance. The caller has to make a copy !
      * @return The name space as UTF8.      * @return The name space as UTF8.
      */      */
     const char* getNameSpace() const;     const char* getNameSpace() const;
  
     /**     /**
        * Get the class name of the instance. The caller has to make a copy !
        * @param Return strlen of result string.
        * @return The class name as UTF8.
        */
       const char* getNameSpace_l(Uint64 & length) const;
   
       /**
        * Is the name space or class name of the instance the origianl values
        * set by the used SCMOClass.
        * The class name and/or name space may differ with the associated class.
        * @return true if name space or class name was set manually by
        *          setNameSpace() or setClassName()
        */
       Boolean isCompromised() const
       {
           return inst.hdr->flags.isCompromised;
       };
   
   
       /**
        * Mark the instance as a non validated instance.
        */
       void markAsCompromised()
       {
           inst.hdr->flags.isCompromised = true;
       };
   
       /**
      *  To indicate the export processing ( eg. XMLWriter )      *  To indicate the export processing ( eg. XMLWriter )
      *  to include qualifiers for this instance.      *  to include qualifiers for this instance.
      */      */
Line 603 
Line 671 
         if (inst.hdr->refCount.decAndTestIfZero())         if (inst.hdr->refCount.decAndTestIfZero())
         {         {
             // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());             // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
               // All external references has to be destroyed.
               _destroyExternalReferences();
             // The class has also be dereferenced.             // The class has also be dereferenced.
             delete inst.hdr->theClass;             delete inst.hdr->theClass;
             free(inst.base);             free(inst.base);
Line 614 
Line 684 
         }         }
  
     };     };
     /**  
      * A SCMOInstance can only be created by a SCMOClass  
      */  
     SCMOInstance();  
  
     void _initSCMOInstance(  
         SCMOClass* pClass,  
         Boolean inclQual,  
         Boolean inclOrigin);  
  
       void _destroyExternalReferences();
   
       void _copyExternalReferences();
   
       void _initSCMOInstance(SCMOClass* pClass);
   
       void _setCIMInstance(const CIMInstance& cimInstance);
   
       void _getPropertyAt(
           Uint32 pos,
           SCMBValue** value,
           const char ** valueBase,
           SCMBClassProperty ** propDef) const;
  
     SCMO_RC _getPropertyAtNodeIndex(     SCMO_RC _getPropertyAtNodeIndex(
             Uint32 pos,             Uint32 pos,
Line 636 
Line 711 
     void _setPropertyAtNodeIndex(     void _setPropertyAtNodeIndex(
         Uint32 pos,         Uint32 pos,
         CIMType type,         CIMType type,
         SCMBUnion* pInVal,          const SCMBUnion* pInVal,
         Boolean isArray,         Boolean isArray,
         Uint32 size);         Uint32 size);
  
     void _setCIMValueAtNodeIndex(Uint32 node, CIMValueRep* valRep);      void _setCIMValueAtNodeIndex(
           Uint32 node,
           CIMValueRep* valRep,
           CIMType realType);
  
     void _getCIMValueFromSCMBUnion(      static void _getCIMValueFromSCMBUnion(
         CIMValue& cimV,         CIMValue& cimV,
         const CIMType type,         const CIMType type,
         const Boolean isNull,         const Boolean isNull,
         const Boolean isArray,         const Boolean isArray,
         const Uint32 arraySize,         const Uint32 arraySize,
         const SCMBUnion& scmbUn,         const SCMBUnion& scmbUn,
         const char * base) const;          const char * base);
  
     void _getCIMValueFromSCMBValue(      static void _getCIMValueFromSCMBValue(
         CIMValue& cimV,         CIMValue& cimV,
         const SCMBValue& scmbV,         const SCMBValue& scmbV,
         const char * base) const;          const char * base);
  
     CIMProperty _getCIMPropertyAtNodeIndex(Uint32 nodeIdx) const;     CIMProperty _getCIMPropertyAtNodeIndex(Uint32 nodeIdx) const;
  
Line 668 
Line 746 
         char* base) const;         char* base) const;
  
     void _setSCMBUnion(     void _setSCMBUnion(
         SCMBUnion* pInVal,          const SCMBUnion* pInVal,
         CIMType type,         CIMType type,
         Boolean isArray,         Boolean isArray,
         Uint32 size,         Uint32 size,
         SCMBUnion & u);         SCMBUnion & u);
  
     static void _setNonRefUnionValue(      static void _setUnionValue(
         Uint64 start,         Uint64 start,
         SCMBMgmt_Header** pmem,         SCMBMgmt_Header** pmem,
         CIMType type,         CIMType type,
           Uint64 startNS,
           Uint64 lenNS,
         Union& u);         Union& u);
  
     static void _setUnionArrayValue(     static void _setUnionArrayValue(
Line 685 
Line 765 
         SCMBMgmt_Header** pmem,         SCMBMgmt_Header** pmem,
         CIMType type,         CIMType type,
         Uint32& n,         Uint32& n,
           Uint64 startNS,
           Uint64 lenNS,
         Union& u);         Union& u);
  
     SCMO_RC _getKeyBindingDataAtNodeIndex(     SCMO_RC _getKeyBindingDataAtNodeIndex(
Line 710 
Line 792 
         const char * uBase,         const char * uBase,
         SCMBKeyBindingValue& keyData);         SCMBKeyBindingValue& keyData);
  
     SCMO_RC _setKeyBindingFromString(const char* name,String cimKeyBinding);      SCMO_RC _setKeyBindingFromString(
           const char* name,
           CIMType type,
           String cimKeyBinding);
   
       SCMBUserKeyBindingElement* _getUserDefinedKeyBinding(
           const char* name,
           Uint32 nameLen,
           CIMType type);
   
       void _setUserDefinedKeyBinding(
           SCMBUserKeyBindingElement& theInsertElement,
           char* elementBase);
       /**
        * Set a SCMO user defined key binding using the class CIM type tolerating
        * CIM key binding types converted to CIM types by fuction
        *  _CIMTypeFromKeyBindingType().
        *
        * @parm classType The type of the key binding in the class definition
        * @parm setType The type of the key binding to be set.
        * @param keyValue A pointer to the key binding to be set.
        * @param kbValue Out parameter, the SCMO keybinding to be set.
        *
        **/
       SCMO_RC _setKeyBindingTypeTolerate(
           CIMType classType,
           CIMType setType,
           const SCMBUnion* keyValue,
           SCMBKeyBindingValue& kbValue);
   
       CIMType _CIMTypeFromKeyBindingType(
           const char* key,
           CIMKeyBinding::Type t);
  
     Boolean _setCimKeyBindingStringToSCMOKeyBindigValue(      SCMO_RC _getUserKeyBindingNodeIndex(Uint32& node, const char* name) const;
         const char* v,  
         Uint32 len,      SCMBUserKeyBindingElement* _getUserDefinedKeyBindingAt(Uint32 index) const;
   
       Boolean _setCimKeyBindingStringToSCMOKeyBindingValue(
           const String& kbs,
         CIMType type,         CIMType type,
         SCMBKeyBindingValue& scmoKBV         SCMBKeyBindingValue& scmoKBV
         );         );
Line 734 
Line 851 
     friend class SCMOXmlWriter;     friend class SCMOXmlWriter;
 }; };
  
   inline void SCMOInstance::_getPropertyAt(
       Uint32 pos,
       SCMBValue** value,
       const char ** valueBase,
       SCMBClassProperty ** propDef) const
   {
       Uint32 node;
       // is filtering on ?
       if (inst.hdr->flags.isFiltered)
       {
           // Get absolut pointer to property filter index map of the instance
           Uint32* propertyFilterIndexMap =
           (Uint32*)&(inst.base[inst.hdr->propertyFilterIndexMap.start]);
           // get the real node index of the property.
           node = propertyFilterIndexMap[pos];
       }
       else
       {
           // the index is used as node index.
           node = pos;
       }
   
       SCMBValue* theInstPropNodeArray =
           (SCMBValue*)&(inst.base[inst.hdr->propertyArray.start]);
   
       // create a pointer to property node array of the class.
       Uint64 idx = inst.hdr->theClass->cls.hdr->propertySet.nodeArray.start;
       SCMBClassPropertyNode* theClassPropNodeArray =
           (SCMBClassPropertyNode*)&(inst.hdr->theClass->cls.base)[idx];
   
       // return the absolute pointer to the property definition
       *propDef= &(theClassPropNodeArray[node].theProperty);
   
       // need check if property set or not, if not set use the default value
       if (theInstPropNodeArray[node].flags.isSet)
       {
           // return the absolute pointer to the property value in the instance
           *value = &(theInstPropNodeArray[node]);
           *valueBase = inst.base;
       }
       else
       {
           // return the absolute pointer to
           *value = &(theClassPropNodeArray[node].theProperty.defaultValue);
           *valueBase = inst.hdr->theClass->cls.base;
       }
   }
   
   #define PEGASUS_ARRAY_T SCMOInstance
   # include <Pegasus/Common/ArrayInter.h>
   #undef PEGASUS_ARRAY_T
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  


Legend:
Removed from v.1.1.2.13  
changed lines
  Added in v.1.1.2.30

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2