X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkObject.h;h=2d8eb5e91c022e022ac322dc1f8e0943238d3690;hb=9d5a41aa77e7749118fc4885f7b26ea25bd90629;hp=21109d3405794c2d8057aac9562c7b91e4491516;hpb=4ad5b5ee44357ad873bc8c43230defb6d0a79879;p=bbtk.git diff --git a/kernel/src/bbtkObject.h b/kernel/src/bbtkObject.h index 21109d3..2d8eb5e 100644 --- a/kernel/src/bbtkObject.h +++ b/kernel/src/bbtkObject.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkObject.h,v $ Language: C++ - Date: $Date: 2008/04/18 12:59:15 $ - Version: $Revision: 1.1 $ + Date: $Date: 2008/07/24 14:37:05 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -24,6 +24,7 @@ #ifndef __bbtkObject_h__ #define __bbtkObject_h__ +#include #include #include #include @@ -32,7 +33,7 @@ namespace bbtk { // The top class of bbtk class hierarchy - class Object + class BBTK_EXPORT Object { public: typedef boost::shared_ptr Pointer; @@ -51,13 +52,20 @@ namespace bbtk static void InsertInObjectList(Pointer); static void RemoveFromObjectList(WeakPointer); - static void PrintObjectListInfo(); - static void PrintObjectInfo(const std::string& name); + static void InsertInPackageList(Pointer); + static void ReleasePackages(); + + static void PrintObjectListInfo(const std::string& name); + // static void PrintObjectInfo(const std::string& name); static void PrintObjectInfo(const Pointer& o); + + static long GetObjectsCount() { return mgObjectList.size(); } + /// Default objects deleter : removes object from list on deletion - struct Deleter + struct BBTK_EXPORT Deleter { Deleter() : mPointer() {} + virtual ~Deleter() {} virtual void operator() (Object* p); virtual void Delete(Object* p) { delete p; } WeakPointer mPointer; @@ -115,6 +123,7 @@ namespace bbtk private: typedef std::set > ObjectListType; static ObjectListType mgObjectList; + static ObjectListType mgPackageList; WeakPointer mThisPointer; Pointer mThisPointerLocked; @@ -156,6 +165,15 @@ protected: \ CLASS(const CLASS&); \ ~CLASS(); +#define BBTK_OBJECT_INTERFACE_NO_CONDES(CLASS) \ + BBTK_OBJECT_MINIMAL_INTERFACE_WITH_SELF(CLASS); \ +public: \ + std::string GetObjectName() const; \ + std::string GetObjectInfo() const ; \ + size_t GetObjectSize() const ; \ + size_t GetObjectInternalSize() const ; \ + size_t GetObjectRecursiveSize() const ; + #define BBTK_ABSTRACT_OBJECT_INTERFACE(CLASS) \ public : typedef CLASS Self; \ BBTK_OBJECT_MINIMAL_INTERFACE; \ @@ -167,15 +185,16 @@ protected: \ //======================================================================= // A struct with one static instance // just to print object list info after main - struct StaticInitTime + class BBTK_EXPORT StaticInitTime { + public: StaticInitTime(); ~StaticInitTime(); static bool PrintObjectListInfo; private: - static Object mObject; + static bbtk::Object mObject; };