PARTONS/NumA++  
Numerical Analysis C++ routines
Public Member Functions | Private Member Functions | Private Attributes | List of all members
NumA::Functor1D< PointerToObj, PointerToFunc > Class Template Reference

Template class for defining one-dimensional functions that can be used as arguments in virtual methods. More...

Inheritance diagram for NumA::Functor1D< PointerToObj, PointerToFunc >:
NumA::FunctionType1D

Public Member Functions

 Functor1D (PointerToObj *object, PointerToFunc function)
 Constructor. More...
 
virtual ~Functor1D ()
 Default destructor. More...
 
double operator() (double x, std::vector< double > &parameters)
 Operator allowing the functor to be used as a function. More...
 
double operator() (double x)
 Operator allowing the functor to be used as a function. More...
 
- Public Member Functions inherited from NumA::FunctionType1D
 FunctionType1D ()
 Empty constructor. More...
 
virtual ~FunctionType1D ()
 Default destructor. More...
 

Private Member Functions

 Functor1D (const Functor1D &)
 Not implemented. Disallows copy. More...
 
Functor1Doperator= (const Functor1D &)
 Not implemented. Disallows comparisons. More...
 

Private Attributes

PointerToObj * m_pObject
 Pointer to an object instantiating the class where the function is defined. More...
 
PointerToFunc m_pFunction
 Reference to the function. More...
 

Detailed Description

template<typename PointerToObj, typename PointerToFunc>
class NumA::Functor1D< PointerToObj, PointerToFunc >

Template class for defining one-dimensional functions that can be used as arguments in virtual methods.

This is needed to circumvent the issue that templates and virtual methods are incompatible.

See FunctionType1D documentation for usage.

Constructor & Destructor Documentation

◆ Functor1D() [1/2]

template<typename PointerToObj , typename PointerToFunc >
NumA::Functor1D< PointerToObj, PointerToFunc >::Functor1D ( PointerToObj *  object,
PointerToFunc  function 
)
inline

Constructor.

Parameters
objectPointer to an object instantiating the class where the function is defined.
functionReference to the function.

◆ ~Functor1D()

template<typename PointerToObj , typename PointerToFunc >
virtual NumA::Functor1D< PointerToObj, PointerToFunc >::~Functor1D ( )
inlinevirtual

Default destructor.

◆ Functor1D() [2/2]

template<typename PointerToObj , typename PointerToFunc >
NumA::Functor1D< PointerToObj, PointerToFunc >::Functor1D ( const Functor1D< PointerToObj, PointerToFunc > &  )
private

Not implemented. Disallows copy.

Member Function Documentation

◆ operator()() [1/2]

template<typename PointerToObj , typename PointerToFunc >
double NumA::Functor1D< PointerToObj, PointerToFunc >::operator() ( double  x)
inlinevirtual

Operator allowing the functor to be used as a function.

Parameters
xArgument of the function represented by the functor.
Returns
double

Implements NumA::FunctionType1D.

◆ operator()() [2/2]

template<typename PointerToObj , typename PointerToFunc >
double NumA::Functor1D< PointerToObj, PointerToFunc >::operator() ( double  x,
std::vector< double > &  parameters 
)
inlinevirtual

Operator allowing the functor to be used as a function.

Parameters
xArgument of the function represented by the functor.
parametersParameters that can be passed to the function.
Returns
double

Implements NumA::FunctionType1D.

◆ operator=()

template<typename PointerToObj , typename PointerToFunc >
Functor1D& NumA::Functor1D< PointerToObj, PointerToFunc >::operator= ( const Functor1D< PointerToObj, PointerToFunc > &  )
private

Not implemented. Disallows comparisons.

Member Data Documentation

◆ m_pFunction

template<typename PointerToObj , typename PointerToFunc >
PointerToFunc NumA::Functor1D< PointerToObj, PointerToFunc >::m_pFunction
private

Reference to the function.

◆ m_pObject

template<typename PointerToObj , typename PointerToFunc >
PointerToObj* NumA::Functor1D< PointerToObj, PointerToFunc >::m_pObject
private

Pointer to an object instantiating the class where the function is defined.


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