19 #include <type_traits>
26 uint64_t
pack(
const uint32_t& v1,
const uint32_t& v2) {
32 pair<uint32_t, uint32_t>
unpack(
const uint64_t& v) {
33 return { v>>32, v & 0x00000000ffffffff };
36 template <class T, typename enable_if<is_pointer<T>::value>::type* =
nullptr>
38 return reinterpret_cast<uintptr_t
>(v);
41 template <class T, typename enable_if<is_integral<T>::value>::type* =
nullptr>
43 return static_cast<uintptr_t
>(v);
47 uintptr_t elementWiseHash(
const C& v) {
49 for (
typename C::const_iterator it = v.cbegin(); it != v.cend(); ++it)
56 uintptr_t orderWiseHash(
const C& v) {
57 uintptr_t hash = 1ul, i = 1;
58 constexpr uintptr_t R = 3144134277;
59 for (
typename C::const_iterator it = v.cbegin(); it != v.cend(); ++it, ++i) {
60 uintptr_t h = cast(*it);
71 inline uint64_t
hashOW(
const T& v) {
72 return orderWiseHash(v);
76 inline uintptr_t
hashEW(
const T& v) {
77 return elementWiseHash(v);
80 template uint64_t hashOW<vector<uint32_t>>(
const vector<uint32_t>&);
81 template uint64_t hashOW<vector<StaticActivity*>>(
const vector<StaticActivity*>&);
82 template uintptr_t hashEW<vector<Location*>>(
const vector<Location*>&);
83 template uintptr_t hashEW<set<Location*>>(
const set<Location*>&);
87 ifstream in(pathToFile.c_str());
bool fileExists(const std::string &pathToFile)
It checks the existence of the file.
Various auxiliary functions used across the program.
uint64_t hashOW(const C &v)
It calculates a hash of the container, the order of elements influences (Order Wise) the hash value...
uintptr_t hashEW(const C &v)
It calculates a hash of the container, the order of elements does not influence (Element Wise) the ha...
std::pair< uint32_t, uint32_t > unpack(const uint64_t &v)
It unpacks two uint32_t numbers from uint64_t data type.
uint64_t pack(const uint32_t &v1, const uint32_t &v2)
It packs two uint32_t numbers to uint64_t data type.
The file contains various classes devoted to abstract representation of the robotic cell...