VTK  9.4.20241218
Public Member Functions | List of all members
vtkHashCombiner Class Reference

Combine 4- and 8-byte integers into a single hash value. More...

#include <vtkHashCombiner.h>

Public Member Functions

template<typename T >
void operator() (T &h, typename std::enable_if< sizeof(T)==8, std::size_t >::type k)
 Combine an integer k with the 64-bit hash h (which is modified on exit).
 
template<typename T >
void operator() (T &h, typename std::enable_if< sizeof(T)==4, std::size_t >::type k)
 Combine an integer k with the 32-bit hash h (which is modified on exit).
 

Detailed Description

Combine 4- and 8-byte integers into a single hash value.

This templated class accepts one 4- or 8-byte integer and combines it with an existing hash. It is useful for combining hashes of strings with integer values such as connectivity entries for shape primitives.

This class was adapted from (i.e., uses the integer constants from) boost::hash_combine but adds the templating on input value sizes.

See also
vtkCellGridSidesQuery for an example of its use.

Definition at line 27 of file vtkHashCombiner.h.

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
void vtkHashCombiner::operator() ( T &  h,
typename std::enable_if< sizeof(T)==8, std::size_t >::type  k 
)
inline

Combine an integer k with the 64-bit hash h (which is modified on exit).

Definition at line 32 of file vtkHashCombiner.h.

◆ operator()() [2/2]

template<typename T >
void vtkHashCombiner::operator() ( T &  h,
typename std::enable_if< sizeof(T)==4, std::size_t >::type  k 
)
inline

Combine an integer k with the 32-bit hash h (which is modified on exit).

Definition at line 51 of file vtkHashCombiner.h.


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