2015-01-27 11:44:46 -05:00
|
|
|
#ifndef FINGERPRINT_H
|
|
|
|
#define FINGERPRINT_H
|
|
|
|
|
|
|
|
#include <boost/uuid/uuid.hpp>
|
2015-06-19 11:48:27 -04:00
|
|
|
#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;
|
2016-01-07 13:19:55 -05:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2015-06-19 11:48:27 -04:00
|
|
|
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 */
|