https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
CompileTimeDerivatives::CTUnary< T > Class Template Reference

Base class for a unary operator/function. More...

#include <CompileTimeDerivatives.h>

Inheritance diagram for CompileTimeDerivatives::CTUnary< T >:
[legend]

Public Types

typedef T::ResultType ResultType
 

Public Member Functions

 CTUnary (T arg)
 
template<typename Self >
std::string printParens (const Self *, const std::string &op) const
 

Static Public Member Functions

static constexpr int precedence ()
 precedence should reflect C++ operator precedence exactly (higher is binding tighter) More...
 
static constexpr bool leftAssociative ()
 left/right associative property should reflect C++ operator properties exactly More...
 

Protected Attributes

const T _arg
 

Detailed Description

template<typename T>
class CompileTimeDerivatives::CTUnary< T >

Base class for a unary operator/function.

Definition at line 135 of file CompileTimeDerivatives.h.

Member Typedef Documentation

◆ ResultType

template<typename T>
typedef T::ResultType CompileTimeDerivatives::CTUnary< T >::ResultType

Definition at line 152 of file CompileTimeDerivatives.h.

Constructor & Destructor Documentation

◆ CTUnary()

template<typename T>
CompileTimeDerivatives::CTUnary< T >::CTUnary ( arg)
inline

Definition at line 138 of file CompileTimeDerivatives.h.

Member Function Documentation

◆ leftAssociative()

static constexpr bool CompileTimeDerivatives::CTBase::leftAssociative ( )
inlinestaticinherited

left/right associative property should reflect C++ operator properties exactly

Definition at line 31 of file CompileTimeDerivatives.h.

31 { return false; }

◆ precedence()

static constexpr int CompileTimeDerivatives::CTBase::precedence ( )
inlinestaticinherited

precedence should reflect C++ operator precedence exactly (higher is binding tighter)

Definition at line 29 of file CompileTimeDerivatives.h.

29 { return 0; }

◆ printParens()

template<typename T>
template<typename Self >
std::string CompileTimeDerivatives::CTUnary< T >::printParens ( const Self *  ,
const std::string &  op 
) const
inline

Definition at line 141 of file CompileTimeDerivatives.h.

Referenced by CompileTimeDerivatives::CTUnaryMinus< T >::print().

142  {
143  std::string out = op;
144  if constexpr (T::precedence() > Self::precedence())
145  out += "(" + _arg.print() + ")";
146  else
147  out += _arg.print();
148 
149  return out;
150  }
OStreamProxy out

Member Data Documentation

◆ _arg

template<typename T>
const T CompileTimeDerivatives::CTUnary< T >::_arg
protected

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