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) {}
59 inline const FunctionGroup*
function()
const {
return mFunction.get(); }
70 using RegistryMap = std::unordered_map<std::string, RegisteredFunction>;
78 void insert(
const std::string& identifier,
80 const bool internal =
false);
89 void insertAndCreate(
const std::string& identifier,
92 const bool internal =
false);
101 const FunctionGroup* getOrInsert(
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(); }
138 #endif // OPENVDB_AX_CODEGEN_FUNCTION_REGISTRY_HAS_BEEN_INCLUDED std::unique_ptr< FunctionRegistry > UniquePtr
Definition: FunctionRegistry.h:40
void create(const FunctionOptions &op)
Create a function object using this creator of this function.
Definition: FunctionRegistry.h:56
std::unordered_map< std::string, RegisteredFunction > RegistryMap
Definition: FunctionRegistry.h:70
std::unique_ptr< FunctionGroup > UniquePtr
Definition: FunctionTypes.h:796
bool empty() const
Return whether or not the registry is empty.
Definition: FunctionRegistry.h:124
Contains frameworks for creating custom AX functions which can be registered within the FunctionRegis...
bool isInternal() const
Check whether this function should be only internally accesible.
Definition: FunctionRegistry.h:62
An object to represent a registered function, storing its constructor, a pointer to the function defi...
Definition: FunctionRegistry.h:46
std::shared_ptr< FunctionGroup > Ptr
Definition: FunctionTypes.h:795
void clear()
Clear the underlying function registry.
Definition: FunctionRegistry.h:127
Definition: Exceptions.h:13
OpenVDB AX Compiler Options.
std::shared_ptr< FunctionRegistry > Ptr
Definition: FunctionRegistry.h:39
todo
Definition: FunctionTypes.h:793
FunctionGroup::UniquePtr(*)(const FunctionOptions &) ConstructorT
Definition: FunctionRegistry.h:38
Options that control how functions behave.
Definition: CompilerOptions.h:24
The function registry which is used for function code generation. Each time a function is visited wit...
Definition: FunctionRegistry.h:35
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
const RegistryMap & map() const
Return a const reference to the current registry map.
Definition: FunctionRegistry.h:121
RegisteredFunction(const ConstructorT &creator, const bool internal=false)
Constructor.
Definition: FunctionRegistry.h:51
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:218