The function registry which is used for function code generation. Each time a function is visited within the AST, its identifier is used as a key into this registry for the corresponding function retrieval and execution. Functions can be inserted into the registry using insert() with a given identifier and pointer.
More...
#include <openvdb_ax/codegen/FunctionRegistry.h>
|
struct | RegisteredFunction |
| An object to represent a registered function, storing its constructor, a pointer to the function definition and whether it should only be available internally (i.e. to a developer, not a user) More...
|
|
|
void | insert (const std::string &identifier, const ConstructorT creator, const bool internal=false) |
| Insert and register a function object to a function identifier.
|
|
void | insertAndCreate (const std::string &identifier, const ConstructorT creator, const FunctionOptions &op, const bool internal=false) |
| Insert and register a function object to a function identifier.
|
|
const FunctionGroup * | getOrInsert (const std::string &identifier, const FunctionOptions &op, const bool allowInternalAccess) |
| Return the corresponding function from a provided function identifier.
|
|
const FunctionGroup * | get (const std::string &identifier, const bool allowInternalAccess) const |
| Return the corresponding function from a provided function identifier.
|
|
void | createAll (const FunctionOptions &op, const bool verify=false) |
| Force the (re)creations of all function objects for all registered functions.
|
|
const RegistryMap & | map () const |
| Return a const reference to the current registry map.
|
|
bool | empty () const |
| Return whether or not the registry is empty.
|
|
void | clear () |
| Clear the underlying function registry.
|
|
The function registry which is used for function code generation. Each time a function is visited within the AST, its identifier is used as a key into this registry for the corresponding function retrieval and execution. Functions can be inserted into the registry using insert() with a given identifier and pointer.
◆ ConstructorT
◆ Ptr
◆ RegistryMap
◆ UniquePtr
◆ clear()
Clear the underlying function registry.
◆ createAll()
Force the (re)creations of all function objects for all registered functions.
- Parameters
-
op | The current function options |
verify | Checks functions are created and have valid identifiers/symbols |
◆ empty()
Return whether or not the registry is empty.
◆ get()
const FunctionGroup * get |
( |
const std::string & | identifier, |
|
|
const bool | allowInternalAccess ) const |
Return the corresponding function from a provided function identifier.
- Note
- Returns a nullptr if no such function identifier has been registered or if the function is marked as internal
- Parameters
-
identifier | The function identifier |
allowInternalAccess | Whether to look in the 'internal' functions |
◆ getOrInsert()
Return the corresponding function from a provided function identifier.
- Note
- Returns a nullptr if no such function identifier has been registered or if the function is marked as internal
- Parameters
-
identifier | The function identifier |
op | FunctionOptions to pass the function constructor |
allowInternalAccess | Whether to look in the 'internal' functions |
◆ insert()
void insert |
( |
const std::string & | identifier, |
|
|
const ConstructorT | creator, |
|
|
const bool | internal = false ) |
Insert and register a function object to a function identifier.
- Note
- Throws if the identifier is already registered
- Parameters
-
identifier | The function identifier to register |
creator | The function to link to the provided identifier |
internal | Whether to mark the function as only internally accessible |
◆ insertAndCreate()
void insertAndCreate |
( |
const std::string & | identifier, |
|
|
const ConstructorT | creator, |
|
|
const FunctionOptions & | op, |
|
|
const bool | internal = false ) |
Insert and register a function object to a function identifier.
- Note
- Throws if the identifier is already registered
- Parameters
-
identifier | The function identifier to register |
creator | The function to link to the provided identifier |
op | FunctionOptions to pass the function constructor |
internal | Whether to mark the function as only internally accessible |
◆ map()
Return a const reference to the current registry map.