1
2
3
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::uuid, int, boost::boost::hash<boost::uuids::uuid>>uuidMap;
23 std::vector<boost::uuids::uuid> uuids;
24 };
25
26 } }
27
28 #endif // CMAJOR_BINDER_UUID_REPOSITORY_INCLUDED