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

Template for classes wrapping static key/value typically attribute lists. More...

#include <eagine/key_val_list.hpp>

Public Types

using key_type = typename Traits::key_type
 Alias for the key type.
 
using value_type = typename Traits::value_type
 Alias for the value type.
 

Public Member Functions

 key_value_list ()=default
 Default constructor.
 
auto data () const noexcept -> const value_type *
 Returns a pointer to the internal element array. More...
 
auto copy () const noexcept -> std::vector< value_type >
 Copies the internal element array into a vector. More...
 
auto get () const noexcept -> span< const value_type >
 A const view of the internal element array. More...
 
constexpr auto append (const key_value_list_element< Traits > &key_val) const noexcept -> key_value_list< Traits, N+2 >
 Appends a key/value pair and returns a new extended list.
 

Static Public Member Functions

static constexpr auto size () noexcept -> span_size_t
 Returns the size of the element array (including the terminating zero). More...
 

Related Functions

(Note that these are not member functions.)

template<typename Traits >
static constexpr auto operator+ (const key_value_list_element< Traits > &l, const key_value_list_element< Traits > &r) noexcept -> key_value_list< Traits, 4 >
 Concatenates two individual key/value elements into a key/value list. More...
 
template<typename Traits , std::size_t N>
static constexpr auto operator+ (const key_value_list< Traits, N > &l, const key_value_list_element< Traits > &r) noexcept -> key_value_list< Traits, N+2 >
 Adds a key/value pair into a key/value list, returns a new list. More...
 

Detailed Description

template<typename Traits, std::size_t N>
class eagine::key_value_list< Traits, N >

Template for classes wrapping static key/value typically attribute lists.

Template Parameters
Traitspolicy class customizing the instantiation.
Nthe number of elements in the list (not including the terminating zero).

Member Function Documentation

◆ copy()

template<typename Traits , std::size_t N>
auto eagine::key_value_list< Traits, N >::copy ( ) const -> std::vector<value_type>
inlinenoexcept

Copies the internal element array into a vector.

See also
get

◆ data()

template<typename Traits , std::size_t N>
auto eagine::key_value_list< Traits, N >::data ( ) const -> const value_type*
inlinenoexcept

Returns a pointer to the internal element array.

See also
size

◆ get()

template<typename Traits , std::size_t N>
auto eagine::key_value_list< Traits, N >::get ( ) const -> span<const value_type>
inlinenoexcept

A const view of the internal element array.

See also
copy

◆ size()

template<typename Traits , std::size_t N>
static constexpr auto eagine::key_value_list< Traits, N >::size ( ) -> span_size_t
inlinestaticconstexprnoexcept

Returns the size of the element array (including the terminating zero).

See also
data

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).