FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
daScript/include/daScript/ast/ast_typefactory_bind.h at master · PushoN/daScript · GitHub
PushoN
/
daScript
Public
forked from
GaijinEntertainment/daScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
daScript
/
include
/
daScript
/
ast
/
ast_typefactory_bind.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (36 loc) · 1.15 KB
Breadcrumbs
daScript
/
include
/
daScript
/
ast
/
ast_typefactory_bind.h
Copy path
File metadata and controls
41 lines (36 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
pragma
once
#
include
"
ast_typefactory.h
"
namespace
das
{
//
note:
//
this binds any unspecified 'callback' thing to 'void *'
//
generally this is included with generated headers
template
<
typename
ResT,
typename
...Args>
struct
typeFactory
<ResT (*)(Args...)> {
static
TypeDeclPtr
make
(
const
ModuleLibrary & library ) {
return
typeFactory<
void
*>::
make
(library);
};
};
//
note:
//
this is here to pass strings safely
template
<>
struct
cast_arg
<
char
*> {
static
__forceinline
char
*
to
( Context & ctx, SimNode * node ) {
char
* res = node->
evalPtr
(ctx);
return
res ? res : ((
char
*)
"
"
);
}
};
template
<>
struct
cast_arg
<
const
char
*> {
static
__forceinline
char
*
to
( Context & ctx, SimNode * node ) {
char
* res = node->
evalPtr
(ctx);
return
res ? res : ((
char
*)
"
"
);
}
};
template
<>
struct
cast_arg
<das::string> {
static
__forceinline string
to
( Context & ctx, SimNode * node ) {
auto
res = (das::string *) node->
evalPtr
(ctx);
return
*res;
}
};
}
Back
|
FazBrowse Home
|
New Git URL