ATLAS Offline Software
Classes | Typedefs | Functions
CxxUtils::detail Namespace Reference

Portable implementations. More...

Classes

struct  CHMTableIterator
 Helper to generate hash probes. More...
 
class  ConcurrentHashmapImpl
 Hash table allowing concurrent, lockless reads. More...
 
class  HashmapLock
 Helper to allow for external locking with put(). More...
 
struct  SizedUInt
 
struct  SizedUInt< 1 >
 
struct  SizedUInt< 2 >
 
struct  SizedUInt< 4 >
 
struct  SizedUInt< 8 >
 
union  UIntConv
 Helpers for converting between uintptr_t and a pointer or integer. More...
 
union  UIntConv< uintptr_t >
 

Typedefs

using ConcurrentHashmapVal_t = uintptr_t
 Type used for keys and values — an unsigned big enough to hold a pointer. More...
 

Functions

template<typename T >
constexpr unsigned ctz_portable (T x)
 
template<typename T >
constexpr unsigned clz_portable (T x)
 
template<typename T >
constexpr unsigned popcount_portable (T x)
 

Detailed Description

Portable implementations.

These could be replaced by faster algorithms if needed

Typedef Documentation

◆ ConcurrentHashmapVal_t

using CxxUtils::detail::ConcurrentHashmapVal_t = typedef uintptr_t

Type used for keys and values — an unsigned big enough to hold a pointer.

Need to have this defined outside of ConcurrentHashmapImpl itself in order to avoid instantiation circularities, as the HASHER_ and MATCHER_ classes will probably want to use it.

Definition at line 41 of file ConcurrentHashmapImpl.h.

Function Documentation

◆ clz_portable()

template<typename T >
constexpr unsigned CxxUtils::detail::clz_portable ( x)
inlineconstexpr

Definition at line 45 of file bitscan.h.

45  {
46  static_assert(std::is_integral<T>::value, "An integer type is required.");
47  if (x==0) return sizeof(T)*8;
48  unsigned n(0);
49  T msb = static_cast<T>(1) << (sizeof(T)*8-1);
50  for (n = 0; (x & msb) == 0; ++n, x <<= 1);
51  return n;
52  }

◆ ctz_portable()

template<typename T >
constexpr unsigned CxxUtils::detail::ctz_portable ( x)
inlineconstexpr

Definition at line 35 of file bitscan.h.

35  {
36  static_assert(std::is_integral<T>::value, "An integer type is required.");
37  unsigned n(0);
38  if (x!=0) {
39  for (;(x & 0x1) == 0; ++n, x >>= 1);
40  }
41  return n;
42  }

◆ popcount_portable()

template<typename T >
constexpr unsigned CxxUtils::detail::popcount_portable ( x)
inlineconstexpr

Definition at line 55 of file bitscan.h.

55  {
56  static_assert(std::is_integral<T>::value, "An integer type is required.");
57  unsigned n = 0;
58  while (x != 0) {
59  n += (x&1);
60  x >>= 1;
61  }
62  return n;
63  }
athena.value
value
Definition: athena.py:122
x
#define x
beamspotman.n
n
Definition: beamspotman.py:731
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35