Looses

Macros

Line Code
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
#ifndef LOOSES_H
#define LOOSES_H

//C++ headers
#include <string>
#include <map>
#include <vector>

class Looses {
public:
  ///Constructor is not public (only one instance needed)
  static Looses* instance();

  ///Virtual destructor (empty)
  virtual ~Looses();

  ///Counting
  void count(const std::string& name, unsigned cut);

  ///Printing
  void summary();

private:
  // The constructor is hidden as we do not want to construct
  // more than one instance.
  Looses();

  // The instance
  static Looses* myself;

  // The table of losses
  std::map<std::string, std::vector<unsigned> > theLosses;
};
#endif