STK++ 0.9.13
STK::SafeOp< Type > Struct Template Reference

Template functor which return a default value if the value is NA. More...

#include <STK_Functors.h>

Public Types

enum  { NbParam_ = 1 }
 
typedef Type result_type
 
typedef hidden::RemoveConst< Type >::Type param1_type
 

Public Member Functions

 SafeOp (Type const value=Type())
 
 SafeOp (SafeOp const &value)
 
result_type operator() (param1_type const &a) const
 

Private Attributes

Type const value_
 

Detailed Description

template<class Type>
struct STK::SafeOp< Type >

Template functor which return a default value if the value is NA.

Definition at line 792 of file STK_Functors.h.

Member Typedef Documentation

◆ param1_type

template<class Type >
typedef hidden::RemoveConst<Type>::Type STK::SafeOp< Type >::param1_type

Definition at line 796 of file STK_Functors.h.

◆ result_type

template<class Type >
typedef Type STK::SafeOp< Type >::result_type

Definition at line 795 of file STK_Functors.h.

Member Enumeration Documentation

◆ anonymous enum

template<class Type >
anonymous enum
Enumerator
NbParam_ 

Definition at line 794 of file STK_Functors.h.

794{ NbParam_ = 1 };

Constructor & Destructor Documentation

◆ SafeOp() [1/2]

template<class Type >
STK::SafeOp< Type >::SafeOp ( Type const  value = Type())
inline

Definition at line 798 of file STK_Functors.h.

798: value_(value) {}
Type const value_

◆ SafeOp() [2/2]

template<class Type >
STK::SafeOp< Type >::SafeOp ( SafeOp< Type > const value)
inline

Definition at line 799 of file STK_Functors.h.

799: value_(value.value_) {}

Member Function Documentation

◆ operator()()

template<class Type >
result_type STK::SafeOp< Type >::operator() ( param1_type const a) const
inline

Definition at line 801 of file STK_Functors.h.

802 { return Arithmetic<Type>::isFinite(a) ? a: value_;}
static bool isFinite(Type const &x)

References STK::Arithmetic< Type >::isFinite(), and STK::SafeOp< Type >::value_.

Member Data Documentation

◆ value_

template<class Type >
Type const STK::SafeOp< Type >::value_
private

Definition at line 804 of file STK_Functors.h.

Referenced by STK::SafeOp< Type >::operator()().


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