39#ifndef DUMUX_PROPERTY_SYSTEM_MACROS_HH
40#define DUMUX_PROPERTY_SYSTEM_MACROS_HH
41#warning "Property macros are deprecated and will be removed after release 3.2. \
42If you are not using property macros you can disable this warning by \
43setting DUMUX_ENABLE_OLD_PROPERTY_MACROS to 0 (false) when configuring DuMux. \
44DUMUX_ENABLE_OLD_PROPERTY_MACROS defaults to 1 (true) until release 3.1. \
45After release 3.1 it will default to 0 (false) so you will have to manually \
46enable property macros in order to use them."
60#define TTAG(TypeTagName) ::Dumux::Properties::TTag::TypeTagName
70#define PTAG_(PropTagName) ::Dumux::Properties::PropTagName
76template<
class Tuple,
class IndexSequence>
79template<
class Tuple,
size_t... I>
82 using type = std::tuple<std::tuple_element_t<
sizeof...(I) - 1 - I, Tuple>...>;
93template<
class TypeTagTuple>
96template<
class OneTypeTag>
102template<
class FirstTypeTag,
class ...OtherTypeTags>
130#define DUMUX_GET_HEAD_(Arg1, ...) Arg1
132#define NEW_TYPE_TAG(...) \
134 struct DUMUX_GET_HEAD_(__VA_ARGS__) \
135 { using InheritsFrom = Detail::GetTypeTagInheritance<std::tuple<__VA_ARGS__>>::type; }; \
136 } extern int semicolonHack_
144#define INHERITS_FROM(...) __VA_ARGS__
161#define NEW_PROP_TAG(PTagName) \
162 template<class TypeTag, class MyTypeTag> \
163 struct PTagName { using type = UndefinedProperty; }; \
164 extern int semicolonHack_
196#define SET_PROP(EffTypeTagName, PropTagName) \
197 template <class TypeTag> \
198 struct PropTagName<TypeTag, TTAG(EffTypeTagName)>
206#define SET_INT_PROP(EffTypeTagName, PropTagName, ...) \
207 template <class TypeTag> \
208 struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
211 static constexpr int value = __VA_ARGS__; \
220#define SET_BOOL_PROP(EffTypeTagName, PropTagName, ...) \
221 template <class TypeTag> \
222 struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
225 static constexpr bool value = __VA_ARGS__; \
234#define SET_TYPE_PROP(EffTypeTagName, PropTagName, ...) \
235 template <class TypeTag> \
236 struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
238 using type = __VA_ARGS__; \
249#define SET_SCALAR_PROP(EffTypeTagName, PropTagName, ...) \
250 template <class TypeTag> \
251 struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
253 using Scalar = Dumux::GetPropType<TypeTag, Scalar>; \
255 using type = Scalar; \
256 static const Scalar value; \
258 template <class TypeTag> \
259 const typename PropTagName<TypeTag, TTAG(EffTypeTagName)>::type \
260 PropTagName<TypeTag, TTAG(EffTypeTagName)>::value(__VA_ARGS__)
269#define SET_STRING_PROP(EffTypeTagName, PropTagName, ...) \
270 template <class TypeTag> \
271 struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
274 using type = std::string; \
275 static const std::string value; \
277 template <class TypeTag> \
278 const typename PropTagName<TypeTag, TTAG(EffTypeTagName)>::type \
279 PropTagName<TypeTag, TTAG(EffTypeTagName)>::value(__VA_ARGS__)
283#define GET_PROP(TypeTag, PropTagName) ::Dumux::Properties::Detail::GetPropImpl<TypeTag, PTAG_(PropTagName)>::type
284#define GET_PROP_VALUE(TypeTag, PropTagName) ::Dumux::Properties::Detail::GetPropImpl<TypeTag, PTAG_(PropTagName)>::type::value
285#define GET_PROP_TYPE(TypeTag, PropTagName) ::Dumux::Properties::Detail::GetPropImpl<TypeTag, PTAG_(PropTagName)>::type::type
The Dumux property system, traits with inheritance.
typename ReverseTupleImpl< Tuple, std::make_index_sequence< std::tuple_size< Tuple >::value > >::type ReverseTuple
Definition: propertysystemmacros.hh:87
Definition: propertysystemmacros.hh:77
std::tuple< std::tuple_element_t< sizeof...(I) - 1 - I, Tuple >... > type
Definition: propertysystemmacros.hh:82
Definition: propertysystemmacros.hh:94
void type
Definition: propertysystemmacros.hh:99
ReverseTuple< std::tuple< OtherTypeTags... > > type
Definition: propertysystemmacros.hh:106