osrm-backend/include/util/fingerprint.hpp

41 lines
1.0 KiB
C++
Raw Normal View History

2015-01-27 11:44:46 -05:00
#ifndef FINGERPRINT_H
#define FINGERPRINT_H
#include <boost/uuid/uuid.hpp>
#include <type_traits>
2015-01-27 11:44:46 -05:00
2016-01-05 10:51:13 -05:00
namespace osrm
{
namespace util
{
2015-01-27 11:44:46 -05:00
// implements a singleton, i.e. there is one and only one conviguration object
class FingerPrint
{
public:
2015-06-18 12:34:25 -04:00
static FingerPrint GetValid();
2015-01-27 11:44:46 -05:00
const boost::uuids::uuid &GetFingerPrint() const;
2015-06-18 12:34:25 -04:00
bool IsMagicNumberOK(const FingerPrint &other) const;
2015-01-27 11:44:46 -05:00
bool TestGraphUtil(const FingerPrint &other) const;
bool TestContractor(const FingerPrint &other) const;
2015-01-27 11:44:46 -05:00
bool TestRTree(const FingerPrint &other) const;
bool TestQueryObjects(const FingerPrint &other) const;
private:
2015-06-18 12:34:25 -04:00
unsigned magic_number;
2015-01-27 11:44:46 -05:00
char md5_prepare[33];
char md5_tree[33];
char md5_graph[33];
char md5_objects[33];
// initialize to {6ba7b810-9dad-11d1-80b4-00c04fd430c8}
boost::uuids::uuid named_uuid;
};
2016-10-17 19:32:52 -04:00
static_assert(sizeof(FingerPrint) == 152, "FingerPrint has unexpected size");
static_assert(std::is_trivial<FingerPrint>::value, "FingerPrint needs to be trivial.");
2016-01-05 10:51:13 -05:00
}
}
2015-01-27 11:44:46 -05:00
#endif /* FingerPrint_H */