|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <bwf_base.h>

Public Types | |
| using | Generator = std::function<F> |
| Signature for generators. | |
Public Member Functions | |
| NameMap () | |
| Construct an empty container. | |
| NameMap (std::initializer_list< std::tuple< std::string_view, Generator const & > > list) | |
| Construct and assign the names and generators in list. | |
| self_type & | assign (std::string_view const &name, Generator const &generator) |
| bool | contains (std::string_view name) |
Protected Types | |
| using | Map = std::unordered_map<std::string_view, Generator> |
Protected Member Functions | |
| std::string_view | localize (std::string_view const &name) |
| Copy name in to local storage and return a view of it. | |
Protected Attributes | |
| Map | _map |
| Name to name generator. | |
| MemArena | _arena {1024} |
| Local name storage. | |
Associate generators with names.
| F | The function signature for generators in this container. |
This is a base class used by different types of name containers. It is not expected to be used directly. A subclass should inherit from this by providing a function type F that is suitable for the subclass generators.
Definition at line 299 of file bwf_base.h.
| using swoc::bwf::NameMap< F >::Generator = std::function<F> |
Signature for generators.
Definition at line 302 of file bwf_base.h.
|
protected |
Definition at line 305 of file bwf_base.h.
| swoc::bwf::NameMap< F >::NameMap | ( | ) |
Construct an empty container.
Definition at line 575 of file bwf_base.h.
| swoc::bwf::NameMap< F >::NameMap | ( | std::initializer_list< std::tuple< std::string_view, Generator const & > > | list | ) |
Construct and assign the names and generators in list.
Definition at line 577 of file bwf_base.h.
| auto swoc::bwf::NameMap< F >::assign | ( | std::string_view const & | name, |
| Generator const & | generator ) |
Assign the generator to the name.
| name | Name associated with the generator. |
| generator | The generator function. |
Definition at line 599 of file bwf_base.h.
| bool swoc::bwf::NameMap< F >::contains | ( | std::string_view | name | ) |
Check if a specific name is contained in this mapping.
| name | Name to check. |
true if present, false if not. Definition at line 585 of file bwf_base.h.
|
protected |
Copy name in to local storage and return a view of it.
Definition at line 591 of file bwf_base.h.
|
protected |
Local name storage.
Definition at line 336 of file bwf_base.h.
|
protected |