X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmRefCounter.h;h=25ecce970a16e4be7459acea78ed082eb4c54042;hb=b06cbd9177331d793223eac6bf8b2bccf874e7e3;hp=ee664d794356a8b88a27eaadce9443c161cf57cb;hpb=de5a59bb6350f6effe5638a24bb2c58e238d9d3f;p=gdcm.git diff --git a/src/gdcmRefCounter.h b/src/gdcmRefCounter.h index ee664d79..25ecce97 100644 --- a/src/gdcmRefCounter.h +++ b/src/gdcmRefCounter.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmRefCounter.h,v $ Language: C++ - Date: $Date: 2005/10/23 15:06:34 $ - Version: $Revision: 1.7 $ + Date: $Date: 2007/08/22 16:14:04 $ + Version: $Revision: 1.12 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -16,13 +16,14 @@ =========================================================================*/ -#ifndef GDCMREFCOUNTER_H -#define GDCMREFCOUNTER_H +#ifndef _GDCMREFCOUNTER_H_ +#define _GDCMREFCOUNTER_H_ #include "gdcmBase.h" -#include "gdcmDebug.h" +//#include "gdcmDebug.h" +#include -namespace gdcm +namespace GDCM_NAME_SPACE { //----------------------------------------------------------------------------- /** @@ -37,33 +38,27 @@ public: // Allocator / Unallocator /// \brief Delete the object /// \remarks The object is deleted only if its reference counting is to zero - inline void Delete(void) - { - Unregister(); - } + void Delete() { Unregister(); } // Reference count /// \brief Register the object /// \remarks It increments the reference counting - inline void Register(void) - { - RefCount++; - } + void Register() { RefCount++; } + /// \brief Unregister the object /// \remarks It decrements the reference counting - inline void Unregister(void) + void Unregister() { +//std::cout <<"================Unreg " << typeid(*this).name() << std::endl; RefCount--; - if(RefCount==0) - { - delete this; - } + if(RefCount<=0) + delete this; } /// \brief Get the reference counting /// \return Reference count - inline const unsigned long &GetRefCount(void) const + const unsigned long &GetRefCount() const { - return(RefCount); + return RefCount; } protected: