FuncSketch
Loading...
Searching...
No Matches
func_sketch::math::BinaryOperator Class Reference

Class of binary operators. More...

#include <func_sketch/math/binary_operator.h>

Collaboration diagram for func_sketch::math::BinaryOperator:

Public Member Functions

template<BinaryOperatorType T>
 BinaryOperator (T operator_object)
 Constructor.
std::string_view name () const
 Get the name of the operator.
void operator() (const Number &left, const Number &right, Number &result) const
 Operate on a pair of scalars.

Private Types

using GetNameSignature
 Signature of function to get the name of the operator.
using ScalarOperatorSignature
 Signature of function to operate on a pair of scalars.

Private Attributes

utilities::Any operator_
 Operator object.
GetNameSignatureget_name_
 Function to get the name of the operator.
ScalarOperatorSignaturescalar_operator_
 Function to operate on a pair of scalars.

Detailed Description

Class of binary operators.

Definition at line 34 of file binary_operator.h.

Member Typedef Documentation

◆ GetNameSignature

Initial value:
std::string_view(
const utilities::Any& )
Class to store any type of value.
Definition any.h:33

Signature of function to get the name of the operator.

Definition at line 74 of file binary_operator.h.

◆ ScalarOperatorSignature

Initial value:
void(
const utilities::Any& , const Number& ,
const Number& , Number& )
std::variant< Integer, Real, Complex > Number
Type of numbers.

Signature of function to operate on a pair of scalars.

Definition at line 78 of file binary_operator.h.

Constructor & Destructor Documentation

◆ BinaryOperator()

template<BinaryOperatorType T>
func_sketch::math::BinaryOperator::BinaryOperator ( T operator_object)
inlineexplicit

Constructor.

Template Parameters
TType of the operator object.
Parameters
[in]operator_objectOperator object.

Definition at line 43 of file binary_operator.h.

Member Function Documentation

◆ name()

std::string_view func_sketch::math::BinaryOperator::name ( ) const
inlinenodiscard

Get the name of the operator.

Returns
Name of the operator.

Definition at line 58 of file binary_operator.h.

◆ operator()()

void func_sketch::math::BinaryOperator::operator() ( const Number & left,
const Number & right,
Number & result ) const
inline

Operate on a pair of scalars.

Parameters
[in]leftLeft scalar.
[in]rightRight scalar.
[out]resultResult scalar.

Definition at line 67 of file binary_operator.h.

Member Data Documentation

◆ operator_

utilities::Any func_sketch::math::BinaryOperator::operator_
private

Operator object.

Definition at line 83 of file binary_operator.h.

◆ get_name_

GetNameSignature* func_sketch::math::BinaryOperator::get_name_
private

Function to get the name of the operator.

Definition at line 86 of file binary_operator.h.

◆ scalar_operator_

ScalarOperatorSignature* func_sketch::math::BinaryOperator::scalar_operator_
private

Function to operate on a pair of scalars.

Definition at line 89 of file binary_operator.h.


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