Porytiles
Loading...
Searching...
No Matches
porytiles::AnyMap Class Reference

#include <any_map.hpp>

Public Types

using iterator = std::unordered_map< std::string, std::any >::iterator
 
using const_iterator = std::unordered_map< std::string, std::any >::const_iterator
 

Public Member Functions

 AnyMap ()=default
 
iterator begin () noexcept
 
iterator end () noexcept
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
template<typename T >
std::optional< T > Try (const std::string &key) const
 
template<typename T >
std::optional< T > Get (const std::string &key) const
 
std::optional< std::any > TryAny (const std::string &key) const
 
std::any GetAny (const std::string &key) const
 
void Put (const std::string &key, const std::any &value)
 
bool Contains (const std::string &key) const
 
std::optional< std::type_index > GetType (const std::string &key) const
 

Detailed Description

Definition at line 12 of file any_map.hpp.

Member Typedef Documentation

◆ const_iterator

using porytiles::AnyMap::const_iterator = std::unordered_map<std::string, std::any>::const_iterator

Definition at line 18 of file any_map.hpp.

◆ iterator

using porytiles::AnyMap::iterator = std::unordered_map<std::string, std::any>::iterator

Definition at line 17 of file any_map.hpp.

Constructor & Destructor Documentation

◆ AnyMap()

porytiles::AnyMap::AnyMap ( )
default

Member Function Documentation

◆ begin() [1/2]

const_iterator porytiles::AnyMap::begin ( ) const
inlinenoexcept

Definition at line 26 of file any_map.hpp.

◆ begin() [2/2]

iterator porytiles::AnyMap::begin ( )
inlinenoexcept

Definition at line 20 of file any_map.hpp.

◆ cbegin()

const_iterator porytiles::AnyMap::cbegin ( ) const
inlinenoexcept

Definition at line 32 of file any_map.hpp.

◆ cend()

const_iterator porytiles::AnyMap::cend ( ) const
inlinenoexcept

Definition at line 35 of file any_map.hpp.

◆ Contains()

bool porytiles::AnyMap::Contains ( const std::string &  key) const
inline

Definition at line 81 of file any_map.hpp.

◆ end() [1/2]

const_iterator porytiles::AnyMap::end ( ) const
inlinenoexcept

Definition at line 29 of file any_map.hpp.

◆ end() [2/2]

iterator porytiles::AnyMap::end ( )
inlinenoexcept

Definition at line 23 of file any_map.hpp.

◆ Get()

template<typename T >
std::optional< T > porytiles::AnyMap::Get ( const std::string &  key) const
inline

Definition at line 52 of file any_map.hpp.

◆ GetAny()

std::any porytiles::AnyMap::GetAny ( const std::string &  key) const
inline

Definition at line 70 of file any_map.hpp.

◆ GetType()

std::optional< std::type_index > porytiles::AnyMap::GetType ( const std::string &  key) const
inline

Definition at line 85 of file any_map.hpp.

◆ Put()

void porytiles::AnyMap::Put ( const std::string &  key,
const std::any &  value 
)
inline

Definition at line 77 of file any_map.hpp.

◆ Try()

template<typename T >
std::optional< T > porytiles::AnyMap::Try ( const std::string &  key) const
inline

Definition at line 40 of file any_map.hpp.

◆ TryAny()

std::optional< std::any > porytiles::AnyMap::TryAny ( const std::string &  key) const
inline

Definition at line 63 of file any_map.hpp.


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