TTTT Analysis
0.1
|
In order to enable proper provenance tracking, and at the same time keep the ability to embed functions into values, the Function class should be used. More...
#include <value.hpp>
Public Member Functions | |
Function (const std::string &name, const std::string &impl, std::function< R(ArgTypes...)> f) | |
Function (const std::string &name, std::function< R(ArgTypes...)> f) | |
R | operator() (ArgTypes ...args) |
![]() | |
GenFunction (const std::string &name, const std::string &impl) | |
std::string & | get_name () |
Private Attributes | |
std::function< R(ArgTypes...)> | f |
Additional Inherited Members | |
![]() | |
static std::string | format_code (const std::string &code) |
Attempt to invoke clang-format for the purpose of printing out nicely formatted functions to the log file. More... | |
static std::string | summary () |
template<typename T > | |
static Function< T > & | register_function (const std::string &name, std::function< T > f, const std::string &impl) |
template<typename T > | |
static Function< T > & | lookup_function (const std::string &name) |
![]() | |
static std::map< const std::string, GenFunction * > | function_registry |
Static mapping of functions from their name to the object wrapper of the function. | |
![]() | |
static bool | in_register_function =false |
In order to enable proper provenance tracking, and at the same time keep the ability to embed functions into values, the Function class should be used.
It is simply a wrapper around a std::function that also has a name. This name is used when generating the name of values that use the function. A function name is automatically prepended with "func::" to explicitly state that the value is the result of a computation encoded within the function object, and not from some other Value object. Unfortunately, it is up to the user to find where that function is defined in the source code to inspect what it is doing. But hopefully this isn't too onerous by just using grep.