Go to the documentation of this file.
12 #ifndef OPENVDB_AX_CODEGEN_FUNCTION_REGISTRY_HAS_BEEN_INCLUDED
13 #define OPENVDB_AX_CODEGEN_FUNCTION_REGISTRY_HAS_BEEN_INCLUDED
18 #include "../compiler/CompilerOptions.h"
20 #include <openvdb/version.h>
22 #include <unordered_map>
40 using Ptr = std::shared_ptr<FunctionRegistry>;
41 using UniquePtr = std::unique_ptr<FunctionRegistry>;
53 : mConstructor(creator), mFunction(), mInternal(internal) {}
60 inline const FunctionGroup*
function()
const {
return mFunction.get(); }
71 using RegistryMap = std::unordered_map<std::string, RegisteredFunction>;
79 void insert(
const std::string& identifier,
81 const bool internal =
false);
90 void insertAndCreate(
const std::string& identifier,
93 const bool internal =
false);
102 const FunctionGroup* getOrInsert(
const std::string& identifier,
104 const bool allowInternalAccess);
113 const bool allowInternalAccess)
const;
125 inline bool empty()
const {
return mMap.empty(); }
128 inline void clear() { mMap.clear(); }
139 #endif // OPENVDB_AX_CODEGEN_FUNCTION_REGISTRY_HAS_BEEN_INCLUDED
Consolidated llvm types for most supported types.
Options that control how functions behave.
Definition: CompilerOptions.h:24
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:116
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:178
bool empty() const
Return whether or not the registry is empty.
Definition: FunctionRegistry.h:125
RegisteredFunction(const ConstructorT &creator, const bool internal=false)
Constructor.
Definition: FunctionRegistry.h:52
bool isInternal() const
Check whether this function should be only internally accesible.
Definition: FunctionRegistry.h:63
The function registry which is used for function code generation. Each time a function is visited wit...
Definition: FunctionRegistry.h:36
FunctionGroup::UniquePtr(*)(const FunctionOptions &) ConstructorT
Definition: FunctionRegistry.h:39
todo
Definition: FunctionTypes.h:790
const RegistryMap & map() const
Return a const reference to the current registry map.
Definition: FunctionRegistry.h:122
std::shared_ptr< FunctionGroup > Ptr
Definition: FunctionTypes.h:792
void clear()
Clear the underlying function registry.
Definition: FunctionRegistry.h:128
void create(const FunctionOptions &op)
Create a function object using this creator of this function.
Definition: FunctionRegistry.h:57
An object to represent a registered function, storing its constructor, a pointer to the function defi...
Definition: FunctionRegistry.h:47
Contains frameworks for creating custom AX functions which can be registered within the FunctionRegis...
std::unique_ptr< FunctionGroup > UniquePtr
Definition: FunctionTypes.h:793
std::shared_ptr< FunctionRegistry > Ptr
Definition: FunctionRegistry.h:40
Definition: openvdb/Exceptions.h:13
std::unordered_map< std::string, RegisteredFunction > RegistryMap
Definition: FunctionRegistry.h:71
std::unique_ptr< FunctionRegistry > UniquePtr
Definition: FunctionRegistry.h:41