KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Public Member Functions | Friends | List of all members
Kratos::IndirectScalar< T, S > Class Template Reference

Wrapper for a function which behaves like an arithmetic type. More...

#include <indirect_scalar.h>

Collaboration diagram for Kratos::IndirectScalar< T, S >:

Public Member Functions

 IndirectScalar ()
 
 IndirectScalar (std::function< void(T)> set, std::function< T()> get)
 
IndirectScalar< T, S > & operator= (const T value)
 
IndirectScalar< T, S > & operator+= (const T value)
 
IndirectScalar< T, S > & operator-= (const T value)
 
IndirectScalar< T, S > & operator*= (const T value)
 
IndirectScalar< T, S > & operator/= (const T value)
 
 operator T () const
 
std::ostream & print (std::ostream &os) const
 

Friends

class Serializer
 

Detailed Description

template<class T, typename S>
class Kratos::IndirectScalar< T, S >

Wrapper for a function which behaves like an arithmetic type.

Example: std::array<double, 3> a = {1.0, 2.0, 3.0}; auto fget = [&a]() -> double { return a[1]; }; auto fset = [&a](double d) { a[1] = d; }; IndirectScalar<double> f{fset, fget}; std::cout << f << std::endl; f = 0.0; std::cout << f << std::endl;

Constructor & Destructor Documentation

◆ IndirectScalar() [1/2]

template<class T , typename S >
Kratos::IndirectScalar< T, S >::IndirectScalar ( )
inline

◆ IndirectScalar() [2/2]

template<class T , typename S >
Kratos::IndirectScalar< T, S >::IndirectScalar ( std::function< void(T)>  set,
std::function< T()>  get 
)
inline

Member Function Documentation

◆ operator T()

template<class T , typename S >
Kratos::IndirectScalar< T, S >::operator T ( ) const
inline

◆ operator*=()

template<class T , typename S >
IndirectScalar<T, S>& Kratos::IndirectScalar< T, S >::operator*= ( const T  value)
inline

◆ operator+=()

template<class T , typename S >
IndirectScalar<T, S>& Kratos::IndirectScalar< T, S >::operator+= ( const T  value)
inline

◆ operator-=()

template<class T , typename S >
IndirectScalar<T, S>& Kratos::IndirectScalar< T, S >::operator-= ( const T  value)
inline

◆ operator/=()

template<class T , typename S >
IndirectScalar<T, S>& Kratos::IndirectScalar< T, S >::operator/= ( const T  value)
inline

◆ operator=()

template<class T , typename S >
IndirectScalar<T, S>& Kratos::IndirectScalar< T, S >::operator= ( const T  value)
inline

◆ print()

template<class T , typename S >
std::ostream& Kratos::IndirectScalar< T, S >::print ( std::ostream &  os) const
inline

Friends And Related Function Documentation

◆ Serializer

template<class T , typename S >
friend class Serializer
friend

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