Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
static_table_traits< KeyType, ValueType > Class Template Reference

A traits class for use with adobe::static_table. More...

#include <static_table.hpp>

Public Types

typedef bool result_type
typedef KeyType key_type
typedef ValueType value_type
typedef std::pair< key_type, value_typeentry_type

Public Member Functions

result_type operator() (const entry_type &x, const entry_type &y) const
result_type operator() (const key_type &x, const entry_type &y) const
result_type operator() (const entry_type &x, const key_type &y) const
result_type equal (const key_type &x, const key_type &y) const

Detailed Description

template<typename KeyType, typename ValueType>
class adobe::static_table_traits< KeyType, ValueType >

static_table_traits provides functionality lifted out of the static_table class so clients can add their own traits should their key types require custom comparison and equality functionality. An example key type that would require a customized static_table_traits class would be boost::reference_wrapper<const std::type_info>, as the default-supplied functionality is not compatible.

Definition at line 198 of file static_table.hpp.

Member Typedef Documentation

◆ result_type

template<typename KeyType, typename ValueType>
typedef bool result_type

The result type retured by operator() in this function object. Must always be bool.

Definition at line 199 of file static_table.hpp.

◆ key_type

template<typename KeyType, typename ValueType>
typedef KeyType key_type

The type used for lookups in the table.

Definition at line 200 of file static_table.hpp.

◆ value_type

template<typename KeyType, typename ValueType>
typedef ValueType value_type

The resultant type from a table lookup.

Definition at line 201 of file static_table.hpp.

◆ entry_type

template<typename KeyType, typename ValueType>
typedef std::pair<key_type, value_type> entry_type

A pair comprised of a key_type and a value_type.

Definition at line 202 of file static_table.hpp.

Member Function Documentation

◆ operator()() [1/3]

template<typename KeyType, typename ValueType>
result_type operator() ( const entry_type & x,
const entry_type & y ) const
Parameters
xThe first entry
yThe second entry
Returns
true if x's key < y's key; false otherwise.

Definition at line 204 of file static_table.hpp.

◆ operator()() [2/3]

template<typename KeyType, typename ValueType>
result_type operator() ( const key_type & x,
const entry_type & y ) const

Definition at line 210 of file static_table.hpp.

◆ operator()() [3/3]

template<typename KeyType, typename ValueType>
result_type operator() ( const entry_type & x,
const key_type & y ) const
Parameters
xThe table entry
yAn arbitrary key
Returns
true if x's key < y; false otherwise.

Definition at line 212 of file static_table.hpp.

◆ equal()

template<typename KeyType, typename ValueType>
result_type equal ( const key_type & x,
const key_type & y ) const
Parameters
xThe first key
yThe second key
Returns
true if x == y; false otherwise.

Definition at line 214 of file static_table.hpp.