cat3d
A tiny OpenGL 3D engine library written in and for C++.
Public Types | Public Member Functions | List of all members
cat3d::opts Class Reference

cat3d main configuration options class More...

#include <opts.hpp>

Public Types

typedef std::unordered_map< opt, std::any > opt_map
 

Public Member Functions

 opts (opt_map opt)
 initialize the options object More...
 
template<typename T >
get (opt key) const
 Retrieve the value at the given key. More...
 
template<typename T >
get (opt key, T fallback) const
 Retrieve the value at the given key. More...
 

Detailed Description

cat3d main configuration options class

Constructor & Destructor Documentation

◆ opts()

cat3d::opts::opts ( opt_map  opt)

initialize the options object

Parameters
optthe map of key-value pairs corresponding to the program

Member Function Documentation

◆ get() [1/2]

template<typename T >
T cat3d::opts::get ( opt  key) const
inline

Retrieve the value at the given key.

Template Parameters
TThe type of value expected at this key
Parameters
keyThe key
Returns
const T& A const reference to that value

◆ get() [2/2]

template<typename T >
T cat3d::opts::get ( opt  key,
fallback 
) const
inline

Retrieve the value at the given key.

Template Parameters
TThe type of value expected at this key
Parameters
keyThe key
fallbackFallback option if the key does not exist.
Returns
const T& A const reference to that value

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