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.
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.
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.
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>>
Returns the number of nodes allocated by this 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>>
Returns a shared pointer to the default instance.