OpenVDB  8.0.1
Public Types | Public Member Functions | List of all members
FunctionGroup Struct Reference

todo More...

#include <FunctionTypes.h>

Public Types

using Ptr = std::shared_ptr< FunctionGroup >
 
using UniquePtr = std::unique_ptr< FunctionGroup >
 
using FunctionList = std::vector< Function::Ptr >
 

Public Member Functions

 FunctionGroup (const char *name, const char *doc, const FunctionList &list)
 
 ~FunctionGroup ()=default
 
Function::Ptr match (const std::vector< llvm::Type * > &types, llvm::LLVMContext &C, Function::SignatureMatch *type=nullptr) const
 Given a vector of llvm types, automatically returns the best possible function declaration from the stored function list. The 'best' declaration is determined by the provided types compatibility to each functions signature. More...
 
llvm::Value * execute (const std::vector< llvm::Value * > &args, llvm::IRBuilder<> &B) const
 Given a vector of llvm values provided by the user, find the best possible function signature, generate and execute the function body. Returns the return value of the function (can be void). More...
 
const FunctionListlist () const
 Accessor to the underlying function signature list. More...
 
const char * name () const
 
const char * doc () const
 

Detailed Description

todo

Member Typedef Documentation

◆ FunctionList

using FunctionList = std::vector<Function::Ptr>

◆ Ptr

using Ptr = std::shared_ptr<FunctionGroup>

◆ UniquePtr

using UniquePtr = std::unique_ptr<FunctionGroup>

Constructor & Destructor Documentation

◆ FunctionGroup()

FunctionGroup ( const char *  name,
const char *  doc,
const FunctionList list 
)
inline

◆ ~FunctionGroup()

~FunctionGroup ( )
default

Member Function Documentation

◆ doc()

const char* doc ( ) const
inline

◆ execute()

llvm::Value* execute ( const std::vector< llvm::Value * > &  args,
llvm::IRBuilder<> &  B 
) const

Given a vector of llvm values provided by the user, find the best possible function signature, generate and execute the function body. Returns the return value of the function (can be void).

Note
This function will throw if not compatible match is found or if no valid return is provided by the matched declarations implementation.
Parameters
argsA vector of values representing the function arguments
BThe current llvm IRBuilder

◆ list()

const FunctionList& list ( ) const
inline

Accessor to the underlying function signature list.

◆ match()

Function::Ptr match ( const std::vector< llvm::Type * > &  types,
llvm::LLVMContext &  C,
Function::SignatureMatch type = nullptr 
) const

Given a vector of llvm types, automatically returns the best possible function declaration from the stored function list. The 'best' declaration is determined by the provided types compatibility to each functions signature.

Note
If multiple implicit matches are found, the first match is returned.
Returns a nullptr if no compatible match was found or if the function list is empty. A compatible match is defined as an Explicit or Implicit match.
Parameters
typesA vector of types representing the function argument types
CThe llvm context
typeIf provided, type is set to the type of match that occurred

◆ name()

const char* name ( ) const
inline

The documentation for this struct was generated from the following file: