libqasm
library for handling cQASM files
|
Table of all overloads of all constant propagation functions. More...
Public Member Functions | |
FunctionTable () | |
~FunctionTable () | |
FunctionTable (const FunctionTable &t) | |
FunctionTable (FunctionTable &&t) | |
FunctionTable & | operator= (const FunctionTable &t) |
FunctionTable & | operator= (FunctionTable &&t) |
void | add (const std::string &name, const types::Types ¶m_types, const FunctionImpl &impl) |
Registers a function. More... | |
values::Value | call (const std::string &name, const values::Values &args) const |
Calls a function. More... | |
Table of all overloads of all constant propagation functions.
Definition at line 79 of file cqasm-v1-resolver.hpp.
#include <cqasm-v1-resolver.hpp>
cqasm::v1::resolver::FunctionTable::FunctionTable | ( | ) |
Definition at line 216 of file cqasm-v1-resolver.cpp.
cqasm::v1::resolver::FunctionTable::~FunctionTable | ( | ) |
Definition at line 217 of file cqasm-v1-resolver.cpp.
cqasm::v1::resolver::FunctionTable::FunctionTable | ( | const FunctionTable & | t | ) |
Definition at line 218 of file cqasm-v1-resolver.cpp.
cqasm::v1::resolver::FunctionTable::FunctionTable | ( | FunctionTable && | t | ) |
Definition at line 219 of file cqasm-v1-resolver.cpp.
FunctionTable & cqasm::v1::resolver::FunctionTable::operator= | ( | const FunctionTable & | t | ) |
Definition at line 220 of file cqasm-v1-resolver.cpp.
FunctionTable & cqasm::v1::resolver::FunctionTable::operator= | ( | FunctionTable && | t | ) |
Definition at line 224 of file cqasm-v1-resolver.cpp.
void cqasm::v1::resolver::FunctionTable::add | ( | const std::string & | name, |
const types::Types & | param_types, | ||
const FunctionImpl & | impl | ||
) |
Registers a function.
The name should be lowercase; matching will be done case-insensitively. The param_types variadic specifies the amount and types of the parameters that (this particular overload of) the function expects. The C++ implementation of the function can assume that the value list it gets is of the right size and the values are of the right types.
This method does not contain any intelligence to override previously added overloads. However, the overload resolution engine will always use the last applicable overload it finds, so adding does have the effect of overriding.
Definition at line 242 of file cqasm-v1-resolver.cpp.
Value cqasm::v1::resolver::FunctionTable::call | ( | const std::string & | name, |
const values::Values & | args | ||
) | const |
Calls a function.
Throws NameResolutionFailure if no function by the given name exists, OverloadResolutionFailure if no overload of the function exists for the given arguments, or otherwise returns the value returned by the function.
Definition at line 252 of file cqasm-v1-resolver.cpp.