[mmap] partial revert of 8cef8db4 to disable using mmap file reader
[videoplayer.git] / stats.h
blob82a8bf1cf565c93006c859278d076f78aec44718
1 #ifndef STATS_H_
2 #define STATS_H_
4 #include <map>
5 #include <string>
7 class Stats {
8 public:
10 //each section of the player has some stats
11 typedef std::map<std::string, std::string> inner_t;
13 //there are potentially many sections
14 typedef std::map<std::string, inner_t*> section_t;
16 void addStat(const std::string &section_name, const std::string &stat_name, const std::string &stat_value);
17 section_t::const_iterator get_section_begin();
18 section_t::const_iterator get_section_end();
20 //singleton access and construction
21 static Stats &getInstance() {
22 if(_instance == 0)
23 _instance = new Stats();
25 return *_instance;
28 protected:
29 Stats();
31 private:
33 //singleton pointer
34 static Stats* _instance;
36 section_t sections;
39 #endif /*STATS_H_*/