Nonconvex constrained optimization
Loading...
Searching...
No Matches
structs.hpp File Reference
#include <map>
#include <string_view>
Include dependency graph for structs.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  alpaqa
namespace  alpaqa::params

Macros

#define PARAMS_TABLE(type_, ...)
 Helper macro to easily specialize attribute_table.
#define PARAMS_TABLE_CONF(type_, ...)
 Helper macro to easily specialize attribute_table.
#define PARAMS_MEMBER(name, ...)
 Helper macro to easily initialize a attribute_table_t.
#define PARAMS_ALIAS_TABLE(type_, ...)
 Helper macro to easily specialize attribute_alias_table.
#define PARAMS_ALIAS_TABLE_CONF(type_, ...)
 Helper macro to easily specialize attribute_alias_table.
#define PARAMS_MEMBER_ALIAS(alias, name)
 Helper macro to easily initialize a attribute_alias_table_t.
#define ENUM_TABLE(type_, ...)
 Helper macro to easily specialize enum_table.
#define ENUM_MEMBER(name, ...)
 Helper macro to easily initialize a enum_table_t.

Typedefs

template<class S>
using attribute_table_t = std::map<std::string_view, attribute_accessor<S>>
 Dictionary that maps struct attribute names to type-erased functions that set those attributes.
template<class S>
using attribute_alias_table_t = std::map<std::string_view, std::string_view>
 Dictionary that maps struct attribute names to type-erased functions that set those attributes.
template<class T, class S>
using enum_table_t = std::map<std::string_view, enum_accessor<T, S>>
 Dictionary that maps enumerator names to their values and documentation.

Macro Definition Documentation

◆ PARAMS_TABLE

#define PARAMS_TABLE ( type_,
... )
Value:
template <class S> \
struct attribute_table<type_, S> { \
using type = type_; \
inline static const attribute_table_t<S> table{__VA_ARGS__}; \
}

Helper macro to easily specialize attribute_table.

Definition at line 24 of file structs.hpp.

◆ PARAMS_TABLE_CONF

#define PARAMS_TABLE_CONF ( type_,
... )
Value:
template <Config Conf, class S> \
struct attribute_table<type_<Conf>, S> { \
using type = type_<Conf>; \
inline static const attribute_table_t<S> table{__VA_ARGS__}; \
}

Helper macro to easily specialize attribute_table.

Definition at line 32 of file structs.hpp.

◆ PARAMS_MEMBER

#define PARAMS_MEMBER ( name,
... )
Value:
{#name, \
attribute_accessor<S>::template make<type>(&type::name, __VA_ARGS__)}

Helper macro to easily initialize a attribute_table_t.

Definition at line 41 of file structs.hpp.

◆ PARAMS_ALIAS_TABLE

#define PARAMS_ALIAS_TABLE ( type_,
... )
Value:
template <class S> \
struct attribute_alias_table<type_, S> { \
using type = type_; \
inline static const attribute_alias_table_t<S> table{__VA_ARGS__}; \
}

Helper macro to easily specialize attribute_alias_table.

Definition at line 56 of file structs.hpp.

◆ PARAMS_ALIAS_TABLE_CONF

#define PARAMS_ALIAS_TABLE_CONF ( type_,
... )
Value:
template <Config Conf, class S> \
struct attribute_alias_table<type_<Conf>, S> { \
using type = type_<Conf>; \
inline static const attribute_alias_table_t<S> table{__VA_ARGS__}; \
}

Helper macro to easily specialize attribute_alias_table.

Definition at line 64 of file structs.hpp.

◆ PARAMS_MEMBER_ALIAS

#define PARAMS_MEMBER_ALIAS ( alias,
name )
Value:
{#alias, #name}

Helper macro to easily initialize a attribute_alias_table_t.

Definition at line 73 of file structs.hpp.

◆ ENUM_TABLE

#define ENUM_TABLE ( type_,
... )
Value:
template <class S> \
struct enum_table<type_, S> { \
using type = type_; \
inline static const enum_table_t<type, S> table{__VA_ARGS__}; \
}

Helper macro to easily specialize enum_table.

Definition at line 90 of file structs.hpp.

◆ ENUM_MEMBER

#define ENUM_MEMBER ( name,
... )
Value:
{ \
#name, { type::name, __VA_ARGS__ } \
}

Helper macro to easily initialize a enum_table_t.

Definition at line 99 of file structs.hpp.