|
Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
|
This templated struct allows one to provide a variable typelist of config structs (or anything else for that matter), and provides a way to get and set these configs by looking up the structs by type. More...
#include <configured.hpp>
Public Types | |
| using | UsedConfigs = TypeList<Ts...> |
| The list of configuration types this object holds. | |
Public Member Functions | |
| template<typename ... T> | |
| Configured (T const &...t) | |
| Construct, forwarding the given values into the held configuration tuple. | |
| template<typename T, typename = typename std::enable_if<IsTemplateParameter<T,Ts...>::value>::type> | |
| const T & | Get () const |
| Get the held configuration object of type T. | |
| template<typename T, typename = typename std::enable_if<IsTemplateParameter<T,Ts...>::value>::type> | |
| void | Set (T const &t) |
| Set the held configuration object of type T. | |
Public Attributes | |
| std::tuple< Ts... > | configuration_ |
| The held configuration objects, one per config type. | |
This templated struct allows one to provide a variable typelist of config structs (or anything else for that matter), and provides a way to get and set these configs by looking up the structs by type.
I will add lookup by index if it is needed. If you need to look up by index, try type first. If your types are non-unique, consider making a struct to hold the things you are storing.
consider the following code, which can help determine whether to Get or Set from here, or to pass down the tree to a base class.
| using bertini::detail::Configured< Ts >::UsedConfigs = TypeList<Ts...> |
The list of configuration types this object holds.
|
inline |
Construct, forwarding the given values into the held configuration tuple.
|
inline |
Get the held configuration object of type T.
|
inline |
Set the held configuration object of type T.
| std::tuple<Ts...> bertini::detail::Configured< Ts >::configuration_ |
The held configuration objects, one per config type.