OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
string_view_unordered_map< ValueT > Class Template Reference

#include <string_view_unordered_map.h>

+ Inheritance diagram for string_view_unordered_map< ValueT >:
+ Collaboration diagram for string_view_unordered_map< ValueT >:

Public Types

using MapT = typename std::unordered_map< std::string, ValueT >
 

Public Member Functions

auto find (std::string_view key) const
 
auto find (const std::string &key) const
 
auto find (const char *key) const
 
template<typename... ArgsT>
auto try_emplace (std::string_view key, ArgsT &&...args)
 
template<typename... ArgsT>
auto try_emplace (const std::string &key, ArgsT &&...args)
 
template<typename... ArgsT>
auto try_emplace (const char *key, ArgsT &&...args)
 

Static Private Attributes

static thread_local std::string tmp_key_
 

Detailed Description

template<typename ValueT>
class string_view_unordered_map< ValueT >

Definition at line 13 of file string_view_unordered_map.h.

Member Typedef Documentation

template<typename ValueT >
using string_view_unordered_map< ValueT >::MapT = typename std::unordered_map<std::string, ValueT>

Definition at line 15 of file string_view_unordered_map.h.

Member Function Documentation

template<typename ValueT >
auto string_view_unordered_map< ValueT >::find ( std::string_view  key) const
inline

Definition at line 17 of file string_view_unordered_map.h.

References string_view_unordered_map< ValueT >::tmp_key_.

17  {
18  tmp_key_.reserve(key.size());
19  tmp_key_.assign(key.data(), key.size());
20  return MapT::find(tmp_key_);
21  }
static thread_local std::string tmp_key_
template<typename ValueT >
auto string_view_unordered_map< ValueT >::find ( const std::string &  key) const
inline

Definition at line 23 of file string_view_unordered_map.h.

23 { return MapT::find(key); }
template<typename ValueT >
auto string_view_unordered_map< ValueT >::find ( const char *  key) const
inline

Definition at line 25 of file string_view_unordered_map.h.

References string_view_unordered_map< ValueT >::tmp_key_.

25  {
26  tmp_key_.assign(key);
27  return MapT::find(tmp_key_);
28  }
static thread_local std::string tmp_key_
template<typename ValueT >
template<typename... ArgsT>
auto string_view_unordered_map< ValueT >::try_emplace ( std::string_view  key,
ArgsT &&...  args 
)
inline

Definition at line 31 of file string_view_unordered_map.h.

References run_benchmark_import::args, and string_view_unordered_map< ValueT >::tmp_key_.

31  {
32  tmp_key_.reserve(key.size());
33  tmp_key_.assign(key.data(), key.size());
34  return MapT::try_emplace(tmp_key_, std::forward<ArgsT>(args)...);
35  }
static thread_local std::string tmp_key_
template<typename ValueT >
template<typename... ArgsT>
auto string_view_unordered_map< ValueT >::try_emplace ( const std::string &  key,
ArgsT &&...  args 
)
inline

Definition at line 38 of file string_view_unordered_map.h.

References run_benchmark_import::args.

38  {
39  return MapT::try_emplace(key, std::forward<ArgsT>(args)...);
40  }
template<typename ValueT >
template<typename... ArgsT>
auto string_view_unordered_map< ValueT >::try_emplace ( const char *  key,
ArgsT &&...  args 
)
inline

Definition at line 43 of file string_view_unordered_map.h.

References run_benchmark_import::args, and string_view_unordered_map< ValueT >::tmp_key_.

43  {
44  tmp_key_.assign(key);
45  return MapT::try_emplace(tmp_key_, std::forward<ArgsT>(args)...);
46  }
static thread_local std::string tmp_key_

Member Data Documentation

template<typename ValueT >
thread_local std::string string_view_unordered_map< ValueT >::tmp_key_
staticprivate

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