123456789101112131415161718192021222324 |
- #include <Generator.h>
- #include <mutex>
- namespace mdd
- {
- std::map<std::string, std::shared_ptr<IGenerator>>&
- GetGenerators(
- const std::string& name,
- const std::shared_ptr<IGenerator>& generator)
- {
- static std::map<std::string, std::shared_ptr<IGenerator>> gens;
- static std::mutex mutex;
- if (generator != nullptr)
- {
- mutex.lock();
- gens[name] = generator;
- mutex.unlock();
- }
- return gens;
- }
- }
|