26#ifndef DUMUX_PROPERTY_SYSTEM_HH
27#define DUMUX_PROPERTY_SYSTEM_HH
44->
decltype(std::integral_constant<bool, !std::is_same<typename P::type, UndefinedProperty>::value>{})
56->
decltype(std::declval<typename T::InheritsFrom>(), std::enable_if_t<!std::is_same<typename T::InheritsFrom, void>::value,
int>{}, std::true_type{})
64template<
class ...Tuples>
65using ConCatTuples =
decltype(std::tuple_cat(std::declval<Tuples>()...));
68template<
class TypeTag,
template<
class,
class>
class Property,
class TTagList>
72template<
class TypeTag,
template<
class,
class>
class Property,
class TTagList,
class Enable>
75template<
class TypeTag,
template<
class,
class>
class Property,
class LastTypeTag>
76struct GetNextTypeTag<TypeTag, Property, std::tuple<LastTypeTag>, std::enable_if_t<hasParentTypeTag<LastTypeTag>(int{}), void>>
79template<
class TypeTag,
template<
class,
class>
class Property,
class LastTypeTag>
80struct GetNextTypeTag<TypeTag, Property, std::tuple<LastTypeTag>, std::enable_if_t<!hasParentTypeTag<LastTypeTag>(int{}), void>>
83template<
class TypeTag,
template<
class,
class>
class Property,
class FirstTypeTag,
class ...Args>
84struct GetNextTypeTag<TypeTag, Property, std::tuple<FirstTypeTag, Args...>, std::enable_if_t<hasParentTypeTag<FirstTypeTag>(int{}), void>>
87template<
class TypeTag,
template<
class,
class>
class Property,
class FirstTypeTag,
class ...Args>
88struct GetNextTypeTag<TypeTag, Property, std::tuple<FirstTypeTag, Args...>, std::enable_if_t<!hasParentTypeTag<FirstTypeTag>(int{}), void>>
89{
using type =
typename GetDefined<TypeTag, Property, std::tuple<Args...>>::type; };
91template<
class TypeTag,
template<
class,
class>
class Property,
class LastTypeTag>
92struct GetDefined<TypeTag, Property, std::tuple<LastTypeTag>>
100#pragma clang diagnostic push
101#pragma clang diagnostic ignored "-Wdeprecated-declarations"
105#pragma clang diagnostic pop
107 using type = std::conditional_t<isDefinedProperty<LastType>(
int{}), LastType,
108 typename GetNextTypeTag<TypeTag, Property, std::tuple<LastTypeTag>,
void>::type>;
111template<
class TypeTag,
template<
class,
class>
class Property,
class FirstTypeTag,
class ...Args>
112struct GetDefined<TypeTag, Property, std::tuple<FirstTypeTag, Args...>>
116#pragma clang diagnostic push
117#pragma clang diagnostic ignored "-Wdeprecated-declarations"
121#pragma clang diagnostic pop
123 using type = std::conditional_t<isDefinedProperty<FirstType>(
int{}), FirstType,
124 typename GetNextTypeTag<TypeTag, Property, std::tuple<FirstTypeTag, Args...>,
void>::type>;
128template<
class TypeTag,
template<
class,
class>
class Property>
132 static_assert(!std::is_same<type, UndefinedProperty>::value,
"Property is undefined!");
139template<
class TypeTag,
template<
class,
class>
class Property>
144#pragma clang diagnostic push
145#pragma clang diagnostic ignored "-Wdeprecated-declarations"
148template<
class TypeTag,
template<
class,
class>
class Property>
152template<
class TypeTag,
template<
class,
class>
class Property>
155#pragma clang diagnostic pop
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
constexpr auto getPropValue()
get the value data member of a property
Definition: propertysystem.hh:153
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type GetProp
get the type of a property (equivalent to old macro GET_PROP(...))
Definition: propertysystem.hh:140
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
constexpr auto isDefinedProperty(int) -> decltype(std::integral_constant< bool, !std::is_same< typename P::type, UndefinedProperty >::value >{})
check if a property P is defined
Definition: propertysystem.hh:43
decltype(std::tuple_cat(std::declval< Tuples >()...)) ConCatTuples
helper alias to concatenate multiple tuples
Definition: propertysystem.hh:65
constexpr auto hasParentTypeTag(int) -> decltype(std::declval< typename T::InheritsFrom >(), std::enable_if_t<!std::is_same< typename T::InheritsFrom, void >::value, int >{}, std::true_type{})
Definition: propertysystem.hh:55
a tag to mark properties as undefined
Definition: propertysystem.hh:36
helper struct to get the first property that is defined in the TypeTag hierarchy
Definition: propertysystem.hh:69
helper struct to iteratre over the TypeTag hierarchy
Definition: propertysystem.hh:73
typename GetDefined< TypeTag, Property, typename LastTypeTag::InheritsFrom >::type type
Definition: propertysystem.hh:77
typename GetDefined< TypeTag, Property, ConCatTuples< typename FirstTypeTag::InheritsFrom, std::tuple< Args... > > >::type type
Definition: propertysystem.hh:85
typename GetDefined< TypeTag, Property, std::tuple< Args... > >::type type
Definition: propertysystem.hh:89
std::conditional_t< isDefinedProperty< LastType >(int{}), LastType, typename GetNextTypeTag< TypeTag, Property, std::tuple< LastTypeTag >, void >::type > type
Definition: propertysystem.hh:108
Property< TypeTag, LastTypeTag > LastType
Definition: propertysystem.hh:103
std::conditional_t< isDefinedProperty< FirstType >(int{}), FirstType, typename GetNextTypeTag< TypeTag, Property, std::tuple< FirstTypeTag, Args... >, void >::type > type
Definition: propertysystem.hh:124
Property< TypeTag, FirstTypeTag > FirstType
Definition: propertysystem.hh:119
helper struct to extract get the Property specilization given a TypeTag, asserts that the property is...
Definition: propertysystem.hh:130
typename Detail::GetDefined< TypeTag, Property, std::tuple< TypeTag > >::type type
Definition: propertysystem.hh:131