mirror of
https://github.com/wolfpld/tracy.git
synced 2026-07-12 00:58:50 +00:00
Sometimes a stray whitespace may be inserted in the address field, for example when copying and pasting from somewhere else.
33 lines
728 B
C++
33 lines
728 B
C++
#ifndef __CONNECTIONHISTORY_HPP__
|
|
#define __CONNECTIONHISTORY_HPP__
|
|
|
|
#include <stdint.h>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
class ConnectionHistory
|
|
{
|
|
public:
|
|
ConnectionHistory();
|
|
~ConnectionHistory();
|
|
|
|
const std::string& Name( size_t idx ) const { return m_connHistVec[idx]->first; }
|
|
|
|
void Count( const std::string& name );
|
|
void Erase( size_t idx );
|
|
|
|
bool empty() const { return m_connHistVec.empty(); }
|
|
size_t size() const { return m_connHistVec.size(); }
|
|
|
|
private:
|
|
void Rebuild();
|
|
|
|
std::string m_fn;
|
|
|
|
std::unordered_map<std::string, uint64_t> m_connHistMap;
|
|
std::vector<std::unordered_map<std::string, uint64_t>::const_iterator> m_connHistVec;
|
|
};
|
|
|
|
#endif
|