Confluent Sets and Maps
Public Types | Public Member Functions | Static Public Member Functions | List of all members
confluent::map_provider< Key, T, Compare, Hash, Equal, MappedHash, MappedEqual > Class Template Reference

Public Types

typedef confluent::set_provider< Key, Compare, Hash, Equal > set_provider_type
 

Public Member Functions

 map_provider (const MappedHash &mapped_hash=MappedHash(), const MappedEqual &mapped_equal=MappedEqual(), const std::shared_ptr< set_provider_type > &set_provider=set_provider_type::default_provider())
 
 map_provider (const map_provider &)=delete
 
const MappedHash & mapped_hash () const
 
const MappedEqual & mapped_eq () const
 
const std::shared_ptr< set_provider_type > & set_provider () const
 
size_t size () const
 

Static Public Member Functions

static const std::shared_ptr< map_provider > & default_provider ()
 

Detailed Description

template<class Key, class T, class Compare = std::less<Key>, class Hash = std::hash<Key>, class Equal = std::equal_to<Key>, class MappedHash = std::hash<T>, class MappedEqual = std::equal_to<T>>
class confluent::map_provider< Key, T, Compare, Hash, Equal, MappedHash, MappedEqual >

A map_provider extends a set_provider with additional resources needed by maps.

If not specified when creating a new map, the created map will use a global instance of the provider, otherwise the specified provider will be used. Binary map operations require both input maps to be using the same provider, if not the result is undefined. Operations that takes a map and a set as input requires both containers to use the same set_provider, if not the result is undefined. New maps that are created as a result of map operations will use the same provider as the parent map(s).

A map_provider should be owned by a std::shared_ptr and it is recommended to use the helper function std::make_shared<map_provider<>>() to instantiate new providers.

Examples
StatefulFunctors.cc.

Constructor & Destructor Documentation

◆ map_provider()

template<class Key , class T , class Compare = std::less<Key>, class Hash = std::hash<Key>, class Equal = std::equal_to<Key>, class MappedHash = std::hash<T>, class MappedEqual = std::equal_to<T>>
confluent::map_provider< Key, T, Compare, Hash, Equal, MappedHash, MappedEqual >::map_provider ( const MappedHash &  mapped_hash = MappedHash(),
const MappedEqual &  mapped_equal = MappedEqual(),
const std::shared_ptr< set_provider_type > &  set_provider = set_provider_type::default_provider() 
)
inline

Constructs a new map_provider.

Parameters
mapped_hashhash function for computing hash values of mapped elements
mapped_equalcomparison function that tests if mapped elements are equal
set_providerset_provider that will be extended by this map_provider

Member Function Documentation

◆ mapped_hash()

template<class Key , class T , class Compare = std::less<Key>, class Hash = std::hash<Key>, class Equal = std::equal_to<Key>, class MappedHash = std::hash<T>, class MappedEqual = std::equal_to<T>>
const MappedHash& confluent::map_provider< Key, T, Compare, Hash, Equal, MappedHash, MappedEqual >::mapped_hash ( ) const
inline

Returns the hash function for mapped values.

◆ mapped_eq()

template<class Key , class T , class Compare = std::less<Key>, class Hash = std::hash<Key>, class Equal = std::equal_to<Key>, class MappedHash = std::hash<T>, class MappedEqual = std::equal_to<T>>
const MappedEqual& confluent::map_provider< Key, T, Compare, Hash, Equal, MappedHash, MappedEqual >::mapped_eq ( ) const
inline

Returns the comparison function that tests if mapped elements are equal.

◆ set_provider()

template<class Key , class T , class Compare = std::less<Key>, class Hash = std::hash<Key>, class Equal = std::equal_to<Key>, class MappedHash = std::hash<T>, class MappedEqual = std::equal_to<T>>
const std::shared_ptr<set_provider_type>& confluent::map_provider< Key, T, Compare, Hash, Equal, MappedHash, MappedEqual >::set_provider ( ) const
inline

Returns the set_proivder this map_provider extends.

◆ size()

template<class Key , class T , class Compare = std::less<Key>, class Hash = std::hash<Key>, class Equal = std::equal_to<Key>, class MappedHash = std::hash<T>, class MappedEqual = std::equal_to<T>>
size_t confluent::map_provider< Key, T, Compare, Hash, Equal, MappedHash, MappedEqual >::size ( ) const
inline

Returns the number of nodes allocated by this provider.

◆ default_provider()

template<class Key , class T , class Compare = std::less<Key>, class Hash = std::hash<Key>, class Equal = std::equal_to<Key>, class MappedHash = std::hash<T>, class MappedEqual = std::equal_to<T>>
static const std::shared_ptr<map_provider>& confluent::map_provider< Key, T, Compare, Hash, Equal, MappedHash, MappedEqual >::default_provider ( )
inlinestatic

Returns a shared pointer to the default instance.


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