OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::static_enum_map< Enum, Unit, Keys > Class Template Reference

Class mapping from an enumerator of an instantiation of a template. More...

#include <eagine/enum_map.hpp>

Public Member Functions

 static_enum_map ()=default
 Default constructor.
 
template<typename... Args, typename = std::enable_if_t<(sizeof...(Args) > 1)>>
 static_enum_map (construct_from_t, const Args &... args)
 Explicit construction from arguments that are passed to the units.
 
template<Enum Key>
auto get () noexcept -> Unit< Key > &
 Returns a reference to the unit with the specified enumerator key. More...
 
template<Enum Key>
auto get () const noexcept -> const Unit< Key > &
 Returns a const reference to the unit with the specified enumerator key. More...
 
template<typename Visitor >
auto visit (Enum key, Visitor visitor) noexcept -> bool
 Calls a visitor function on the unit with the specified key. More...
 
template<typename Visitor >
auto visit (Enum key, Visitor visitor) const noexcept -> bool
 Calls a visitor function on the unit with the specified key. More...
 
template<typename Visitor >
auto visit (bitfield< Enum > keys, Visitor visitor) noexcept -> span_size_t
 Calls a visitor function on the unit with the specified keys. More...
 
template<typename Visitor >
auto visit (bitfield< Enum > keys, Visitor visitor) const noexcept -> span_size_t
 Calls a visitor function on the unit with the specified keys. More...
 
template<typename Visitor >
auto visit_all (Visitor visitor) noexcept -> bool
 Calls a visitor function on all units. More...
 
template<typename Visitor >
auto visit_all (Visitor visitor) const noexcept -> bool
 Calls a visitor function on all units. More...
 

Detailed Description

template<typename Enum, template< Enum > class Unit, Enum... Keys>
class eagine::static_enum_map< Enum, Unit, Keys >

Class mapping from an enumerator of an instantiation of a template.

Member Function Documentation

◆ get() [1/2]

template<typename Enum , template< Enum > class Unit, Enum... Keys>
template<Enum Key>
auto eagine::static_enum_map< Enum, Unit, Keys >::get ( ) const -> const Unit<Key>&
inlinenoexcept

Returns a const reference to the unit with the specified enumerator key.

See also
visit

◆ get() [2/2]

template<typename Enum , template< Enum > class Unit, Enum... Keys>
template<Enum Key>
auto eagine::static_enum_map< Enum, Unit, Keys >::get ( ) -> Unit<Key>&
inlinenoexcept

Returns a reference to the unit with the specified enumerator key.

See also
visit

◆ visit() [1/4]

template<typename Enum , template< Enum > class Unit, Enum... Keys>
template<typename Visitor >
auto eagine::static_enum_map< Enum, Unit, Keys >::visit ( bitfield< Enum >  keys,
Visitor  visitor 
) const -> span_size_t
inlinenoexcept

Calls a visitor function on the unit with the specified keys.

See also
visit_all
get

◆ visit() [2/4]

template<typename Enum , template< Enum > class Unit, Enum... Keys>
template<typename Visitor >
auto eagine::static_enum_map< Enum, Unit, Keys >::visit ( bitfield< Enum >  keys,
Visitor  visitor 
) -> span_size_t
inlinenoexcept

Calls a visitor function on the unit with the specified keys.

See also
visit_all
get

◆ visit() [3/4]

template<typename Enum , template< Enum > class Unit, Enum... Keys>
template<typename Visitor >
auto eagine::static_enum_map< Enum, Unit, Keys >::visit ( Enum  key,
Visitor  visitor 
) const -> bool
inlinenoexcept

Calls a visitor function on the unit with the specified key.

See also
visit_all
get

◆ visit() [4/4]

template<typename Enum , template< Enum > class Unit, Enum... Keys>
template<typename Visitor >
auto eagine::static_enum_map< Enum, Unit, Keys >::visit ( Enum  key,
Visitor  visitor 
) -> bool
inlinenoexcept

Calls a visitor function on the unit with the specified key.

See also
visit_all
get

◆ visit_all() [1/2]

template<typename Enum , template< Enum > class Unit, Enum... Keys>
template<typename Visitor >
auto eagine::static_enum_map< Enum, Unit, Keys >::visit_all ( Visitor  visitor) const -> bool
inlinenoexcept

Calls a visitor function on all units.

See also
visit

◆ visit_all() [2/2]

template<typename Enum , template< Enum > class Unit, Enum... Keys>
template<typename Visitor >
auto eagine::static_enum_map< Enum, Unit, Keys >::visit_all ( Visitor  visitor) -> bool
inlinenoexcept

Calls a visitor function on all units.

See also
visit

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

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).