diff --git a/AMDiS/src/CreatorMap.cc b/AMDiS/src/CreatorMap.cc index 0dd14deafd0344a2788151c541d09fefc10f3e87..42eb703f3f2841c005dcee47473d3e9a8e400689 100644 --- a/AMDiS/src/CreatorMap.cc +++ b/AMDiS/src/CreatorMap.cc @@ -50,18 +50,15 @@ namespace AMDiS { creator = NEW DiagonalPreconditioner::Creator; addCreator("diag", creator); - creator = NEW IdentityPreconditioner::Creator; - addCreator("no", creator); - creator = NEW ILUPreconditioner::Creator; addCreator("ilu", creator); creator = NEW ICPreconditioner::Creator; addCreator("ic", creator); - } - - + creator = NEW IdentityPreconditioner::Creator; + addCreator("no", creator); + } #if 0 template<> diff --git a/AMDiS/src/CreatorMap.h b/AMDiS/src/CreatorMap.h index d56e7da5996064941d572376b5cab56f406e37d6..a5c6ac1117ce8a34b23dff3127edaec0944b4c1c 100644 --- a/AMDiS/src/CreatorMap.h +++ b/AMDiS/src/CreatorMap.h @@ -42,9 +42,7 @@ namespace AMDiS { class CreatorMap { public: - /** \brief - * Adds a new creator together with the given key to the map. - */ + /// Adds a new creator together with the given key to the map. static void addCreator(std::string key, CreatorInterface<BaseClass>* creator) { FUNCNAME("CreatorMap::addCreator()"); @@ -54,9 +52,7 @@ namespace AMDiS { creatorMap[key] = creator; } - /** \brief - * Creates a object of the type corresponding to key. - */ + /// Creates a object of the type corresponding to key. static CreatorInterface<BaseClass>* getCreator(std::string key) { FUNCNAME("CreatorMap::getCreator()"); init(); @@ -69,24 +65,19 @@ namespace AMDiS { static void addDefaultCreators(); - protected: - /** \brief - * Constructor is protected because derived maps should be singleton. - */ - static void init() { - if(!initialized) { - initialized = true; - NullCreator<BaseClass> *nullCreator = new NullCreator<BaseClass>; - // addCreator("no", nullCreator); - addCreator("0", nullCreator); - addDefaultCreators(); - } - }; + protected: + /// Constructor is protected because derived maps should be singleton. + static void init() { + if (!initialized) { + initialized = true; + NullCreator<BaseClass> *nullCreator = new NullCreator<BaseClass>; + addCreator("0", nullCreator); + addDefaultCreators(); + } + } protected: - /** \brief - * STL map containing the pairs of keys and creators. - */ + /// STL map containing the pairs of keys and creators. static std::map< std::string, CreatorInterface<BaseClass>* > creatorMap; static bool initialized; diff --git a/AMDiS/src/CreatorMap.hh b/AMDiS/src/CreatorMap.hh index b82231017634d1bbcc3c1c17aeaf38041e094264..8fb6dd2569a38bb4ab9b2b4da4a16a36d5ee1165 100644 --- a/AMDiS/src/CreatorMap.hh +++ b/AMDiS/src/CreatorMap.hh @@ -8,11 +8,7 @@ namespace AMDiS { { typename std::map< std::string, CreatorInterface<BaseClass>* >::iterator it; - for (it = creatorMap.begin(); - it != creatorMap.end(); - ++it) { + for (it = creatorMap.begin(); it != creatorMap.end(); ++it) DELETE it->second; - } } - }