Program: bbtk
Module: $RCSfile: bbtkPackage.h,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:15 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2008/05/21 12:50:11 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
return NAME ## GetPackagePointer(); \
} \
BBTK_PACKAGE_EXPORT const std::string& \
- BBTK_CDECL NAME ## GetPackageBBTKVersion () \
+ BBTK_CDECL NAME ## GetPackageBBTKVersion () \
{ return bbtk::GetVersion(); } \
+ class NAME ## PackageAutodestructor \
+ { \
+ public: \
+ NAME ## PackageAutodestructor() {} \
+ ~NAME ## PackageAutodestructor() \
+ { \
+ if (NAME ## GetPackagePointer().use_count()>0) \
+ { \
+ bbtk::Package::WeakPointer p = NAME ## GetPackagePointer(); \
+ bbtk::Package::Release(p); \
+ } \
+ } \
+ }; \
+ NAME ## PackageAutodestructor NAME ## PackageAutodestructorInstance; \
}
//====================================================================