Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mantid::API::IFunction::AttributeVisitor< T > Class Template Referenceabstract

Atribute visitor class. More...

#include <IFunction.h>

Inheritance diagram for Mantid::API::IFunction::AttributeVisitor< T >:
MantidQt::MantidWidgets::SetAttribute MantidQt::MantidWidgets::SetAttributeFromProperty

Public Member Functions

operator() (bool &b) const
 implements static_visitor's operator() for bool More...
 
operator() (double &d) const
 implements static_visitor's operator() for double More...
 
operator() (int &i) const
 implements static_visitor's operator() for int More...
 
operator() (std::string &str) const
 implements static_visitor's operator() for std::string More...
 
operator() (std::vector< double > &v) const
 implements static_visitor's operator() for vector More...
 
virtual ~AttributeVisitor ()=default
 Virtual destructor. More...
 

Protected Member Functions

virtual T apply (bool &) const =0
 Implement this method to access attribute as bool. More...
 
virtual T apply (double &) const =0
 Implement this method to access attribute as double. More...
 
virtual T apply (int &) const =0
 Implement this method to access attribute as int. More...
 
virtual T apply (std::string &) const =0
 Implement this method to access attribute as string. More...
 
virtual T apply (std::vector< double > &) const =0
 Implement this method to access attribute as vector. More...
 
template<typename T1 >
void evaluateValidator (T1 &inputData) const
 Evaluates the validator associated with attribute this visitor is to visit. More...
 

Protected Attributes

Mantid::Kernel::IValidator_sptr m_validator = Mantid::Kernel::IValidator_sptr()
 Validator against which to evaluate attribute value to set. More...
 

Detailed Description

template<typename T = void>
class Mantid::API::IFunction::AttributeVisitor< T >

Atribute visitor class.

It provides a separate access method for each attribute type. When applied to a particular attribute the appropriate method will be used. The child classes must implement the virtual AttributeVisitor::apply methods. See implementation of Attribute::value() method for an example.

Definition at line 200 of file IFunction.h.

Constructor & Destructor Documentation

◆ ~AttributeVisitor()

template<typename T = void>
virtual Mantid::API::IFunction::AttributeVisitor< T >::~AttributeVisitor ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ apply() [1/5]

template<typename T = void>
virtual T Mantid::API::IFunction::AttributeVisitor< T >::apply ( bool &  ) const
protectedpure virtual

Implement this method to access attribute as bool.

Implemented in MantidQt::MantidWidgets::SetAttributeFromProperty, and MantidQt::MantidWidgets::SetAttribute.

◆ apply() [2/5]

template<typename T = void>
virtual T Mantid::API::IFunction::AttributeVisitor< T >::apply ( double &  ) const
protectedpure virtual

Implement this method to access attribute as double.

Implemented in MantidQt::MantidWidgets::SetAttributeFromProperty, and MantidQt::MantidWidgets::SetAttribute.

◆ apply() [3/5]

template<typename T = void>
virtual T Mantid::API::IFunction::AttributeVisitor< T >::apply ( int &  ) const
protectedpure virtual

Implement this method to access attribute as int.

Implemented in MantidQt::MantidWidgets::SetAttributeFromProperty, and MantidQt::MantidWidgets::SetAttribute.

◆ apply() [4/5]

template<typename T = void>
virtual T Mantid::API::IFunction::AttributeVisitor< T >::apply ( std::string &  ) const
protectedpure virtual

Implement this method to access attribute as string.

Implemented in MantidQt::MantidWidgets::SetAttributeFromProperty, and MantidQt::MantidWidgets::SetAttribute.

◆ apply() [5/5]

template<typename T = void>
virtual T Mantid::API::IFunction::AttributeVisitor< T >::apply ( std::vector< double > &  ) const
protectedpure virtual

Implement this method to access attribute as vector.

Implemented in MantidQt::MantidWidgets::SetAttributeFromProperty, and MantidQt::MantidWidgets::SetAttribute.

◆ evaluateValidator()

template<typename T = void>
template<typename T1 >
void Mantid::API::IFunction::AttributeVisitor< T >::evaluateValidator ( T1 &  inputData) const
inlineprotected

Evaluates the validator associated with attribute this visitor is to visit.

Definition at line 228 of file IFunction.h.

References m_validator.

Referenced by MantidQt::MantidWidgets::SetAttribute::apply().

◆ operator()() [1/5]

template<typename T = void>
T Mantid::API::IFunction::AttributeVisitor< T >::operator() ( bool &  b) const
inline

implements static_visitor's operator() for bool

Definition at line 211 of file IFunction.h.

◆ operator()() [2/5]

template<typename T = void>
T Mantid::API::IFunction::AttributeVisitor< T >::operator() ( double &  d) const
inline

implements static_visitor's operator() for double

Definition at line 207 of file IFunction.h.

References Mantid::Geometry::d.

◆ operator()() [3/5]

template<typename T = void>
T Mantid::API::IFunction::AttributeVisitor< T >::operator() ( int &  i) const
inline

implements static_visitor's operator() for int

Definition at line 209 of file IFunction.h.

◆ operator()() [4/5]

template<typename T = void>
T Mantid::API::IFunction::AttributeVisitor< T >::operator() ( std::string &  str) const
inline

implements static_visitor's operator() for std::string

Definition at line 205 of file IFunction.h.

◆ operator()() [5/5]

template<typename T = void>
T Mantid::API::IFunction::AttributeVisitor< T >::operator() ( std::vector< double > &  v) const
inline

implements static_visitor's operator() for vector

Definition at line 213 of file IFunction.h.

Member Data Documentation

◆ m_validator

Validator against which to evaluate attribute value to set.

Definition at line 235 of file IFunction.h.

Referenced by MantidQt::MantidWidgets::SetAttribute::apply(), and MantidQt::MantidWidgets::SetAttribute::SetAttribute().


The documentation for this class was generated from the following file: