IChecksum.cc 797 Bytes
Newer Older
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
35
36
37
38
39
40
41
42
43
44
45

#include "IChecksum.hh"

#include <boost/filesystem.hpp>

#include <array>
#include <functional>
#include <iostream>
#include <tuple>
#include <vector>

namespace Test {
namespace Checksum {

namespace {

Registry& registry_modify()
{
  static Registry chksum_reg;
  return chksum_reg;
}

}//namespace

const Registry& registry()
{
  return registry_modify();
}

///////////////////////////////////////////////////////////////////////////////
// class Checksum implementation

IChecksum::IChecksum(unsigned _order, const char * _name) : name_(_name)
{
  auto pos = registry_modify().emplace(Key(_order, _name), this);
  if (!pos.second)
  {
    std::cout << "Duplicate checksum definition: "
      << _name << "with order " << _order << std::endl;;
    throw;
  }
}

}//Checksum
}//namespace Test