Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp::StringHashMapWrap< Value_type, Novalue_type, no_value > Class Template Reference

#include <GampTypes.hpp>

Inheritance diagram for gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >:
Collaboration diagram for gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >:

Public Member Functions

void clear ()
 Clears the hash map.
 
bool containsKey (std::string_view key) const
 Returns true if the given name maps to a value or no_value.
 
std::optional< std::string_view > containsValue (const Value_type &value) const
 Returns the string_view key of the first value, otherwise std::nullopt.
 
Value_type get (std::string_view key) const
 Returns the mapped value for the given name or no_value
 
const jau::StringHashMap< Value_type > & map () const noexcept
 
jau::StringHashMap< Value_type > & map () noexcept
 
Value_type put (std::string_view key, const Value_type &obj)
 Maps the value for the given name, overwrites old mapping if exists.
 
Value_type remove (std::string_view key)
 Removes value if mapped and returns it, otherwise returns no_value.
 

Detailed Description

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
class gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >

Definition at line 85 of file GampTypes.hpp.

Member Function Documentation

◆ map() [1/2]

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
jau::StringHashMap< Value_type > & gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >::map ( )
inlinenoexcept

Definition at line 90 of file GampTypes.hpp.

◆ map() [2/2]

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
const jau::StringHashMap< Value_type > & gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >::map ( ) const
inlinenoexcept

Definition at line 91 of file GampTypes.hpp.

◆ get()

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
Value_type gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >::get ( std::string_view key) const
inline

Returns the mapped value for the given name or no_value

Definition at line 94 of file GampTypes.hpp.

◆ containsKey()

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
bool gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >::containsKey ( std::string_view key) const
inline

Returns true if the given name maps to a value or no_value.

Definition at line 103 of file GampTypes.hpp.

◆ containsValue()

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
std::optional< std::string_view > gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >::containsValue ( const Value_type & value) const
inline

Returns the string_view key of the first value, otherwise std::nullopt.

Note: O(n) operation, slow.

Definition at line 108 of file GampTypes.hpp.

◆ clear()

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
void gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >::clear ( )
inline

Clears the hash map.

Definition at line 118 of file GampTypes.hpp.

◆ put()

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
Value_type gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >::put ( std::string_view key,
const Value_type & obj )
inline

Maps the value for the given name, overwrites old mapping if exists.

Returns
previously mapped value or no_value.

Definition at line 124 of file GampTypes.hpp.

◆ remove()

template<typename Value_type, typename Novalue_type, Novalue_type no_value>
Value_type gamp::StringHashMapWrap< Value_type, Novalue_type, no_value >::remove ( std::string_view key)
inline

Removes value if mapped and returns it, otherwise returns no_value.

Definition at line 137 of file GampTypes.hpp.


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