LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SorterByKey< Key, ExtractKey, Comparer > Struct Template Reference

Public Types

using Key_t = Key
 

Public Member Functions

template<typename A , typename B >
bool operator() (A const &a, B const &b) const
 

Static Public Member Functions

static bool sortKey (Key_t a, Key_t b)
 
static Key_t key (Key_t k)
 
template<typename Data >
static Key_t key (Data const &obj)
 

Detailed Description

template<typename Key, typename ExtractKey, typename Comparer = std::less<Key>>
struct SorterByKey< Key, ExtractKey, Comparer >

Definition at line 431 of file DriftPartitions.cxx.

Member Typedef Documentation

template<typename Key , typename ExtractKey , typename Comparer = std::less<Key>>
using SorterByKey< Key, ExtractKey, Comparer >::Key_t = Key

Definition at line 435 of file DriftPartitions.cxx.

Member Function Documentation

template<typename Key , typename ExtractKey , typename Comparer = std::less<Key>>
static Key_t SorterByKey< Key, ExtractKey, Comparer >::key ( Key_t  k)
inlinestatic

Definition at line 438 of file DriftPartitions.cxx.

438 { return k; }
template<typename Key , typename ExtractKey , typename Comparer = std::less<Key>>
template<typename Data >
static Key_t SorterByKey< Key, ExtractKey, Comparer >::key ( Data const &  obj)
inlinestatic

Definition at line 440 of file DriftPartitions.cxx.

441  {
442  return ExtractKey()(obj);
443  }
template<typename Key , typename ExtractKey , typename Comparer = std::less<Key>>
template<typename A , typename B >
bool SorterByKey< Key, ExtractKey, Comparer >::operator() ( A const &  a,
B const &  b 
) const
inline

Definition at line 446 of file DriftPartitions.cxx.

447  {
448  return sortKey(key(a), key(b));
449  }
static bool sortKey(Key_t a, Key_t b)
static Key_t key(Key_t k)
template<typename Key , typename ExtractKey , typename Comparer = std::less<Key>>
static bool SorterByKey< Key, ExtractKey, Comparer >::sortKey ( Key_t  a,
Key_t  b 
)
inlinestatic

Definition at line 437 of file DriftPartitions.cxx.

437 { return Comparer()(a, b); }

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