Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t Struct Reference

Structure with the index of the counter, split as needed. More...

#include <CountersMap.h>

Public Member Functions

 CounterKey_t ()
 
 CounterKey_t (BlockKey_t major, CounterIndex_t minor)
 Constructor from a pair. More...
 
 CounterKey_t (Key_t key)
 Initialize from a mangled key. More...
 
Key_t Key () const
 Returns the full key. More...
 
 operator Key_t () const
 Conversion of this key into a number (. More...
 
CounterKey_toperator++ ()
 
CounterKey_toperator-- ()
 
CounterKey_toperator++ (int)
 
CounterKey_toperator-- (int)
 
CounterKey_tstart_block ()
 Skips to the beginning of this block. More...
 
CounterKey_tprev_block ()
 Skips to the beginning of the previous block. More...
 
CounterKey_tnext_block ()
 Skips to the beginning of the next block. More...
 

Public Attributes

BlockKey_t block
 key of the counter block More...
 
CounterIndex_t counter
 index of the counter in the block More...
 

Static Public Attributes

static constexpr Key_t MinorKeyRange = NSubcounters
 Number of values of the minor key. More...
 
static constexpr Key_t MinorKeyBits = LowestSetBit(MinorKeyRange)
 Number of bits for the minor key. More...
 
static constexpr Key_t MinorKeyMask = MinorKeyRange - 1
 Bit mask for the minor key. More...
 

Detailed Description

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
struct lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t

Structure with the index of the counter, split as needed.

Definition at line 296 of file CountersMap.h.

Constructor & Destructor Documentation

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::CounterKey_t ( )
inline

Definition at line 301 of file CountersMap.h.

301 : block(0), counter(0) {}
CounterIndex_t counter
index of the counter in the block
Definition: CountersMap.h:298
BlockKey_t block
key of the counter block
Definition: CountersMap.h:297
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::CounterKey_t ( BlockKey_t  major,
CounterIndex_t  minor 
)
inline

Constructor from a pair.

Definition at line 304 of file CountersMap.h.

304  :
305  block(major), counter(minor) {}
CounterIndex_t counter
index of the counter in the block
Definition: CountersMap.h:298
BlockKey_t block
key of the counter block
Definition: CountersMap.h:297
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::CounterKey_t ( Key_t  key)
inline

Initialize from a mangled key.

Definition at line 308 of file CountersMap.h.

308  :
309  // CounterKey_t(key >> MinorKeyBits, key & MinorKeyMask) {}
def key(type, name=None)
Definition: graph.py:13
static constexpr Key_t MinorKeyMask
Bit mask for the minor key.
Definition: CountersMap.h:351

Member Function Documentation

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
Key_t lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::Key ( void  ) const
inline

Returns the full key.

Definition at line 314 of file CountersMap.h.

314 { return block + counter; }
CounterIndex_t counter
index of the counter in the block
Definition: CountersMap.h:298
BlockKey_t block
key of the counter block
Definition: CountersMap.h:297
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterKey_t& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::next_block ( )
inline

Skips to the beginning of the next block.

Definition at line 340 of file CountersMap.h.

341  { block += MinorKeyRange; return start_block(); }
static constexpr Key_t MinorKeyRange
Number of values of the minor key.
Definition: CountersMap.h:345
BlockKey_t block
key of the counter block
Definition: CountersMap.h:297
CounterKey_t & start_block()
Skips to the beginning of this block.
Definition: CountersMap.h:333
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::operator Key_t ( ) const
inline

Conversion of this key into a number (.

See also
Key())

Definition at line 317 of file CountersMap.h.

317 { return Key(); }
Key_t Key() const
Returns the full key.
Definition: CountersMap.h:314
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterKey_t& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::operator++ ( )
inline

Definition at line 320 of file CountersMap.h.

321  { if (++counter == MinorKeyRange) next_block(); return *this; }
CounterIndex_t counter
index of the counter in the block
Definition: CountersMap.h:298
static constexpr Key_t MinorKeyRange
Number of values of the minor key.
Definition: CountersMap.h:345
CounterKey_t & next_block()
Skips to the beginning of the next block.
Definition: CountersMap.h:340
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterKey_t& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::operator++ ( int  )
inline

Definition at line 327 of file CountersMap.h.

328  { CounterKey_t old(*this); this->operator++(); return old; }
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterKey_t& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::operator-- ( )
inline

Definition at line 322 of file CountersMap.h.

323  {
324  if (counter-- == 0) { prev_block(); counter = MinorKeyRange - 1; }
325  return *this;
326  } // operator--()
CounterIndex_t counter
index of the counter in the block
Definition: CountersMap.h:298
static constexpr Key_t MinorKeyRange
Number of values of the minor key.
Definition: CountersMap.h:345
CounterKey_t & prev_block()
Skips to the beginning of the previous block.
Definition: CountersMap.h:336
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterKey_t& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::operator-- ( int  )
inline

Definition at line 329 of file CountersMap.h.

330  { CounterKey_t old(*this); this->operator--(); return old; }
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterKey_t& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::prev_block ( )
inline

Skips to the beginning of the previous block.

Definition at line 336 of file CountersMap.h.

337  { block -= MinorKeyRange; return start_block(); }
static constexpr Key_t MinorKeyRange
Number of values of the minor key.
Definition: CountersMap.h:345
BlockKey_t block
key of the counter block
Definition: CountersMap.h:297
CounterKey_t & start_block()
Skips to the beginning of this block.
Definition: CountersMap.h:333
template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterKey_t& lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::start_block ( )
inline

Skips to the beginning of this block.

Definition at line 333 of file CountersMap.h.

333 { counter = 0; return *this; }
CounterIndex_t counter
index of the counter in the block
Definition: CountersMap.h:298

Member Data Documentation

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
BlockKey_t lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::block

key of the counter block

Definition at line 297 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
CounterIndex_t lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::counter

index of the counter in the block

Definition at line 298 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
constexpr Key_t lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::MinorKeyBits = LowestSetBit(MinorKeyRange)
static

Number of bits for the minor key.

Definition at line 348 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
constexpr Key_t lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::MinorKeyMask = MinorKeyRange - 1
static

Bit mask for the minor key.

Definition at line 351 of file CountersMap.h.

template<typename KEY, typename COUNTER, size_t SIZE, typename ALLOC = typename details::CountersMapTraits<KEY, COUNTER, SIZE>::DefaultAllocator_t, unsigned int SUBCOUNTERS = 1>
constexpr Key_t lar::CountersMap< KEY, COUNTER, SIZE, ALLOC, SUBCOUNTERS >::CounterKey_t::MinorKeyRange = NSubcounters
static

Number of values of the minor key.

Definition at line 345 of file CountersMap.h.


The documentation for this struct was generated from the following file: