(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.34 and 1.1.2.40

version 1.1.2.34, 2009/11/12 16:18:04 version 1.1.2.40, 2009/11/19 16:25:45
Line 79 
Line 79 
     }     }
  
     /**     /**
        * Constructs a SCMOInstance from a memory object of type SCMBInstance_Main.
        * It incremets the referece counter of the memory object.
        * @param hdr A memory object of type SCMBInstance_Main.
        **/
       SCMOInstance(SCMBInstance_Main* hdr)
       {
           inst.hdr = hdr;
           Ref();
       }
   
   
       /**
      * Assignment operator for the SCMO instance,      * Assignment operator for the SCMO instance,
      * @param theSCMOClass The right hand value       * @param theSCMOInstance The right hand value
      **/      **/
     SCMOInstance& operator=(const SCMOInstance& theSCMOInstance)     SCMOInstance& operator=(const SCMOInstance& theSCMOInstance)
     {     {
Line 241 
Line 253 
      *              Has to be copied by caller.      *              Has to be copied by caller.
      *              It is set to NULL if rc != SCMO_OK.      *              It is set to NULL if rc != SCMO_OK.
      * @param pvalue Returns a pointer to the value of property.      * @param pvalue Returns a pointer to the value of property.
      *               The value is strored in a SCMBUnion       *               The value is stored in a SCMBUnion
      *                and has to be copied by the caller !      *                and has to be copied by the caller !
      *               It returns NULL if rc != SCMO_OK.      *               It returns NULL if rc != SCMO_OK.
      *      *
Line 282 
Line 294 
      * 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
      * @param pvalue Returns a pointer to the value of property.      * @param pvalue Returns a pointer to the value of property.
      *               The value is strored in a SCMBUnion       *               The value is stored in a SCMBUnion
      *                and has to be copied by the caller !      *                and has to be copied by the caller !
      *               It returns NULL if rc != SCMO_OK.      *               It returns NULL if rc != SCMO_OK.
      *      *
Line 534 
Line 546 
      * @param type Returns the type as CIMType.      * @param type Returns the type as CIMType.
      *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.      *             It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND.
      * @param keyvalue Returns a pointer to the value of keybinding.      * @param keyvalue Returns a pointer to the value of keybinding.
      *               The value is strored in a SCMBUnion       *               The value is stored in a SCMBUnion
      *                and has to be copied by the caller !      *                and has to be copied by the caller !
      *               It returns NULL if rc != SCMO_OK.      *               It returns NULL if rc != SCMO_OK.
      *      *
Line 734 
Line 746 
         inst.hdr->flags.includeClassOrigin = false;         inst.hdr->flags.includeClassOrigin = false;
     }     }
  
   
       /**
        * Returns the number of external references hosted by the instance.
        **/
       Uint32 numberExtRef() const
       {
           return inst.mem->numberExtRef;
       }
   
       /**
        * Gets the pointer of an external reference of the instance.
        * Warning: The pointer is purely returned. No management is done.
        * @parm idx The index of the external reference.
        **/
       SCMOInstance* getExtRef(Uint32 idx) const;
   
       /**
        * Sets a pointer of an external reference of the instance.
        * Warning: The pointer is purely returned. No management is done.
        * @parm idx The index of the external reference.
        * @parm ptr The pointer to an SCMOInstance
        **/
       void putExtRef(Uint32 idx,SCMOInstance* ptr);
   
 private: private:
  
     void Ref()     void Ref()
Line 762 
Line 798 
     };     };
  
  
       void _copyOnWrite()
       {
           if ( 1 < inst.hdr->refCount.get() )
           {
               SCMBInstance_Main * oldRef = inst.hdr;
               fprintf(stderr,"!! Copy on Write (%d) !!\n",
                       inst.hdr->refCount.get() );
               _clone();
               if (oldRef->refCount.decAndTestIfZero())
               {
                   // printf("\ninst.hdr->refCount=%u\n",inst.hdr->refCount.get());
                   // All external references has to be destroyed.
                   _destroyExternalReferencesInternal((SCMBMgmt_Header*)oldRef);
                   // The class has also be dereferenced.
                   delete oldRef->theClass;
                   free((void*)oldRef);
                   oldRef=0;
               }
           }
       };
   
       void _clone();
   
     void _destroyExternalReferences();     void _destroyExternalReferences();
  
     void _destroyExternalKeyBindings();     void _destroyExternalKeyBindings();
Line 936 
Line 995 
     friend class SCMOClass;     friend class SCMOClass;
     friend class SCMODump;     friend class SCMODump;
     friend class SCMOXmlWriter;     friend class SCMOXmlWriter;
       friend class SCMOStreamer;
 }; };
  
 inline void SCMOInstance::_getPropertyAt( inline void SCMOInstance::_getPropertyAt(


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2