/* * PostProcessingRegistry.hh * * Created on: 27 sept. 2013 * Author: CS */ #ifndef POSTPROCESSINGREGISTRY_HH_ #define POSTPROCESSINGREGISTRY_HH_ #include #include #include #include #include "PostProcessing.hh" namespace postprocessing { class PostProcessingRegistry { public: /** * Gets singleton instance. */ static PostProcessingRegistry& getInstance() { return _Instance; } virtual ~PostProcessingRegistry(); /** * Registers a post-processing. */ std::string addElement(const std::string& pkey, PostProcessing* pp); /** * Gets all registered post-processing. */ std::map getAllElements() { return getPostProcessingMap(); } protected: /** * Access the post-processing registry and guaranty it is created at the first access. */ static std::map& getPostProcessingMap() { static std::map _postProcessingMap = std::map(); return _postProcessingMap; } private: PostProcessingRegistry(); /** * Singleton unique instance */ //static std::unique_ptr _instance; static PostProcessingRegistry _Instance; /** * Flag to guarantee singleton unicity. */ //static std::once_flag _instanceOnceFlag; }; } /* namespace postprocessing */ #endif /* POSTPROCESSINGREGISTRY_HH_ */