File NPCounter.cxx
File List > core > NPCounter.cxx
Go to the documentation of this file
#include "NPCounter.h"
using namespace nptool;
std::shared_ptr<uint64_t> Counter::CreateCounter(std::string token, std::string name, std::string unit) {
if (m_counter.find(token) != m_counter.end()) {
std::string message = "Counter " + token + " already exists, cannot make duplicate!";
throw nptool::Error("NPCounter", message, "Change name of counter or use GetCounter to get the pointer");
}
m_counter[token] = std::make_shared<uint64_t>(0);
m_name[token] = name;
m_unit[token] = unit;
return m_counter[token];
}