12#ifndef OPENVDB_AX_CODEGEN_FUNCTION_REGISTRY_HAS_BEEN_INCLUDED
13#define OPENVDB_AX_CODEGEN_FUNCTION_REGISTRY_HAS_BEEN_INCLUDED
19#include <openvdb/version.h>
21#include <unordered_map>
39 using Ptr = std::shared_ptr<FunctionRegistry>;
40 using UniquePtr = std::unique_ptr<FunctionRegistry>;
52 : mConstructor(creator), mFunction(), mInternal(
internal) {}
70 using RegistryMap = std::unordered_map<std::string, RegisteredFunction>;
78 void insert(
const std::string& identifier,
103 const bool allowInternalAccess);
112 const bool allowInternalAccess)
const;
124 inline bool empty()
const {
return mMap.empty(); }
127 inline void clear() { mMap.clear(); }
OpenVDB AX Compiler Options.
Contains frameworks for creating custom AX functions which can be registered within the FunctionRegis...
The function registry which is used for function code generation. Each time a function is visited wit...
Definition FunctionRegistry.h:36
std::shared_ptr< FunctionRegistry > Ptr
Definition FunctionRegistry.h:39
FunctionGroup::UniquePtr(*)(const FunctionOptions &) ConstructorT
Definition FunctionRegistry.h:38
const FunctionGroup * getOrInsert(const std::string &identifier, const FunctionOptions &op, const bool allowInternalAccess)
Return the corresponding function from a provided function identifier.
bool empty() const
Return whether or not the registry is empty.
Definition FunctionRegistry.h:124
std::unordered_map< std::string, RegisteredFunction > RegistryMap
Definition FunctionRegistry.h:70
const RegistryMap & map() const
Return a const reference to the current registry map.
Definition FunctionRegistry.h:121
void createAll(const FunctionOptions &op, const bool verify=false)
Force the (re)creations of all function objects for all registered functions.
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 * get(const std::string &identifier, const bool allowInternalAccess) const
Return the corresponding function from a provided function identifier.
void insert(const std::string &identifier, const ConstructorT creator, const bool internal=false)
Insert and register a function object to a function identifier.
void clear()
Clear the underlying function registry.
Definition FunctionRegistry.h:127
std::unique_ptr< FunctionRegistry > UniquePtr
Definition FunctionRegistry.h:40
Definition Exceptions.h:13
Options that control how functions behave.
Definition CompilerOptions.h:25
todo
Definition FunctionTypes.h:794
std::shared_ptr< FunctionGroup > Ptr
Definition FunctionTypes.h:795
std::unique_ptr< FunctionGroup > UniquePtr
Definition FunctionTypes.h:796
RegisteredFunction(const ConstructorT &creator, const bool internal=false)
Constructor.
Definition FunctionRegistry.h:51
const FunctionGroup * function() const
Return a pointer to this function definition.
Definition FunctionRegistry.h:59
void create(const FunctionOptions &op)
Create a function object using this creator of this function.
Definition FunctionRegistry.h:56
bool isInternal() const
Check whether this function should be only internally accesible.
Definition FunctionRegistry.h:62
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:218