Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
floating_point_hash< Key > Class Template Reference

This hash_compare class hashes a float or a double. More...

#include "stl_compares.h"

Inheritance diagram for floating_point_hash< Key >:
stl_hash_compare< Key, Compare >

Public Member Functions

 floating_point_hash (Key threshold=get_nearly_zero_value((Key) 0))
 
size_t add_hash (size_t start, const Key &key) const
 Adds the indicated key into a running hash.
 
bool operator() (const Key &a, const Key &b) const
 Returns true if a sorts before b, false otherwise.
 
size_t operator() (const Key &key) const
 Computes a size_t hash from the float.
 
- Public Member Functions inherited from stl_hash_compare< Key, Compare >
bool is_equal (const Key &a, const Key &b) const
 
bool operator() (const Key &a, const Key &b) const
 
size_t operator() (const Key &key) const
 

Public Attributes

const Key _threshold
 

Detailed Description

template<class Key>
class floating_point_hash< Key >

This hash_compare class hashes a float or a double.

Definition at line 140 of file stl_compares.h.

Constructor & Destructor Documentation

◆ floating_point_hash()

template<class Key >
floating_point_hash< Key >::floating_point_hash ( Key threshold = get_nearly_zero_value((Key)0))
inline

Definition at line 120 of file stl_compares.I.

Member Function Documentation

◆ add_hash()

template<class Key >
size_t floating_point_hash< Key >::add_hash ( size_t start,
const Key & key ) const
inline

Adds the indicated key into a running hash.

Definition at line 148 of file stl_compares.I.

References AddHash::add_hash().

◆ operator()() [1/2]

template<class Key >
bool floating_point_hash< Key >::operator() ( const Key & a,
const Key & b ) const
inline

Returns true if a sorts before b, false otherwise.

Definition at line 139 of file stl_compares.I.

◆ operator()() [2/2]

template<class Key >
size_t floating_point_hash< Key >::operator() ( const Key & key) const
inline

Computes a size_t hash from the float.

Definition at line 130 of file stl_compares.I.

Member Data Documentation

◆ _threshold

template<class Key >
const Key floating_point_hash< Key >::_threshold

Definition at line 146 of file stl_compares.h.


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