IChecksum.cc 743 Bytes
Newer Older
1

2
3
#ifdef TEST_ON

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "IChecksum.hh"

#include <boost/filesystem.hpp>

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

namespace Test {
namespace Checksum {

namespace {

Registry& registry_modify()
{
20
21
  static Registry chksm_reg;
  return chksm_reg;
22
23
24
25
26
27
28
29
30
31
32
33
}

}//namespace

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

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

34
IChecksum::IChecksum(const char * _name) : name_(_name)
35
{
36
  auto pos = registry_modify().emplace(_name, this);
37
38
  if (!pos.second)
  {
39
    std::cout << "Duplicate checksum definition: " << _name << std::endl;
40
41
42
43
44
    throw;
  }
}

}//Checksum
45
46
47
}//namespace Test

#endif//TEST_ON