mpqc::math::Function< Value, Parameters > Class Template Referenceabstract

Documentation

template<typename Value, typename Parameters>
class mpqc::math::Function< Value, Parameters >

Function maps Parameters to a Value.

Function keeps parameters and value as part of its state. It recomputes the value as necessary by keeping track of timestamps on parameters and value. The value can also be made obsolete explicitly. Lastly, Function provides support for the Visitor pattern.

Note
both Value and Parameters are managed via shared pointers
Template Parameters
Valuethe type of value computed by Function; can be an abstract class
Parametersthe type of parameters used by Function; can be an abstract class

Public Types

typedef Value value_type
 
typedef Parameters parameters_type
 
template<typename X >
using Timestampable = ::mpqc::utility::Timestampable< X >
 

Public Member Functions

 Function ()=default
 
virtual ~Function ()
 
 Function (std::shared_ptr< Parameters > params)
 
std::shared_ptr< const Value > value ()
 
bool must_compute () const
 
std::shared_ptr< const Parameters > params () const
 
virtual void set_params (std::shared_ptr< Parameters > params)
 

Protected Member Functions

const Timestampable< Value > & get_value () const
 
void set_value (Value v)
 
virtual void compute ()=0
 evaluates value , implemented by the derived class More...
 

Friends

class FunctionVisitorBase< Function< Value, Parameters > >
 

Member Typedef Documentation

◆ parameters_type

template<typename Value , typename Parameters >
typedef Parameters mpqc::math::Function< Value, Parameters >::parameters_type

◆ Timestampable

template<typename Value , typename Parameters >
template<typename X >
using mpqc::math::Function< Value, Parameters >::Timestampable = ::mpqc::utility::Timestampable<X>

◆ value_type

template<typename Value , typename Parameters >
typedef Value mpqc::math::Function< Value, Parameters >::value_type

Constructor & Destructor Documentation

◆ Function() [1/2]

template<typename Value , typename Parameters >
mpqc::math::Function< Value, Parameters >::Function ( )
default

◆ ~Function()

template<typename Value , typename Parameters >
virtual mpqc::math::Function< Value, Parameters >::~Function ( )
inlinevirtual

◆ Function() [2/2]

template<typename Value , typename Parameters >
mpqc::math::Function< Value, Parameters >::Function ( std::shared_ptr< Parameters >  params)
inlineexplicit

Member Function Documentation

◆ compute()

template<typename Value , typename Parameters >
virtual void mpqc::math::Function< Value, Parameters >::compute ( )
protectedpure virtual

evaluates value , implemented by the derived class

◆ get_value()

template<typename Value , typename Parameters >
const Timestampable<Value>& mpqc::math::Function< Value, Parameters >::get_value ( ) const
inlineprotected

Direct access to the value of this function, bypasses timestamp check

Returns
the current value, i.e. value_

◆ must_compute()

template<typename Value , typename Parameters >
bool mpqc::math::Function< Value, Parameters >::must_compute ( ) const
inline

◆ params()

template<typename Value , typename Parameters >
std::shared_ptr<const Parameters> mpqc::math::Function< Value, Parameters >::params ( ) const
inline

◆ set_params()

template<typename Value , typename Parameters >
virtual void mpqc::math::Function< Value, Parameters >::set_params ( std::shared_ptr< Parameters >  params)
inlinevirtual

◆ set_value()

template<typename Value , typename Parameters >
void mpqc::math::Function< Value, Parameters >::set_value ( Value  v)
inlineprotected

Sets the value of this function, used by the compute() method of derived classes or by Function visitors via FunctionVisitorBase::set_value() .

Parameters
vthe value to be returned by Function::value()

◆ value()

template<typename Value , typename Parameters >
std::shared_ptr<const Value> mpqc::math::Function< Value, Parameters >::value ( )
inline

Timestampable<Value> will be converted to temporary Value, has to return by value here

Friends And Related Function Documentation

◆ FunctionVisitorBase< Function< Value, Parameters > >

template<typename Value , typename Parameters >
friend class FunctionVisitorBase< Function< Value, Parameters > >
friend

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