/* * PanelPlotNodeRegistry.hh * * Created on: Dec 6, 2013 * Author: amdadev */ #ifndef PANELPLOTNODETREGISTRY_HH_ #define PANELPLOTNODETREGISTRY_HH_ #include #include #include #include #include "AbstractPanelPlotNode.hh" #include "AbstractPlotConfigNode.hh" namespace plot { class PanelPlotNodeRegistry { public: /** * singleton creation */ static PanelPlotNodeRegistry& getInstance(){ return _Instance; } virtual ~PanelPlotNodeRegistry(); /** * Registers a post-processing. */ std::string addElement(const std::string&, boost::shared_ptr); /** * Gets all registered post-processing. */ std::map> getAllElements() { return getRegistry(); } /** * Registers a plot config node. */ std::string addConfigElement(const std::string&, boost::shared_ptr); /** * Gets all registered post-processing. */ std::map> getConfigurationNodes() { return getConfigRegistry(); } protected: /** * Access the plot-panel registry and guaranty it is created at the first access. */ static std::map>& getRegistry() { // static local field is created once and returned each time function is called.(C++ strange behavior !!! ) static std::map> _panelPlotOutputMap = std::map>(); return _panelPlotOutputMap; } /** * Access the default plot configuration registry and guaranty it is created at the first access. */ static std::map>& getConfigRegistry() { // static local field is created once and returned each time function is called. static std::map> _defaultPlotConfigNodeMap = std::map>(); return _defaultPlotConfigNodeMap; } private: /** * instance can only created using getInstance() method. */ PanelPlotNodeRegistry(); /** * Singleton unique instance */ static PanelPlotNodeRegistry _Instance; }; } /* namespace plot */ #endif /* PANELPLOTNODETREGISTRY_HH_ */