X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkFactory.h;h=3150e6ea3fbdcb0d86376372cb6376ead1e78235;hb=302e341409d918a232cd2ec25f2c533c27eb9011;hp=a4f84e73f6f7d0c015484d8e1f05f0c28e7cdc44;hpb=76f2826fd6b67d3a15fe72c1b50d5ee1af1960a1;p=bbtk.git diff --git a/kernel/src/bbtkFactory.h b/kernel/src/bbtkFactory.h index a4f84e7..3150e6e 100644 --- a/kernel/src/bbtkFactory.h +++ b/kernel/src/bbtkFactory.h @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkFactory.h,v $ Language: C++ - Date: $Date: 2008/02/14 11:38:58 $ - Version: $Revision: 1.6 $ + Date: $Date: 2008/03/28 13:42:17 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See doc/license.txt or @@ -35,6 +35,9 @@ namespace bbtk { + + class Executer; + class BBTK_EXPORT Factory { @@ -42,10 +45,8 @@ namespace bbtk Factory(); ~Factory(); - - void LoadPackage( const std::string& name, - bool use_configuration_file = true, - bool verbose = false ); + + void LoadPackage( const std::string& name ); void UnLoadPackage( const std::string& name ); void PrintPackages(bool details = true, bool adaptors = false) const; void HelpPackage(const std::string& name, bool adaptors = false) const; @@ -78,18 +79,27 @@ namespace bbtk { Packages, Categories, - Initials + Initials, + Adaptors } IndexEntryType; void CreateHtmlIndex(IndexEntryType type, const std::string& filename); + /// Sets the executer who created the factory (if any) + void SetExecuter(Executer *e) { mExecuter = e; } + /// Gets the executer who created the factory (if any) + Executer* GetExecuter() { return mExecuter; } + /// Gets the executer who created the factory (if any) - const + const Executer* GetExecuter() const { return mExecuter; } + + private: bool DoLoadPackage(std::string libname, std::string pkgname, - std::string path, - bool v); + std::string path); + public: /// The structure storing info on a package class PackageInfoType { @@ -105,9 +115,16 @@ namespace bbtk }; /// The type of map of packages typedef std::map< std::string, PackageInfoType > PackageMapType; + + const PackageMapType& GetPackageMap() const { return mPackageMap; } + + private: /// The map of packages PackageMapType mPackageMap; + /// The executer which created the factory (if any) + Executer* mExecuter; + void CloseAllPackages(); void ClosePackage(PackageMapType::iterator& i); @@ -115,6 +132,8 @@ namespace bbtk // class Factory + + /* /// SYSTEM METHOD : Global method returning the global factory object pointer inline Factory*& GlobalFactoryPointer() { @@ -141,10 +160,9 @@ namespace bbtk } } - inline void LoadPackage( const std::string& name, - bool use_configuration_file = true, bool verbose = false ) + inline void LoadPackage( const std::string& name ) { - GetGlobalFactory()->LoadPackage(name,use_configuration_file, verbose); + GetGlobalFactory()->LoadPackage(name); } inline void UnLoadPackage( const std::string& name ) @@ -221,7 +239,7 @@ namespace bbtk { GetGlobalFactory()->WriteDotFilePackagesList(ff); } - + */ }// namespace bbtk