Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
bertini::detail::Configured< Ts > Struct Template Reference

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>

Inheritance diagram for bertini::detail::Configured< Ts >:
[legend]

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.

Detailed Description

template<typename ... Ts>
struct bertini::detail::Configured< Ts >

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.

On nested configs. If two or more things in your inheritance tree require Configured,

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.

template <typename T>
const
typename std::enable_if<detail::IsTemplateParameter<T, config::Cauchy<typename TrackerTraits<TrackerType>::BaseRealT>>::value, T>::type
& Get() const
{
return Config::template Get<T>();
}
template <typename T>
const
typename std::enable_if<not detail::IsTemplateParameter<T, config::Cauchy<typename TrackerTraits<TrackerType>::BaseRealT>>::value, T>::type
& Get() const
{
return EndgameBase<TrackerType, FinalEGT, UsedNumTs...>::template Get<T>();
}
template <typename T>
typename std::enable_if<detail::IsTemplateParameter<T, config::Cauchy<typename TrackerTraits<TrackerType>::BaseRealT>>::value, void>::type
Set(T const& t)
{
Config::template Set(t);
}
template <typename T>
typename std::enable_if<not detail::IsTemplateParameter<T, config::Cauchy<typename TrackerTraits<TrackerType>::BaseRealT>>::value, void>::type
Set(T const& t)
{
EndgameBase<TrackerType, FinalEGT, UsedNumTs...>::template Set(t);
}
const T & Get() const
Get the held configuration object of type T.
Definition configured.hpp:94
void Set(T const &t)
Set the held configuration object of type T.
Definition configured.hpp:101

Member Typedef Documentation

◆ UsedConfigs

template<typename ... Ts>
using bertini::detail::Configured< Ts >::UsedConfigs = TypeList<Ts...>

The list of configuration types this object holds.

Constructor & Destructor Documentation

◆ Configured()

template<typename ... Ts>
template<typename ... T>
bertini::detail::Configured< Ts >::Configured ( T const &... t)
inline

Construct, forwarding the given values into the held configuration tuple.

Member Function Documentation

◆ Get()

template<typename ... Ts>
template<typename T, typename = typename std::enable_if<IsTemplateParameter<T,Ts...>::value>::type>
const T & bertini::detail::Configured< Ts >::Get ( ) const
inline

Get the held configuration object of type T.

◆ Set()

template<typename ... Ts>
template<typename T, typename = typename std::enable_if<IsTemplateParameter<T,Ts...>::value>::type>
void bertini::detail::Configured< Ts >::Set ( T const & t)
inline

Set the held configuration object of type T.

Member Data Documentation

◆ configuration_

template<typename ... Ts>
std::tuple<Ts...> bertini::detail::Configured< Ts >::configuration_

The held configuration objects, one per config type.