Globally rename UUID to FingerPrint

This commit is contained in:
alex85k
2014-06-04 20:35:00 +06:00
committed by Dennis Luxen
parent 11459d38d0
commit 7335e0809a
13 changed files with 69 additions and 69 deletions
+9 -9
View File
@@ -25,7 +25,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "UUID.h"
#include "FingerPrint.h"
#include "OSRMException.h"
@@ -44,7 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#cmakedefine MD5GRAPH "${MD5GRAPH}"
#cmakedefine MD5OBJECTS "${MD5OBJECTS}"
UUID::UUID() : magic_number(1297240911)
FingerPrint::FingerPrint() : magic_number(1297240911)
{
md5_prepare[32] = md5_tree[32] = md5_graph[32] = md5_objects[32] = '\0';
@@ -65,13 +65,13 @@ UUID::UUID() : magic_number(1297240911)
has_64_bits = HAS64BITS;
}
UUID::~UUID() {}
FingerPrint::~FingerPrint() {}
const boost::uuids::uuid &UUID::GetUUID() const { return named_uuid; }
const boost::uuids::uuid &FingerPrint::GetFingerPrint() const { return named_uuid; }
bool UUID::IsMagicNumberOK() const { return 1297240911 == magic_number; }
bool FingerPrint::IsMagicNumberOK() const { return 1297240911 == magic_number; }
bool UUID::TestGraphUtil(const UUID &other) const
bool FingerPrint::TestGraphUtil(const FingerPrint &other) const
{
if (!other.IsMagicNumberOK())
{
@@ -80,7 +80,7 @@ bool UUID::TestGraphUtil(const UUID &other) const
return std::equal(md5_graph, md5_graph + 32, other.md5_graph);
}
bool UUID::TestPrepare(const UUID &other) const
bool FingerPrint::TestPrepare(const FingerPrint &other) const
{
if (!other.IsMagicNumberOK())
{
@@ -89,7 +89,7 @@ bool UUID::TestPrepare(const UUID &other) const
return std::equal(md5_prepare, md5_prepare + 32, other.md5_prepare);
}
bool UUID::TestRTree(const UUID &other) const
bool FingerPrint::TestRTree(const FingerPrint &other) const
{
if (!other.IsMagicNumberOK())
{
@@ -98,7 +98,7 @@ bool UUID::TestRTree(const UUID &other) const
return std::equal(md5_tree, md5_tree + 32, other.md5_tree);
}
bool UUID::TestQueryObjects(const UUID &other) const
bool FingerPrint::TestQueryObjects(const FingerPrint &other) const
{
if (!other.IsMagicNumberOK())
{
+13 -13
View File
@@ -25,25 +25,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef UUID_H
#define UUID_H
#ifndef FINGERPRINT_H
#define FINGERPRINT_H
#include <boost/uuid/uuid.hpp>
// implements a singleton, i.e. there is one and only one conviguration object
class UUID
class FingerPrint
{
public:
UUID();
UUID(const UUID&) = delete;
~UUID();
const boost::uuids::uuid &GetUUID() const;
FingerPrint();
FingerPrint(const FingerPrint&) = delete;
~FingerPrint();
const boost::uuids::uuid &GetFingerPrint() const;
bool IsMagicNumberOK() const;
bool TestGraphUtil(const UUID &other) const;
bool TestPrepare(const UUID &other) const;
bool TestRTree(const UUID &other) const;
bool TestNodeInfo(const UUID &other) const;
bool TestQueryObjects(const UUID &other) const;
bool TestGraphUtil(const FingerPrint &other) const;
bool TestPrepare(const FingerPrint &other) const;
bool TestRTree(const FingerPrint &other) const;
bool TestNodeInfo(const FingerPrint &other) const;
bool TestQueryObjects(const FingerPrint &other) const;
private:
const unsigned magic_number;
@@ -57,4 +57,4 @@ class UUID
bool has_64_bits;
};
#endif /* UUID_H */
#endif /* FingerPrint_H */
+8 -8
View File
@@ -34,7 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../DataStructures/QueryNode.h"
#include "../DataStructures/Restriction.h"
#include "../Util/SimpleLogger.h"
#include "../Util/UUID.h"
#include "../Util/FingerPrint.h"
#include "../typedefs.h"
#include <boost/assert.hpp>
@@ -60,11 +60,11 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
std::vector<NodeInfo> *int_to_ext_node_id_map,
std::vector<TurnRestriction> &restriction_list)
{
const UUID uuid_orig;
UUID uuid_loaded;
input_stream.read((char *)&uuid_loaded, sizeof(UUID));
const FingerPrint fingerprint_orig;
FingerPrint fingerprint_loaded;
input_stream.read((char *)&fingerprint_loaded, sizeof(FingerPrint));
if (!uuid_loaded.TestGraphUtil(uuid_orig))
if (!fingerprint_loaded.TestGraphUtil(fingerprint_orig))
{
SimpleLogger().Write(logWARNING) << ".osrm was prepared with different build.\n"
"Reprocess to get rid of this warning.";
@@ -285,9 +285,9 @@ unsigned readHSGRFromStream(const boost::filesystem::path &hsgr_file,
boost::filesystem::ifstream hsgr_input_stream(hsgr_file, std::ios::binary);
UUID uuid_loaded, uuid_orig;
hsgr_input_stream.read((char *)&uuid_loaded, sizeof(UUID));
if (!uuid_loaded.TestGraphUtil(uuid_orig))
FingerPrint fingerprint_loaded, fingerprint_orig;
hsgr_input_stream.read((char *)&fingerprint_loaded, sizeof(FingerPrint));
if (!fingerprint_loaded.TestGraphUtil(fingerprint_orig))
{
SimpleLogger().Write(logWARNING) << ".hsgr was prepared with different build.\n"
"Reprocess to get rid of this warning.";