18#include "PropertyList.h"
19#include "AUI/ASS/Selector/AAssSelector.h"
29 struct PropertyListRecursive:
public PropertyList {
32 PropertyListRecursive(Declarations&& ... declarations): PropertyListRecursive() {
33 processDeclarations(std::forward<Declarations>(declarations)...);
36 PropertyListRecursive(
const PropertyListRecursive&);
37 PropertyListRecursive();
38 ~PropertyListRecursive();
41 PropertyListRecursive(
const PropertyList& p);
42 PropertyListRecursive(PropertyList&& p);
46 return mConditionalPropertyLists;
52 template<
typename Property,
typename... Declarations>
53 void processDeclarations(Property&& declaration, Declarations&& ... declarations) {
54 processDeclaration(std::forward<Property>(declaration));
55 if constexpr (
sizeof...(Declarations) > 0) {
56 processDeclarations(std::forward<Declarations>(declarations)...);
61 void processDeclaration(T&&
t);
65 struct PropertyListConditional {
69 template<
typename... Declarations>
70 PropertyListConditional(
AAssSelector selector, Declarations&&... declarations):
71 selector(std::move(selector)), list(std::forward<Declarations>(declarations)...)
75 inline PropertyListRecursive::PropertyListRecursive() =
default;
77 inline PropertyListRecursive::PropertyListRecursive(PropertyList&& p) : PropertyList(std::move(p)) {}
79 inline PropertyListRecursive::~PropertyListRecursive() =
default;
83 void PropertyListRecursive::processDeclaration(T&&
t) {
84 if constexpr (std::is_base_of_v<PropertyListConditional, T>) {
85 mConditionalPropertyLists << std::forward<PropertyListConditional&&>(
t);
86 }
else if constexpr (std::is_same_v<T, PropertyListRecursive>) {
88 mProperties = std::move(
t.mProperties);
89 mConditionalPropertyLists = std::move(
t.mConditionalPropertyLists);
91 using declaration_t = ass::prop::Property<std::decay_t<T>>;
93 "ass::prop::Property template specialization is not defined for this property");
95 mProperties << _new<declaration_t>(
t);
A std::vector with AUI extensions.
Definition AVector.h:39
Definition AAssSelector.h:36
Definition PropertyListRecursive.h:27
Definition PropertyList.h:26
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:65
Definition PropertyListRecursive.h:29
Definition PropertyList.h:28