taco-db
0.1.0
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
v
w
Variables
a
b
c
d
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
~
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
~
Variables
_
a
b
c
d
f
i
l
m
n
p
r
s
t
u
v
Typedefs
Related Functions
a
b
c
d
f
i
l
n
p
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Functions
Variables
Typedefs
Macros
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
base
fmgr.h
Go to the documentation of this file.
1
13
namespace
taco
{
14
15
21
struct
FunctionCallInfo
22
{
23
std::vector<NullableDatumRef>
args
;
24
uint64_t
typparam
;
25
};
26
27
28
typedef
Datum
(*
FunctionPtr
)(
FunctionCallInfo
&fcinfo);
29
50
typedef
std::function<
Datum
(
FunctionCallInfo
&)>
FunctionInfo
;
51
52
/* Standard parameter list for fmgr-compatible functions */
53
#define FMGR_FUNCTION_ARGS ::taco::FunctionCallInfo &fcinfo_
54
58
#define FMGR_NARGS() (fcinfo_.args.size())
59
63
#define FMGR_ARG(n) (fcinfo_.args[n])
64
69
#define FMGR_TYPPARAM() (fcinfo_.typparam)
70
75
#define FMGR_RETURN_VOID() return Datum::From(0)
76
80
template
<
class
...Args>
81
Datum
82
FunctionCall
(
const
FunctionInfo
&func, Args&& ...args) {
83
FunctionCallInfo
flinfo {
84
.
args
= std::vector<NullableDatumRef>{std::forward<Args>(args)...},
85
.typparam = 0
86
};
87
88
return
func(flinfo);
89
}
90
91
/*
92
* Call a function with a type parameter for the return type.
93
*/
94
template
<
class
...Args>
95
Datum
96
FunctionCallWithTypparam
(
const
FunctionInfo
&func,
97
uint64_t typparam,
98
Args&& ...args) {
99
FunctionCallInfo
flinfo {
100
.
args
= std::vector<NullableDatumRef>{std::forward<Args>(args)...},
101
.typparam = typparam,
102
};
103
104
return
func(flinfo);
105
}
106
107
}
// namespace taco
108
taco
Definition:
datum.h:28
taco::FunctionInfo
std::function< Datum(FunctionCallInfo &)> FunctionInfo
An FMGR managed function should be declared as.
Definition:
fmgr.h:50
taco::FunctionCallWithTypparam
Datum FunctionCallWithTypparam(const FunctionInfo &func, uint64_t typparam, Args &&...args)
Definition:
fmgr.h:96
taco::FunctionCallInfo
This struct is the data actually passed to an fmgr function.
Definition:
fmgr.h:21
taco::FunctionPtr
Datum(* FunctionPtr)(FunctionCallInfo &fcinfo)
Definition:
fmgr.h:28
taco::FunctionCallInfo::typparam
uint64_t typparam
Definition:
fmgr.h:24
taco::Datum
A Datum stores and possibly manage the memory resource of a read-only value of a plain fixed-length C...
Definition:
datum.h:250
taco::FunctionCallInfo::args
std::vector< NullableDatumRef > args
Definition:
fmgr.h:23
taco::FunctionCall
Datum FunctionCall(const FunctionInfo &func, Args &&...args)
Call a function without passing any type parameter for the return type.
Definition:
fmgr.h:82
Generated by
1.8.17