Blame view

src/ParamOutputImpl/Plot/PanelPlotNodeRegistry.cc 1.3 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * 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_ */