factory.h revision 0be6be10c9c4907e285650d7a67f78630c258731
/** @file
* Generic Factory
*//*
* Authors:
* Markus Engel
*
* Copyright (C) 2013 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef FACTORY_H_SEEN
#define FACTORY_H_SEEN
#include <exception>
#include <map>
#include <string>
/**
* A simple singleton implementation.
*/
struct Singleton {
static T &instance() {
static T inst;
return inst;
}
};
, _type_string(type) {
}
}
return _type_string.c_str();
}
};
} // namespace FactoryExceptions
/**
* A Factory for creating objects which can be identified by strings.
*/
typedef BaseObject *CreateFunction();
}
typename std::map<std::string const, CreateFunction *>::const_iterator it = this->_object_map.find(id);
}
}
};
struct NodeTraits {
name = "string";
break;
if (sptype) {
} else {
}
break;
}
default:
name = "";
break;
}
return name;
}
};
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :