18 template <typename T, nbool isBaseObj = tifSub<typename tadaptiveSuper<T>::super,
baseObj>::is>
class tbridger {
20 template <
typename Ret,
typename T1, n
bool,
template <
typename, n
bool>
class Marshaling,
typename... Args>
22 template <
typename T1>
friend class tbridge;
28 static scope& subs() {
return _get()._subs; }
30 static me& extend(
const scope&
src) {
35 static me&
func(
const std::string& name,
const baseFunc& bridgeFunc) {
36 _get().subs().add(name, bridgeFunc);
40 static me&
func(
const std::string* name,
const baseFunc& bridgeFunc)
41 BY_SIDE_FUNC(name,
func(*name, bridgeFunc), _get());
42 static me&
func(
const std::string& name,
const baseFunc* bridgeFunc)
43 BY_SIDE_FUNC(bridgeFunc,
func(name, *bridgeFunc), _get());
44 static me&
func(
const std::string* name,
const baseFunc* bridgeFunc)
45 BY_SIDE_FUNC(name&& bridgeFunc,
func(*name, *bridgeFunc), _get());
47 template <
typename... Args>
static me&
ctor() {
51 template <
typename Ret,
typename... Args>
static me&
func(
const std::string& name, Ret (T::*fptr)(Args...)) {
52 return funcNonConst(name, fptr);
55 template <
typename Ret,
typename... Args>
56 static me&
func(
const std::string* name, Ret (T::*fptr)(Args...)) BY_SIDE_FUNC(name,
func(*name, fptr), _get());
58 template <
typename Ret,
typename... Args>
59 static me&
func(
const std::string& name, Ret (T::*fptr)(Args...)
const) {
60 return funcConst(name, fptr);
63 template <
typename Ret,
typename... Args>
64 static me&
func(
const std::string* name, Ret (T::*fptr)(Args...)
const)
65 BY_SIDE_FUNC(name,
func(*name, fptr), _get());
67 template <
typename Ret,
typename... Args>
68 static me& funcNonConst(
const std::string& name, Ret (T::*fptr)(Args...)) {
72 template <
typename Ret,
typename... Args>
73 static me& funcNonConst(
const std::string* name, Ret (T::*fptr)(Args...))
74 BY_SIDE_FUNC(name, funcNonConst(*name, fptr), _get());
76 template <
typename Ret,
typename... Args>
77 static me& funcConst(
const std::string& name, Ret (T::*fptr)(Args...)
const) {
81 template <
typename Ret,
typename... Args>
82 static me& funcConst(
const std::string* name, Ret (T::*fptr)(Args...)
const)
83 BY_SIDE_FUNC(name, funcConst(*name, fptr), _get());
85 template <
typename Ret,
typename... Args>
86 static me& genericFunc(
const std::string& name, Ret (T::*fptr)(Args...)) {
90 template <
typename Ret,
typename... Args>
91 static me& genericFunc(
const std::string* name, Ret (T::*fptr)(Args...))
92 BY_SIDE_FUNC(name, genericFunc(*name, fptr), _get());
94 template <
typename Ret,
typename... Args>
95 static me& genericFunc(
const std::string& name, Ret (T::*fptr)(Args...)
const) {
100 template <
typename Ret,
typename... Args>
101 static me& genericFunc(
const std::string* name, Ret (T::*fptr)(Args...)
const)
102 BY_SIDE_FUNC(name, genericFunc(*name, fptr), _get());
104 template <
typename Ret,
typename... Args>
105 static me& genericFuncNonConst(
const std::string& name, Ret (T::*fptr)(Args...)) {
110 template <
typename Ret,
typename... Args>
111 static me& genericFuncNonConst(
const std::string* name, Ret (T::*fptr)(Args...))
112 BY_SIDE_FUNC(name, genericFuncNonConst(*name, fptr), _get());
114 template <
typename Ret,
typename... Args>
115 static me& genericFuncConst(
const std::string& name, Ret (T::*fptr)(Args...)
const) {
120 template <
typename Ret,
typename... Args>
121 static me& genericFuncConst(
const std::string* name, Ret (T::*fptr)(Args...)
const)
122 BY_SIDE_FUNC(name, genericFuncConst(*name, fptr), _get());
124 template <
typename Ret,
typename T1 = T,
typename... Args>
125 static me&
closure(
const std::string& name, std::function<Ret(T1&, Args...)> c) {
129 template <
typename Ret,
typename T1 = T,
typename... Args>
130 static me&
closure(
const std::string* name, std::function<Ret(T1&, Args...)> c)
131 BY_SIDE_FUNC(name,
closure(*name, c), _get());
133 template <
typename Ret,
typename T1 = T>
134 static me&
closure(
const std::string& name, std::function<Ret(T1&)> c) {
138 template <
typename Ret,
typename T1 = T>
139 static me&
closure(
const std::string* name, std::function<Ret(T1&)> c)
140 BY_SIDE_FUNC(name,
closure(*name, c), _get());
161 static scope& subs() {
return _get()._subs; }
163 static me& extend(
const scope&
src) {
168 static me&
func(
const std::string& name,
const baseFunc& bridgeFunc) {
169 _get().subs().add(name, bridgeFunc);
173 static me&
func(
const std::string& name,
const baseFunc* bridgeFunc) {
return func(name, *bridgeFunc); }
177 template <
typename... Args>
static me&
ctor() {
185 template <
typename Ret,
typename T1 = T,
typename... Args>
186 static me&
closure(
const std::string& name, std::function<Ret(T1&, Args...)> c) {
190 template <
typename Ret,
typename T1 = T>
191 static me&
closure(
const std::string& name, std::function<Ret(T1&)> c) {
195 template <
typename Ret,
typename... Args>
static me&
func(
const std::string& name, Ret (T::*fptr)(Args...)) {
196 return funcNonConst(name, fptr);
199 template <
typename Ret,
typename... Args>
200 static me&
func(
const std::string& name, Ret (T::*fptr)(Args...)
const) {
201 return funcConst(name, fptr);
204 template <
typename Ret,
typename... Args>
205 static me& funcNonConst(
const std::string& name, Ret (T::*fptr)(Args...)) {
209 template <
typename Ret,
typename... Args>
210 static me& funcConst(
const std::string& name, Ret (T::*fptr)(Args...)
const) {
211 typedef typename T::super s;
213 fun->setSrc(*
new src(dumSrcFile::singleton(), name,
point{0, 0}));
214 return func(name, fun);
217 template <
typename Ret,
typename... Args>
218 static me& genericFunc(
const std::string& name, Ret (T::*fptr)(Args...)) {
220 fun->setSrc(*
new src(dumSrcFile::singleton(), name,
point{0, 0}));
221 return func(name, fun);
224 template <
typename Ret,
typename... Args>
225 static me& genericFuncNonConst(
const std::string& name, Ret (T::*fptr)(Args...)) {
227 fun->setSrc(*
new src(dumSrcFile::singleton(), name,
point{0, 0}));
228 return func(name, fun);
231 template <
typename Ret,
typename... Args>
232 static me& genericFunc(
const std::string& name, Ret (T::*fptr)(Args...)
const) {
234 fun->setSrc(*
new src(dumSrcFile::singleton(), name,
point{0, 0}));
235 return func(name, fun);
238 template <
typename Ret,
typename... Args>
239 static me& genericFuncConst(
const std::string& name, Ret (T::*fptr)(Args...)
const) {
241 fun->setSrc(*
new src(dumSrcFile::singleton(), name,
point{0, 0}));
242 return func(name, fun);
Base class for all function types.
Definition: baseFunc.hpp:18
Base class for all objects in byeol language.
Definition: baseObj.hpp:24
func closure with captured object scope
Definition: closure.hpp:19
Constructor function for byeol objects.
Definition: ctor.hpp:11
Function definition in byeol language.
Definition: func.hpp:20
Source location information.
Definition: src.hpp:11
Bridge closure for C++ lambda/function objects.
Definition: tbridgeClosure.hpp:16
Bridge constructor for C++ objects.
Definition: tbridgeCtor.hpp:15
Definition: tbridgeFunc.hpp:72
Bridge template for C++ objects.
Definition: tbridge.hpp:17
Bridge builder for C++ classes.
Definition: tbridger.hpp:18
virtual nbool link(const iter &portion)
link to another chain instance. if iterator is not the begin of another chain, this chain won't link ...
Source code position tracking structure.
Definition: point.hpp:11
Definition: tgenericMarshaling.hpp:10
Template marshaling interface for C++ bridge.
Definition: tmarshaling.hpp:18