taco-db  0.1.0
Classes | Namespaces | Macros | Typedefs | Functions
fmgr.h File Reference

This file contains the definition of the function manager and function-call interface, which is a simplified version of fmgr.h in PostgreSQL. More...

Go to the source code of this file.

Classes

struct  taco::FunctionCallInfo
 This struct is the data actually passed to an fmgr function. More...
 

Namespaces

 taco
 

Macros

#define FMGR_FUNCTION_ARGS   ::taco::FunctionCallInfo &fcinfo_
 
#define FMGR_NARGS()   (fcinfo_.args.size())
 Get number of arguments passed to the function. More...
 
#define FMGR_ARG(n)   (fcinfo_.args[n])
 Get the n^th argument passed to the function. More...
 
#define FMGR_TYPPARAM()   (fcinfo_.typparam)
 Get the type parameter passed to the function. More...
 
#define FMGR_RETURN_VOID()   return Datum::From(0)
 If any function needs to return void, use this macro. More...
 

Typedefs

typedef Datum(* taco::FunctionPtr) (FunctionCallInfo &fcinfo)
 
typedef std::function< Datum(FunctionCallInfo &)> taco::FunctionInfo
 An FMGR managed function should be declared as. More...
 

Functions

template<class ... Args>
Datum taco::FunctionCall (const FunctionInfo &func, Args &&...args)
 Call a function without passing any type parameter for the return type. More...
 
template<class ... Args>
Datum taco::FunctionCallWithTypparam (const FunctionInfo &func, uint64_t typparam, Args &&...args)
 

Detailed Description

This file contains the definition of the function manager and function-call interface, which is a simplified version of fmgr.h in PostgreSQL.

See COPYRIGHT for a copyright notice of code copied or derived from PostgreSQL.

This file does not have a header guard intentionally. It must be included indirectly from base/tdb_base.h.

Macro Definition Documentation

◆ FMGR_ARG

#define FMGR_ARG (   n)    (fcinfo_.args[n])

Get the n^th argument passed to the function.

◆ FMGR_FUNCTION_ARGS

#define FMGR_FUNCTION_ARGS   ::taco::FunctionCallInfo &fcinfo_

◆ FMGR_NARGS

#define FMGR_NARGS ( )    (fcinfo_.args.size())

Get number of arguments passed to the function.

◆ FMGR_RETURN_VOID

#define FMGR_RETURN_VOID ( )    return Datum::From(0)

If any function needs to return void, use this macro.

Don't return a NULL value.

◆ FMGR_TYPPARAM

#define FMGR_TYPPARAM ( )    (fcinfo_.typparam)

Get the type parameter passed to the function.

Only valid when the function is called with FunctionCallWithTypparam().