Added utility function len_from_pid().

This commit is contained in:
Ulrich Germann 2015-07-21 15:32:47 +01:00
parent 80db5487bc
commit 506e02bdec
2 changed files with 9 additions and 0 deletions

View File

@ -36,6 +36,13 @@ namespace ugdiss
return buf.str();
}
size_t
len_from_pid(uint64_t pid)
{
static uint64_t two16 = uint64_t(1)<<16;
return pid%two16;
}
#if 0
template<>
string

View File

@ -26,6 +26,8 @@ namespace ugdiss
typedef boost::dynamic_bitset<uint64_t> bdBitset;
size_t len_from_pid(uint64_t pid);
template<typename sid_t, typename off_t, typename len_t>
void
parse_pid(uint64_t const pid, sid_t & sid,