00001 #ifndef ARTDAQ_CORE_TEST_CORE_SHAREDMEMORYTESTSHIMS_HH
00002 #define ARTDAQ_CORE_TEST_CORE_SHAREDMEMORYTESTSHIMS_HH
00003
00004 #include <random>
00005 #include "artdaq-core/Utilities/TimeUtils.hh"
00006
00007 inline unsigned GetRandomKey(uint16_t identifier)
00008 {
00009 static std::mt19937 rng(artdaq::TimeUtils::gettimeofday_us());
00010 static std::uniform_int_distribution<unsigned> gen(0x00000000, 0x0000FFFF);
00011 return gen(rng) + (identifier << 16) + getpid();
00012 }
00013
00014 #endif