Turi Create  4.0
turi::lazy_eval_operation_base< T > Struct Template Referenceabstract

#include <core/storage/lazy_eval/lazy_eval_operation.hpp>

Public Member Functions

virtual size_t num_arguments ()=0
 
virtual std::string name () const
 
virtual void execute (T &output, const std::vector< T *> &parents)=0
 

Detailed Description

template<typename T>
struct turi::lazy_eval_operation_base< T >

The base class for describing lazy operations using the lazy_operation_dag system.

Template Parameters
TThe object type tracked in the lazy operation DAG

Definition at line 21 of file lazy_eval_operation.hpp.

Member Function Documentation

◆ execute()

template<typename T >
virtual void turi::lazy_eval_operation_base< T >::execute ( T &  output,
const std::vector< T *> &  parents 
)
pure virtual

Execute the operation on the object, and the parents provided. The size of the "parents" list is max(#arguments - 2, 0).

  • For the Nullary function (function of 0 arguments, i.e. o = f() ) the size of the parents list is empty, and the operation should be performed on the output object directly.
  • For the Unary function (function of 1 argument. i.e. o = f(a1) ) the output object is the "parent" object , and the operation should be performed inplace. i.e, it shoud really compute ( o = f(o) )
  • For the Binary function (function of 2 arguments) ( o = f(a1, a2) ) the output object is the also the 1st parent, and the ancestor list contains a pointer to the 2nd parent. i.e. it should really compute ( o = f(o, a2) )
  • Operations of higher order generalize and extend accordingly.

◆ name()

template<typename T >
virtual std::string turi::lazy_eval_operation_base< T >::name ( ) const
inlinevirtual

Printable name of the operation

Definition at line 36 of file lazy_eval_operation.hpp.

◆ num_arguments()

template<typename T >
virtual size_t turi::lazy_eval_operation_base< T >::num_arguments ( )
pure virtual

Number of arguments in the operation. For instance, a simple transformation (like "add_row") is a unary transform, and this function will return 1. A "join" is a binary transform, and will return 2. Finally, parent-less operations like "load_from_file" will return 0.

The only valid values at this time are 0, 1 or 2.


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