Commit e5d797df authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Only small modifications.

parent 6ad371c1
......@@ -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<>
......
......@@ -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;
......
......@@ -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;
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment