(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.40 and 1.1.2.45

version 1.1.2.40, 2009/11/19 16:25:45 version 1.1.2.45, 2009/12/07 21:30:31
Line 289 
Line 289 
         Boolean& isArray,         Boolean& isArray,
         Uint32& size ) const;         Uint32& size ) const;
  
       void getSCMBValuePropertyAt(
           Uint32 pos,
           SCMBValue** value,
           const char ** valueBase,
           SCMBClassProperty ** propDef,
           const char ** classBase) 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 !
Line 540 
Line 547 
         CIMType& type,         CIMType& type,
         const SCMBUnion** keyvalue) const;         const SCMBUnion** keyvalue) const;
  
       SCMO_RC getKeyBindingAtUnresolved(
           Uint32 node,
           const char** pname,
           Uint32 & pnameLen,
           CIMType& type,
           const SCMBUnion** pdata,
           const char** valueBase) const;
   
     /**     /**
      * Get the named key binding.      * Get the named key binding.
      * @parm name The name of the key binding.      * @parm name The name of the key binding.
Line 580 
Line 595 
      * Maybe only the class name and/or name space are available.      * Maybe only the class name and/or name space are available.
      * @return True if the SCMOInstacne is empty, false otherwise.      * @return True if the SCMOInstacne is empty, false otherwise.
      */      */
     Boolean isEmpty( ) const {return (inst.hdr->theClass->isEmpty()); };      Boolean isEmpty( ) const {return (inst.hdr->theClass.ptr->isEmpty()); };
  
     /**     /**
      * Determines whether the instance is used as a class container.      * Determines whether the instance is used as a class container.
Line 775 
Line 790 
     void Ref()     void Ref()
     {     {
         inst.hdr->refCount++;         inst.hdr->refCount++;
         // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());  
     };     };
  
     void Unref()     void Unref()
     {     {
         if (inst.hdr->refCount.decAndTestIfZero())         if (inst.hdr->refCount.decAndTestIfZero())
         {         {
             // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());  
             // All external references has to be destroyed.             // All external references has to be destroyed.
             _destroyExternalReferences();             _destroyExternalReferences();
             // The class has also be dereferenced.             // The class has also be dereferenced.
             delete inst.hdr->theClass;              delete inst.hdr->theClass.ptr;
             free(inst.base);             free(inst.base);
             inst.base=NULL;             inst.base=NULL;
         }         }
         else  
         {  
             // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());  
         }  
  
     };     };
  
Line 803 
Line 812 
         if ( 1 < inst.hdr->refCount.get() )         if ( 1 < inst.hdr->refCount.get() )
         {         {
             SCMBInstance_Main * oldRef = inst.hdr;             SCMBInstance_Main * oldRef = inst.hdr;
             fprintf(stderr,"!! Copy on Write (%d) !!\n",  
                     inst.hdr->refCount.get() );  
             _clone();             _clone();
             if (oldRef->refCount.decAndTestIfZero())             if (oldRef->refCount.decAndTestIfZero())
             {             {
                 // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());  
                 // All external references has to be destroyed.                 // All external references has to be destroyed.
                 _destroyExternalReferencesInternal((SCMBMgmt_Header*)oldRef);                 _destroyExternalReferencesInternal((SCMBMgmt_Header*)oldRef);
                 // The class has also be dereferenced.                 // The class has also be dereferenced.
                 delete oldRef->theClass;                  delete oldRef->theClass.ptr;
                 free((void*)oldRef);                 free((void*)oldRef);
                 oldRef=0;                 oldRef=0;
             }             }
Line 1024 
Line 1030 
         (SCMBValue*)&(inst.base[inst.hdr->propertyArray.start]);         (SCMBValue*)&(inst.base[inst.hdr->propertyArray.start]);
  
     // create a pointer to property node array of the class.     // create a pointer to property node array of the class.
     Uint64 idx = inst.hdr->theClass->cls.hdr->propertySet.nodeArray.start;      Uint64 idx = inst.hdr->theClass.ptr->cls.hdr->propertySet.nodeArray.start;
     SCMBClassPropertyNode* theClassPropNodeArray =     SCMBClassPropertyNode* theClassPropNodeArray =
         (SCMBClassPropertyNode*)&(inst.hdr->theClass->cls.base)[idx];          (SCMBClassPropertyNode*)&(inst.hdr->theClass.ptr->cls.base)[idx];
  
     // return the absolute pointer to the property definition     // return the absolute pointer to the property definition
     *propDef= &(theClassPropNodeArray[node].theProperty);     *propDef= &(theClassPropNodeArray[node].theProperty);
Line 1042 
Line 1048 
     {     {
         // return the absolute pointer to         // return the absolute pointer to
         *value = &(theClassPropNodeArray[node].theProperty.defaultValue);         *value = &(theClassPropNodeArray[node].theProperty.defaultValue);
         *valueBase = inst.hdr->theClass->cls.base;          *valueBase = inst.hdr->theClass.ptr->cls.base;
     }     }
 } }
  
   inline void SCMOInstance::getSCMBValuePropertyAt(
       Uint32 pos,
       SCMBValue** value,
       const char ** valueBase,
       SCMBClassProperty ** propDef,
       const char ** propDefBase) const
   {
       _getPropertyAt(pos,value,valueBase,propDef);
   
       *propDefBase = inst.hdr->theClass.ptr->cls.base;
   }
   
   inline SCMO_RC SCMOInstance::getKeyBindingAtUnresolved(
           Uint32 node,
           const char** pname,
           Uint32 & pnameLen,
           CIMType& type,
           const SCMBUnion** pdata,
           const char** valueBase) const
   {
       SCMO_RC rc = _getKeyBindingDataAtNodeIndex(node,pname,pnameLen,type,pdata);
       // Adjust size to string length
       if (pnameLen)
       {
           pnameLen--;
       }
       *valueBase = inst.base;
       return rc;
   }
   
   
   
 #define PEGASUS_ARRAY_T SCMOInstance #define PEGASUS_ARRAY_T SCMOInstance
 # include <Pegasus/Common/ArrayInter.h> # include <Pegasus/Common/ArrayInter.h>
 #undef PEGASUS_ARRAY_T #undef PEGASUS_ARRAY_T


Legend:
Removed from v.1.1.2.40  
changed lines
  Added in v.1.1.2.45

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2