18#include "PropertyList.h"
19#include "AUI/ASS/Selector/AAssSelector.h"
24 struct PropertyListRecursive:
public PropertyList {
28 template<
typename... Declarations>
29 PropertyListRecursive(Declarations&& ... declarations): PropertyListRecursive() {
30 processDeclarations(std::forward<Declarations>(declarations)...);
33 PropertyListRecursive(
const PropertyListRecursive&);
34 PropertyListRecursive();
35 ~PropertyListRecursive();
38 PropertyListRecursive(
const PropertyList& p);
39 PropertyListRecursive(PropertyList&& p);
43 return mConditionalPropertyLists;
49 template<
typename Property,
typename... Declarations>
50 void processDeclarations(Property&& declaration, Declarations&& ... declarations) {
51 processDeclaration(std::forward<Property>(declaration));
52 if constexpr (
sizeof...(Declarations) > 0) {
53 processDeclarations(std::forward<Declarations>(declarations)...);
58 void processDeclaration(T&&
t);
64 PropertyListRecursive list;
66 template<
typename... Declarations>
67 ConditionalPropertyList(
AAssSelector selector, Declarations&&... declarations):
68 selector(std::move(selector)), list(std::forward<Declarations>(declarations)...)
72 inline PropertyListRecursive::PropertyListRecursive() =
default;
73 inline PropertyListRecursive::PropertyListRecursive(
const PropertyList& p) : PropertyList(p) {}
75 inline PropertyListRecursive::PropertyListRecursive(
const PropertyListRecursive&) =
default;
76 inline PropertyListRecursive::~PropertyListRecursive() =
default;
80 void PropertyListRecursive::processDeclaration(T&&
t) {
81 if constexpr (std::is_base_of_v<PropertyListRecursive::ConditionalPropertyList, T>) {
82 mConditionalPropertyLists << std::forward<ConditionalPropertyList&&>(
t);
83 }
else if constexpr (std::is_same_v<T, PropertyListRecursive>) {
85 mProperties = std::move(
t.mProperties);
86 mConditionalPropertyLists = std::move(
t.mConditionalPropertyLists);
88 using declaration_t = ass::prop::Property<std::decay_t<T>>;
90 "ass::prop::Property template specialization is not defined for this property");
92 mProperties << _new<declaration_t>(
t);
A std::vector with AUI extensions.
Definition AVector.h:39
Definition AAssSelector.h:36
type_of< T > t
Selects views that are of the specified C++ types.
Definition type_of.h:71
constexpr bool is_complete
Determines whether T is complete or not.
Definition types.h:23
Definition PropertyListRecursive.h:62
Definition PropertyList.h:25