@@ -29,76 +29,64 @@ template<typename... Types>
2929inline constexpr auto TypeNames = std::array<std::string_view, sizeof ...(Types)>{core::className<Types>()...};
3030}
3131
32- template <size_t NumAllowedValues = 0 , size_t NumDependentProperties = 0 , size_t NumExclusiveOfProperties = 0 >
32+ template <size_t NumAllowedValues = 0 >
3333struct PropertyDefinitionBuilder {
34- static constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > createProperty (std::string_view name) {
35- PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > builder;
34+ static constexpr PropertyDefinitionBuilder<NumAllowedValues> createProperty (std::string_view name) {
35+ PropertyDefinitionBuilder<NumAllowedValues> builder;
3636 builder.property .name = name;
3737 return builder;
3838 }
3939
40- static constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > createProperty (std::string_view name, std::string_view display_name) {
41- PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > builder;
40+ static constexpr PropertyDefinitionBuilder<NumAllowedValues> createProperty (std::string_view name, std::string_view display_name) {
41+ PropertyDefinitionBuilder<NumAllowedValues> builder;
4242 builder.property .name = name;
4343 builder.property .display_name = display_name;
4444 return builder;
4545 }
4646
47- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > withDescription (std::string_view description) {
47+ constexpr PropertyDefinitionBuilder<NumAllowedValues> withDescription (std::string_view description) {
4848 property.description = description;
4949 return *this ;
5050 }
5151
52- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > isRequired (bool required) {
52+ constexpr PropertyDefinitionBuilder<NumAllowedValues> isRequired (bool required) {
5353 property.is_required = required;
5454 return *this ;
5555 }
5656
57- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > isSensitive (bool sensitive) {
57+ constexpr PropertyDefinitionBuilder<NumAllowedValues> isSensitive (bool sensitive) {
5858 property.is_sensitive = sensitive;
5959 return *this ;
6060 }
6161
62- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > supportsExpressionLanguage (bool supports_expression_language) {
62+ constexpr PropertyDefinitionBuilder<NumAllowedValues> supportsExpressionLanguage (bool supports_expression_language) {
6363 property.supports_expression_language = supports_expression_language;
6464 return *this ;
6565 }
6666
67- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > withDefaultValue (std::string_view default_value) {
67+ constexpr PropertyDefinitionBuilder<NumAllowedValues> withDefaultValue (std::string_view default_value) {
6868 property.default_value = std::optional<std::string_view>{default_value}; // workaround for gcc 11.1; on gcc 11.3 and later, `property.default_value = default_value` works, too
6969 return *this ;
7070 }
7171
72- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > withAllowedValues (
72+ constexpr PropertyDefinitionBuilder<NumAllowedValues> withAllowedValues (
7373 std::array<std::string_view, NumAllowedValues> allowed_values) {
7474 property.allowed_values = allowed_values;
7575 return *this ;
7676 }
7777
7878 template <typename ... AllowedTypes>
79- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > withAllowedTypes () {
79+ constexpr PropertyDefinitionBuilder<NumAllowedValues> withAllowedTypes () {
8080 property.allowed_types = {detail::TypeNames<AllowedTypes...>};
8181 return *this ;
8282 }
8383
84- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties> withDependentProperties (
85- std::array<std::string_view, NumDependentProperties> dependent_properties) {
86- property.dependent_properties = dependent_properties;
87- return *this ;
88- }
89-
90- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties> withExclusiveOfProperties (
91- std::array<std::pair<std::string_view, std::string_view>, NumExclusiveOfProperties> exclusive_of_properties) {
92- property.exclusive_of_properties = exclusive_of_properties;
93- return *this ;
94- }
95-
96- constexpr PropertyDefinitionBuilder<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties> withValidator (const PropertyValidator& property_validator) {
84+ constexpr PropertyDefinitionBuilder<NumAllowedValues> withValidator (const PropertyValidator& property_validator) {
9785 property.validator = gsl::make_not_null (&property_validator);
9886 return *this ;
9987 }
10088
101- constexpr PropertyDefinition<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > build () {
89+ constexpr PropertyDefinition<NumAllowedValues> build () {
10290 if (property.name .size () == 0 ) {
10391 throw std::logic_error (" A Property must have a name" );
10492 }
@@ -113,16 +101,14 @@ struct PropertyDefinitionBuilder {
113101 return property;
114102 }
115103
116- PropertyDefinition<NumAllowedValues, NumDependentProperties, NumExclusiveOfProperties > property{
104+ PropertyDefinition<NumAllowedValues> property{
117105 .name = {},
118106 .display_name = {},
119107 .description = {},
120108 .is_required = false ,
121109 .is_sensitive = false ,
122110 .allowed_values = {},
123111 .allowed_types = {},
124- .dependent_properties = {},
125- .exclusive_of_properties = {},
126112 .default_value = {},
127113 .validator = gsl::make_not_null (&StandardPropertyValidators::ALWAYS_VALID_VALIDATOR),
128114 .supports_expression_language = false ,
0 commit comments