ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
esphome::mapping::Mapping< K, V > Class Template Reference

#include <mapping.h>

Public Types

using key_t
 
using value_t
 

Public Member Functions

 Mapping ()=default
 
void set (const K &key, const V &value)
 
get (const K &key) const
 
operator[] (K key)
 
template<typename T = V, std::enable_if_t< std::is_same_v< T, std::string >, int > = 0>
const char * operator[] (K key) const
 

Protected Attributes

std::map< key_t, value_t, std::less< key_t >, RAMAllocator< std::pair< key_t, value_t > > > map_
 

Detailed Description

template<typename K, typename V>
class esphome::mapping::Mapping< K, V >

Definition at line 23 of file mapping.h.

Member Typedef Documentation

◆ key_t

template<typename K , typename V >
using esphome::mapping::Mapping< K, V >::key_t
Initial value:
const std::conditional_t<std::is_same_v<K, std::string>,
K>
std::basic_string< char, std::char_traits< char >, RAMAllocator< char > > alloc_string_t
Definition mapping.h:10

Definition at line 28 of file mapping.h.

◆ value_t

template<typename K , typename V >
using esphome::mapping::Mapping< K, V >::value_t
Initial value:
std::conditional_t<std::is_same_v<V, std::string>,
V>

Definition at line 31 of file mapping.h.

Constructor & Destructor Documentation

◆ Mapping()

template<typename K , typename V >
esphome::mapping::Mapping< K, V >::Mapping ( )
default

Member Function Documentation

◆ get()

template<typename K , typename V >
V esphome::mapping::Mapping< K, V >::get ( const K & key) const
inline

Definition at line 37 of file mapping.h.

◆ operator[]() [1/2]

template<typename K , typename V >
V esphome::mapping::Mapping< K, V >::operator[] ( K key)
inline

Definition at line 53 of file mapping.h.

◆ operator[]() [2/2]

template<typename K , typename V >
template<typename T = V, std::enable_if_t< std::is_same_v< T, std::string >, int > = 0>
const char * esphome::mapping::Mapping< K, V >::operator[] ( K key) const
inline

Definition at line 57 of file mapping.h.

◆ set()

template<typename K , typename V >
void esphome::mapping::Mapping< K, V >::set ( const K & key,
const V & value )
inline

Definition at line 35 of file mapping.h.

Field Documentation

◆ map_

template<typename K , typename V >
std::map<key_t, value_t, std::less<key_t>, RAMAllocator<std::pair<key_t, value_t> > > esphome::mapping::Mapping< K, V >::map_
protected

Definition at line 66 of file mapping.h.


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