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

Diff for /pegasus/src/Pegasus/Common/Sharable.h between version 1.12 and 1.17

version 1.12, 2003/06/12 17:32:10 version 1.17, 2005/10/24 19:35:25
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // The Open Group, Tivoli Systems  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
   // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 54 
Line 60 
     Sharable() : _ref(1) { }     Sharable() : _ref(1) { }
  
     virtual ~Sharable();     virtual ~Sharable();
     Uint32 getRef() const { return _ref.value(); }      Uint32 getRef() const { return _ref.get(); }
  
     friend void Inc(Sharable* sharable);     friend void Inc(Sharable* sharable);
  
Line 63 
Line 69 
 private: private:
     Sharable(const Sharable &s) : _ref(1) {assert(0);}     Sharable(const Sharable &s) : _ref(1) {assert(0);}
     // we should never copy a counter, so we make this private - dte     // we should never copy a counter, so we make this private - dte
   
         AtomicInt _ref;         AtomicInt _ref;
 }; };
  
Line 75 
Line 80 
       // If so, there is a double delete being cause by impropoer use       // If so, there is a double delete being cause by impropoer use
       // of sharable assignment or copy constructors somewhere       // of sharable assignment or copy constructors somewhere
       // << Wed Nov  6 12:46:52 2002 mdd >>       // << Wed Nov  6 12:46:52 2002 mdd >>
       assert(((Sharable*)x)->_ref.value());        assert(((Sharable*)x)->_ref.get());
       x->_ref++;       x->_ref++;
     }     }
  
Line 84 
Line 89 
  
 inline void Dec(Sharable* x) inline void Dec(Sharable* x)
 { {
   if (x && x->_ref.DecAndTestIfZero())    if (x && x->_ref.decAndTestIfZero())
     delete x;     delete x;
 } }
  


Legend:
Removed from v.1.12  
changed lines
  Added in v.1.17

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2