38 std::string
getType()
const {
return "composite"; }
40 std::vector<std::string> allowedValues()
const override;
47 template <
typename T>
void add() { this->
add(std::make_shared<T>()); }
51 template <
typename T,
typename U>
void add(
const U &arg) { this->
add(std::make_shared<T>(arg)); }
57 return std::any_of(m_children.cbegin(), m_children.cend(),
58 [](
const IValidator_sptr &validator) { return dynamic_cast<T *>(validator.get()) != nullptr; });
63 std::string check(
const boost::any &
value)
const override;
65 std::string checkAll(
const boost::any &
value)
const;
67 std::string checkAny(
const boost::any &
value)
const;
69 std::string buildErrorMessage(
const bool valid,
const std::string &errors)
const;
double value
The value of the point.
void add()
Add a validator based on a template type.
std::string getType() const
Gets the type of the validator.
CompositeValidator(const CompositeValidator &)
Private Copy constructor: NO DIRECT COPY ALLOWED.
void add(const U &arg)
Add a validator based on the first template type with the second as an argument.
bool contains()
Returns true if the child list contains a validator of the specified template type.
const CompositeRelation m_relation
Store what relationship child validators have.
std::list< IValidator_sptr > m_children
A container for the child validators.
IValidator is the basic interface for all validators for properties.
CompositeRelation
A composite validator that can combine any 2+ arbitrary validators together.
std::shared_ptr< IValidator > IValidator_sptr
A shared_ptr to an IValidator.
Helper class which provides the Collimation Length for SANS instruments.