Public Types | Public Member Functions | List of all members
lar::util::details::hash< T > Struct Template Reference

Hash functions for art and larsoft objects. More...

#include <FindAllP.h>

Public Types

using result_type = size_t
 
using argument_type = T
 

Public Member Functions

result_type operator() (argument_type const &v) const
 
template<>
auto operator() (argument_type const &id) const -> result_type
 

Detailed Description

template<typename T>
struct lar::util::details::hash< T >

Hash functions for art and larsoft objects.

Definition at line 42 of file FindAllP.h.

Member Typedef Documentation

template<typename T >
using lar::util::details::hash< T >::argument_type = T

Definition at line 44 of file FindAllP.h.

template<typename T >
using lar::util::details::hash< T >::result_type = size_t

Definition at line 43 of file FindAllP.h.

Member Function Documentation

template<typename T >
result_type lar::util::details::hash< T >::operator() ( argument_type const &  v) const
template<>
auto lar::util::details::hash< art::ProductID >::operator() ( argument_type const &  id) const -> result_type

Definition at line 373 of file FindAllP.h.

374  {
375  // make sure we have enough bits in result_type;
376  // if not, we need a more clever algorithm
377  //static_assert(
378  // sizeof(id.processIndex()) + sizeof(id.productIndex())
379  // <= sizeof(result_type),
380  // "hash return type not large enough for hashing art::ProductID"
381  //);
382  // stack the process and product IDs in one integer
383  //return result_type(
384  //(id.processIndex() << sizeof(id.productIndex() * CHAR_BIT))
385  //+ id.productIndex()
386  //);
387  return result_type( id.value() );
388  } // hash<art::ProductID>::operator()

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