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

eagine::program_parameter< T > Class Template Reference

Class template for pre-declared program parameter. More...

#include <eagine/program_args.hpp>

Public Member Functions

 program_parameter (string_view short_tag, string_view long_tag) noexcept
 Construction from short and long tag strings.
 
 program_parameter (string_view short_tag, string_view long_tag, T initial) noexcept
 Construction from short and long tag strings and the initial value.
 
auto ref () noexcept -> T &
 Returns a reference to the parameter value.
 
auto has_valid_value () const noexcept -> bool
 Indicates if the current value is valid. More...
 
auto validate (std::ostream &log) const -> bool
 Validate the current value, print potential error messages to log.
 
auto value () const -> auto &
 Returns the current parameter value.
 
 operator const T & () const noexcept
 Returns the current parameter value. More...
 
- Public Member Functions inherited from eagine::basic_program_parameter
constexpr auto short_tag () const noexcept -> string_view
 Get the short tag string for this parameter.
 
constexpr auto long_tag () const noexcept -> string_view
 Get the long tag string for this parameter.
 
constexpr auto description () const noexcept -> string_view
 Returns a human-readable description for this program parameter.
 
constexpr auto description (string_view help_str) noexcept -> auto &
 Specifies a human-readable description for this program parameter.
 

Detailed Description

template<typename T>
class eagine::program_parameter< T >

Class template for pre-declared program parameter.

See also
program_parameter_alias

This is a class for application-specific program parameters that are typically parsed from the program command-line arguments list. A declared parameter has a short tag like "-h" and a long tag like "--help" and has storage for a value of the type T.

Member Function Documentation

◆ has_valid_value()

template<typename T >
auto eagine::program_parameter< T >::has_valid_value ( ) const -> bool
inlinenoexcept

Indicates if the current value is valid.

See also
valid_if

Referenced by eagine::program_parameter< T >::validate().

◆ operator const T &()

template<typename T >
eagine::program_parameter< T >::operator const T & ( ) const
inlinenoexcept

Returns the current parameter value.

See also
value

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