+ typedef std::map<std::string, float> GraphValues;
+
+ void graphAdd(const std::string &id, float value)
+ {
+ JMutexAutoLock lock(m_mutex);
+ std::map<std::string, float>::iterator i =
+ m_graphvalues.find(id);
+ if(i == m_graphvalues.end())
+ m_graphvalues[id] = value;
+ else
+ i->second += value;
+ }
+ void graphGet(GraphValues &result)
+ {
+ JMutexAutoLock lock(m_mutex);
+ result = m_graphvalues;
+ m_graphvalues.clear();
+ }
+
+ void remove(const std::string& name)
+ {
+ JMutexAutoLock lock(m_mutex);
+ m_avgcounts.erase(name);
+ m_data.erase(name);
+ }
+