PanelPlotNodeRegistry.cc 1.3 KB
/*
 * PanelPlotNodeRegistry.cc
 *
 *  Created on: Dec 6, 2013
 *      Author: amdadev
 */
#ifndef PANELPLOTNODETREGISTRY_CC_
#define PANELPLOTNODETREGISTRY_CC_

#include "PanelPlotNodeRegistry.hh"

namespace plot {


PanelPlotNodeRegistry PanelPlotNodeRegistry::_Instance;

PanelPlotNodeRegistry::PanelPlotNodeRegistry() {
}

PanelPlotNodeRegistry::~PanelPlotNodeRegistry() {
	// Nothing to do there since we use shared_ptr (hope so)...
}
/**
 * Registers a post-processing.
 */
std::string PanelPlotNodeRegistry::addElement(const std::string& pkey_, boost::shared_ptr<AbstractPanelPlotNode> pp_){
	// register if not already in
	if (getRegistry().find(pkey_) == getRegistry().end()) {
		getRegistry().insert(std::pair<const std::string,
		             boost::shared_ptr<AbstractPanelPlotNode>>(pkey_, pp_));
	}
	return pkey_;
}

/**
 * Registers a plot configuration node.
 */
std::string PanelPlotNodeRegistry::addConfigElement(const std::string& pKey_, boost::shared_ptr<AbstractPlotConfigNode> confNode_){
	// register if not already in
	if (getConfigRegistry().find(pKey_) == getConfigRegistry().end()) {
		getConfigRegistry().insert(std::pair<const std::string,
		             boost::shared_ptr<AbstractPlotConfigNode>>(pKey_, confNode_));
	}
	return pKey_;
}

} /* namespace plot */


#endif /* PANELPLOTNODETREGISTRY_CC_ */