/* * PostProcessingRegistry.cc * * Created on: 27 sept. 2013 * Author: CS */ #include "PostProcessingRegistry.hh" namespace postprocessing { PostProcessingRegistry PostProcessingRegistry::_Instance; // std::unique_ptr PostProcessingRegistry::_instance = // nullptr; // std::once_flag PostProcessingRegistry::_instanceOnceFlag; PostProcessingRegistry::PostProcessingRegistry() { } PostProcessingRegistry::~PostProcessingRegistry() { std::map::const_iterator itr; for (itr = getPostProcessingMap().begin(); itr != getPostProcessingMap().end(); ++itr) { delete (*itr).second; } } std::string PostProcessingRegistry::addElement(const std::string& pkey, PostProcessing* pp) { // register if not already in if (getPostProcessingMap().find(pkey) == getPostProcessingMap().end()) { getPostProcessingMap().insert(std::pair(pkey, pp)); } return pkey; } } /* namespace postprocessing */