Panda3D
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 >

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. More...
 
size_t operator() (const Key &key) const
 Computes a size_t hash from the float. More...
 
bool operator() (const Key &a, const Key &b) const
 Returns true if a sorts before b, false otherwise. More...
 
- Public Member Functions inherited from stl_hash_compare< Key >
bool is_equal (const Key &a, const Key &b) const
 
size_t operator() (const Key &key) const
 
bool operator() (const Key &a, const Key &b) 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.

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 149 of file stl_compares.I.

References AddHash::add_hash().

◆ operator()() [1/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 131 of file stl_compares.I.

◆ operator()() [2/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 140 of file stl_compares.I.


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