Go to the documentation of this file.
14 #ifndef STL_COMPARES_H
15 #define STL_COMPARES_H
27 template<
class Key,
class Compare = std::less<Key> >
30 INLINE
bool is_equal(
const Key &a,
const Key &b)
const {
31 return !operator()(a, b) && !operator()(b, a);
40 template<
class Key,
class Compare = std::less<Key> >
43 INLINE
size_t operator () (
const Key &key)
const {
46 INLINE
bool operator () (
const Key &a,
const Key &b)
const {
47 return Compare::operator ()(a, b);
49 INLINE
bool is_equal(
const Key &a,
const Key &b)
const {
50 return !operator()(a, b) && !operator()(b, a);
54 #endif // HAVE_STL_HASH
63 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
75 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
76 INLINE
bool is_equal(
const Key &a,
const Key &b)
const;
87 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
98 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
99 INLINE
bool is_equal(
const Key &a,
const Key &b)
const;
111 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
112 INLINE
bool is_equal(
const Key &a,
const Key &b)
const;
121 template<
class Key,
class Compare = std::less<Key> >
124 INLINE
static size_t add_hash(
size_t start,
const Key &key);
133 INLINE
static size_t add_hash(
size_t start,
const void *key);
144 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
145 INLINE
size_t add_hash(
size_t start,
const Key &key)
const;
146 const Key _threshold;
153 template<
class Key,
class Compare = std::less<Key> >
157 INLINE
bool operator () (
const Key &a,
const Key &b)
const {
160 INLINE
static size_t add_hash(
size_t start,
const Key &key);
167 template<
class Key,
class Compare = std::less<Key> >
171 INLINE
bool operator () (
const Key &a,
const Key &b)
const {
181 template<
class Key,
class Compare>
185 INLINE
bool operator () (
const Key &a,
const Key &b)
const {
202 INLINE
bool is_equal(
const Key &a,
const Key &b)
const;
size_t operator()(const Key &key) const
Calls the Key's get_hash() method.
size_t operator()(const Key &key) const
Trivially computes a size_t hash from the components of the string.
bool operator()(const Key &a, const Key &b) const
Returns true if a sorts before b, false otherwise.
bool is_equal(const Key &a, const Key &b) const
Returns true if a is equal to b, false otherwise.
An STL function object class, this is intended to be used on any ordered collection of pointers to cl...
bool is_equal(const Key &a, const Key &b) const
Returns true if a is equivalent to b, false otherwise.
An STL function object class, this is intended to be used on any ordered collection of pointers to cl...
bool operator()(const Key &a, const Key &b) const
Returns true if a sorts before b, false otherwise.
This is the default hash_compare class, which assumes the Key is a pointer value.
An STL function object class, this is intended to be used on any ordered collection of class objects ...
bool is_equal(const Key &a, const Key &b) const
Returns true if a is equivalent to b, false otherwise.
size_t operator()(const Key &key) const
Computes a size_t hash from the float.
This hash_compare class hashes a float or a double.
static size_t add_hash(size_t start, const void *key)
Adds the indicated key into a running hash.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An STL function object class, this is intended to be used on any ordered collection of pointers to cl...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This hash_compare class hashes a class object.
bool is_equal(const Key &a, const Key &b) const
Returns true if a is equivalent to b, false otherwise.
This hash_compare class hashes a pointer to a class object.
static size_t add_hash(size_t start, const Key &key)
Adds the indicated key into a running hash.
size_t operator()(const Key &key) const
Calls the Key's get_hash() method.
An STL function object class, this is intended to be used on any ordered collection of pointers to cl...
bool operator()(const Key &a, const Key &b) const
Returns true if a sorts before b, false otherwise.
size_t add_hash(size_t start, const Key &key) const
Adds the indicated key into a running hash.
This hash_compare class hashes a string.
This is the default hash_compare class, which assumes the Key is a size_t value or can be implicitly ...
static size_t add_hash(size_t start, const Key &key)
Adds the elements of 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.
Compares two floating point numbers, within threshold of equivalence.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
size_t operator()(const Key &key) const
Calls the Key's get_hash() method.
bool operator()(const Key &a, const Key &b) const
Returns true if a sorts before b, false otherwise.