tcalc 0.2.0
 
Loading...
Searching...
No Matches
tcalc::builtins::FunctionWrapper Class Reference

Wrapper for User-defined functions. More...

#include <builtins.hpp>

Public Member Functions

 FunctionWrapper (ast::NodePtr< ast::FdefNode > node)
 Construct a new Function Wrapper object.
 
error::Result< double > operator() (const std::vector< double > &args, const EvalContext &ctx) const
 Evaluate the function.
 

Detailed Description

Wrapper for User-defined functions.

Constructor & Destructor Documentation

◆ FunctionWrapper()

tcalc::builtins::FunctionWrapper::FunctionWrapper ( ast::NodePtr< ast::FdefNode node)
inlineexplicit

Construct a new Function Wrapper object.

Parameters
nodeFunction definition node.

Member Function Documentation

◆ operator()()

error::Result< double > tcalc::builtins::FunctionWrapper::operator() ( const std::vector< double > &  args,
const EvalContext ctx 
) const

Evaluate the function.

Parameters
argsFunction arguments.
ctxEvaluation context.
Returns
error::Result<double> Evaluation result.

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