1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 #ifndef CMAJOR_BINDER_UUID_REPOSITORY_INCLUDED
 7 #define CMAJOR_BINDER_UUID_REPOSITORY_INCLUDED
 8 #include <soulng/util/Error.hpp>
 9 #include <boost/uuid/uuid.hpp>
10 #include <boost/functional/hash.hpp>
11 #include <unordered_map>
12 #include <vector>
13 
14 namespace cmajor { namespace binder {
15 
16 class UuidRepository 
17 {
18 public:
19     int Install(const boost::uuids::uuid& uuid);
20     const boost::uuids::uuid& GetUuid(int id) const;
21 private:
22     std::unordered_map<boost::uuids::uuidintboost::boost::hash<boost::uuids::uuid>>uuidMap;
23     std::vector<boost::uuids::uuid> uuids;
24 };
25 
26 } } // namespace cmajor::binder
27 
28 #endif // CMAJOR_BINDER_UUID_REPOSITORY_INCLUDED