Chombo + EB  3.2
Public Types | Public Member Functions | Private Attributes | List of all members
GenericArithmeticable< ScalarT, SelfT > Struct Template Reference

#include <GenericArithmetic.H>

Inheritance diagram for GenericArithmeticable< ScalarT, SelfT >:
Inheritance graph
[legend]

Public Types

typedef ScalarT scalar_type
 
typedef SelfT self_type
 

Public Member Functions

virtual ~GenericArithmeticable ()
 
 GenericArithmeticable (SelfT *s)
 
bool operator< (const SelfT &) const
 
bool operator> (const SelfT &) const
 
bool operator<= (const SelfT &) const
 
bool operator>= (const SelfT &) const
 
SelfT & operator+= (const SelfT &)
 
SelfT & operator+= (const ScalarT &)
 
SelfT & operator-= (const SelfT &)
 
SelfT & operator-= (const ScalarT &)
 
SelfT & operator*= (const SelfT &)
 
SelfT & operator*= (const ScalarT &)
 
SelfT & operator/= (const SelfT &)
 
SelfT & operator/= (const ScalarT &)
 

Private Attributes

SelfT * m_child
 

Detailed Description

template<typename ScalarT, typename SelfT>
struct GenericArithmeticable< ScalarT, SelfT >

Class that you need to derive from, if you want the global operators below to be available for your class. For example: class Foo : public GenericArithmeticable<double,Foo> { public: Foo() : GenericArithmeticable<double,Foo>(this) { } Foo& operator+=( const Foo& ); Foo& operator+=( const double& ); [etc] };

If, in addition, you want the member-function operators, you'll need to implement some generic operator-appliers in your derived class: see, in GenericArithmeticI.H, operatorCompare() and operatorOpEquals(). If you implement operator<, operator+= etc in your derived class, then that'll override the ones here (regardless of whether you've defined operatorCompare() and operatorOpEquals() in your derived class, though it would then be weird if you did).

Member Typedef Documentation

◆ scalar_type

template<typename ScalarT, typename SelfT>
typedef ScalarT GenericArithmeticable< ScalarT, SelfT >::scalar_type

◆ self_type

template<typename ScalarT, typename SelfT>
typedef SelfT GenericArithmeticable< ScalarT, SelfT >::self_type

Constructor & Destructor Documentation

◆ ~GenericArithmeticable()

template<typename ScalarT, typename SelfT>
virtual GenericArithmeticable< ScalarT, SelfT >::~GenericArithmeticable ( )
inlinevirtual

◆ GenericArithmeticable()

template<typename ScalarT, typename SelfT>
GenericArithmeticable< ScalarT, SelfT >::GenericArithmeticable ( SelfT *  s)
inline

Member Function Documentation

◆ operator<()

template<typename ScalarT , typename SelfT>
bool GenericArithmeticable< ScalarT, SelfT >::operator< ( const SelfT &  rhs) const

◆ operator>()

template<typename ScalarT , typename SelfT>
bool GenericArithmeticable< ScalarT, SelfT >::operator> ( const SelfT &  rhs) const

◆ operator<=()

template<typename ScalarT , typename SelfT>
bool GenericArithmeticable< ScalarT, SelfT >::operator<= ( const SelfT &  rhs) const

◆ operator>=()

template<typename ScalarT , typename SelfT>
bool GenericArithmeticable< ScalarT, SelfT >::operator>= ( const SelfT &  rhs) const

◆ operator+=() [1/2]

template<typename ScalarT , typename SelfT>
SelfT & GenericArithmeticable< ScalarT, SelfT >::operator+= ( const SelfT &  rhs)

◆ operator+=() [2/2]

template<typename ScalarT, typename SelfT>
SelfT & GenericArithmeticable< ScalarT, SelfT >::operator+= ( const ScalarT &  a)

◆ operator-=() [1/2]

template<typename ScalarT , typename SelfT>
SelfT & GenericArithmeticable< ScalarT, SelfT >::operator-= ( const SelfT &  rhs)

◆ operator-=() [2/2]

template<typename ScalarT, typename SelfT>
SelfT & GenericArithmeticable< ScalarT, SelfT >::operator-= ( const ScalarT &  a)

◆ operator*=() [1/2]

template<typename ScalarT , typename SelfT>
SelfT & GenericArithmeticable< ScalarT, SelfT >::operator*= ( const SelfT &  rhs)

◆ operator*=() [2/2]

template<typename ScalarT, typename SelfT>
SelfT & GenericArithmeticable< ScalarT, SelfT >::operator*= ( const ScalarT &  a)

◆ operator/=() [1/2]

template<typename ScalarT , typename SelfT>
SelfT & GenericArithmeticable< ScalarT, SelfT >::operator/= ( const SelfT &  rhs)

◆ operator/=() [2/2]

template<typename ScalarT, typename SelfT>
SelfT & GenericArithmeticable< ScalarT, SelfT >::operator/= ( const ScalarT &  a)

Member Data Documentation

◆ m_child

template<typename ScalarT, typename SelfT>
SelfT* GenericArithmeticable< ScalarT, SelfT >::m_child
private

The documentation for this struct was generated from the following files: