function_pack_t Struct Reference |
Public Member Functions | |
void | clear () |
any_regular_t | operator() (name_t function, const array_t &argument_set) const |
any_regular_t | operator() (array_t &argument_set) const |
any_regular_t | operator() (dictionary_t &named_argument_set) const |
any_regular_t | operator() (name_t function, const dictionary_t &named_argument_set) const |
any_regular_t | operator() (name_t function, array_t &argument_set) const |
any_regular_t | operator() (const dictionary_t &named_argument_set) const |
any_regular_t | operator() (name_t function, dictionary_t &named_argument_set) const |
any_regular_t | operator() (const array_t &argument_set) const |
template<typename F > | |
void | register_function (name_t name, const F &f, name_t arg1_name, name_t arg2_name, name_t arg3_name) |
template<typename F > | |
void | register_function (name_t name, const F &f, name_t arg1_name, name_t arg2_name) |
template<typename F > | |
void | register_function (name_t name, const F &f, name_t arg1_name, name_t arg2_name, name_t arg3_name, name_t arg4_name, name_t arg5_name, name_t arg6_name) |
template<typename F > | |
void | register_function (name_t name, const F &f, name_t arg1_name, name_t arg2_name, name_t arg3_name, name_t arg4_name, name_t arg5_name, name_t arg6_name, name_t arg7_name) |
template<typename F > | |
void | register_function (name_t name, const F &f) |
template<typename F > | |
void | register_function (name_t name, const F &f, name_t arg1_name, name_t arg2_name, name_t arg3_name, name_t arg4_name, name_t arg5_name) |
template<typename F > | |
void | register_function (name_t name, const F &f, name_t arg1_name, name_t arg2_name, name_t arg3_name, name_t arg4_name) |
template<typename F > | |
void | register_function (name_t name, const F &f, name_t arg1_name) |
void | register_named (name_t name, const dictionary_function_t &f) |
template<typename F > | |
void | register_named0_function (name_t name, const F &f) |
void | register_unnamed (name_t name, const array_function_t &f) |
Related Functions | |
(Note that these are not member functions.) | |
void | attach (virtual_machine_t &vm, const function_pack_t &pack) |
Detailed Description
This collection is also useful when tying into the array- and dictionary-based function lookup routines for the virtual_machine_t class. There is a related routine used to attach this class to the latter.
- Note:
- The array_t and dictionary_t are passed as const into the lookup routine. As such, non-const parameters will not work.
- As array_t and dictionary_t are containers of types that model Regular, the parameters you pass must model the Regular concept. This differs from the argument types of the functions you register into the pack: they need not be regular (e.g. const references are OK).
- The unnamed and named function collections are kept separately from one another. Thus while it may be more confusing suring usage, it is possible to reference to different functions (one unnamed, the other named) with the same name_t identifier.
- Don't forget that a member function has a minimum arity of 1 (the 'this' of the member function routine).
Definition at line 604 of file function_pack.hpp.
Member Function Documentation
void clear | ( | ) |
Definition at line 834 of file function_pack.hpp.
any_regular_t operator() | ( | name_t | function, |
const array_t & | argument_set | ||
) | const |
Routine for invoking one of the registered functions with a const unnamed argument set.
Definition at line 741 of file function_pack.hpp.
any_regular_t operator() | ( | array_t & | argument_set ) | const |
Routine for invoking one of the registered functions with a nonconst unnamed argument set. The name of the function to invoke is extracted out of the array at the 0th index
Definition at line 801 of file function_pack.hpp.
any_regular_t operator() | ( | dictionary_t & | named_argument_set ) | const |
Routine for invoking one of the registered functions with a nonconst named argument set. The name of the function to invoke is extracted out of the dictionary under the command
named argument
Definition at line 815 of file function_pack.hpp.
any_regular_t operator() | ( | name_t | function, |
const dictionary_t & | named_argument_set | ||
) | const |
Routine for invoking one of the registered functions with a const named argument set.
Definition at line 749 of file function_pack.hpp.
any_regular_t operator() | ( | name_t | function, |
array_t & | argument_set | ||
) | const |
Routine for invoking one of the registered functions with a nonconst unnamed argument set.
Definition at line 757 of file function_pack.hpp.
any_regular_t operator() | ( | const dictionary_t & | named_argument_set ) | const |
Routine for invoking one of the registered functions with a const named argument set. The name of the function to invoke is extracted out of the dictionary under the command
named argument
Definition at line 788 of file function_pack.hpp.
any_regular_t operator() | ( | name_t | function, |
dictionary_t & | named_argument_set | ||
) | const |
Routine for invoking one of the registered functions with a nonconst named argument set.
Definition at line 765 of file function_pack.hpp.
any_regular_t operator() | ( | const array_t & | argument_set ) | const |
Routine for invoking one of the registered functions with a const unnamed argument set. The name of the function to invoke is extracted out of the array at the 0th index
Definition at line 774 of file function_pack.hpp.
void register_function | ( | name_t | name, |
const F & | f, | ||
name_t | arg1_name, | ||
name_t | arg2_name, | ||
name_t | arg3_name | ||
) |
This routine is used to register named functions of arity 3 to the function pack.
- Note:
- The arity of the original function is asserted to be 3 at compile time.
Definition at line 668 of file function_pack.hpp.
This routine is used to register named functions of arity 2 to the function pack.
- Note:
- The arity of the original function is asserted to be 2 at compile time.
Definition at line 655 of file function_pack.hpp.
void register_function | ( | name_t | name, |
const F & | f, | ||
name_t | arg1_name, | ||
name_t | arg2_name, | ||
name_t | arg3_name, | ||
name_t | arg4_name, | ||
name_t | arg5_name, | ||
name_t | arg6_name | ||
) |
This routine is used to register named functions of arity 6 to the function pack.
- Note:
- The arity of the original function is asserted to be 6 at compile time.
Definition at line 713 of file function_pack.hpp.
void register_function | ( | name_t | name, |
const F & | f, | ||
name_t | arg1_name, | ||
name_t | arg2_name, | ||
name_t | arg3_name, | ||
name_t | arg4_name, | ||
name_t | arg5_name, | ||
name_t | arg6_name, | ||
name_t | arg7_name | ||
) |
This routine is used to register named functions of arity 7 to the function pack.
- Note:
- The arity of the original function is asserted to be 7 at compile time.
Definition at line 729 of file function_pack.hpp.
void register_function | ( | name_t | name, |
const F & | f | ||
) |
This routine is used to register unnamed functions of any arity to the function pack.
Definition at line 617 of file function_pack.hpp.
void register_function | ( | name_t | name, |
const F & | f, | ||
name_t | arg1_name, | ||
name_t | arg2_name, | ||
name_t | arg3_name, | ||
name_t | arg4_name, | ||
name_t | arg5_name | ||
) |
This routine is used to register named functions of arity 5 to the function pack.
- Note:
- The arity of the original function is asserted to be 5 at compile time.
Definition at line 695 of file function_pack.hpp.
void register_function | ( | name_t | name, |
const F & | f, | ||
name_t | arg1_name, | ||
name_t | arg2_name, | ||
name_t | arg3_name, | ||
name_t | arg4_name | ||
) |
This routine is used to register named functions of arity 4 to the function pack.
- Note:
- The arity of the original function is asserted to be 4 at compile time.
Definition at line 681 of file function_pack.hpp.
This routine is used to register named functions of arity 1 to the function pack.
- Note:
- The arity of the original function is asserted to be 1 at compile time.
Definition at line 642 of file function_pack.hpp.
void register_named | ( | name_t | name, |
const dictionary_function_t & | f | ||
) |
Definition at line 829 of file function_pack.hpp.
void register_named0_function | ( | name_t | name, |
const F & | f | ||
) |
This routine is specifically used to register named functions of arity 0 to the function pack.
Definition at line 630 of file function_pack.hpp.
void register_unnamed | ( | name_t | name, |
const array_function_t & | f | ||
) |
Definition at line 824 of file function_pack.hpp.
Friends And Related Function Documentation
void attach | ( | virtual_machine_t & | vm, |
const function_pack_t & | pack | ||
) | [related] |
Binds a function pack to an virtual_machine_t as the array- and dictionary-based function lookup mechanism.
- Note:
- The function pack must have a lifetime that is at least equal to that of the VM
Definition at line 914 of file function_pack.hpp.