fpmas 1.6
id.h
Go to the documentation of this file.
1#ifndef FPMAS_ID_API_H
2#define FPMAS_ID_API_H
3
8#include <functional>
9#include <string>
10
11namespace fpmas { namespace api { namespace graph {
12
16 template<typename IdImpl>
17 class Id {
18 public:
27 virtual IdImpl& operator++() = 0;
28
35 virtual bool operator==(const IdImpl& id) const = 0;
36
42 virtual std::size_t hash() const = 0;
43
47 virtual operator std::string() const = 0;
48
49 virtual ~Id() {}
50 };
51
57 template<typename IdImpl>
58 struct IdHash {
67 std::size_t operator()(const IdImpl& id) const {
68 return id.hash();
69 }
70 };
71}}}
72#endif
Definition: id.h:17
virtual std::size_t hash() const =0
virtual bool operator==(const IdImpl &id) const =0
virtual IdImpl & operator++()=0
Definition: fpmas.cpp:3
Definition: id.h:58
std::size_t operator()(const IdImpl &id) const
Definition: id.h:67