FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java4cpp/src/main/resources/cpp_start_class.cpp at java4cpp-1.4 · wshackle/java4cpp · GitHub
wshackle
/
java4cpp
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
9
Code
Issues
1
Pull requests
1
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
java4cpp
/
src
/
main
/
resources
/
cpp_start_class.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (37 loc) · 1.79 KB
Breadcrumbs
java4cpp
/
src
/
main
/
resources
/
cpp_start_class.cpp
Copy path
File metadata and controls
42 lines (37 loc) · 1.79 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
42
//
%%%% Lines beginning with "//%%%%" are template comments and removed from final output.
//
%%%% "%NAMESPACE%" will be replaced with namespace
//
%%%% "%HEADER%" will be replaced with header
//
%%%% "%HEADER_DEFINE%" will be replaced with defined value used to prevent multiple inclusion
//
%%%% "%CLASS_NAME%" will be replaced with className (not including package
//
%%% "%BASE_CLASS_FULL_NAME%" full name of this class's Base class.
//
%%%% "%OBJECT_CLASS_FULL_NAME%" will be replaced with className (not including package
//
get JNI handle for class %FULL_CLASS_NAME%
static
inline
jclass get%
CLASS_NAME
%Class();
%
CLASS_NAME
%::%
CLASS_NAME
%(jobject _jthis,
bool
copy): %
BASE_CLASS_FULL_NAME
%(_jthis,copy) {
%
INITIALIZE_CONTEXT
%
}
%
CLASS_NAME
%::%
CLASS_NAME
%(
const
%
CLASS_NAME
% &objref): %
BASE_CLASS_FULL_NAME
%((jobject)
NULL
,
false
) {
%
INITIALIZE_CONTEXT_REF
%
jobject _jthis = objref.
jthis
;
if
(
GetDebugJ4Cpp
())
DebugPrintJObject
(__FILE__,__LINE__,
"
Copy Constructor for class %CLASS_NAME% _jthis=
"
,_jthis);
if
(_jthis !=
NULL
) {
jthis =
getEnv
()->
NewGlobalRef
(_jthis);
if
(
GetDebugJ4Cpp
())
DebugPrintJObject
(__FILE__,__LINE__,
"
Copy Constructor for class %CLASS_NAME% jthis=
"
,jthis);
}
}
%
CLASS_NAME
% %
CLASS_NAME
%::cast(
const
%
OBJECT_CLASS_FULL_NAME
% &objref) {
JNIEnv *env =
getEnv
();
static
jclass cls = get%
CLASS_NAME
%
Class
();
jclass objcls = env->
GetObjectClass
(objref.
jthis
);
if
(!env->
IsAssignableFrom
(objcls,cls)) {
throw
objcls;
}
%
CLASS_NAME
%
retVal
(objref.
jthis
,
true
);
return
retVal;
}
bool
%
CLASS_NAME
%::instanceof(
const
%
OBJECT_CLASS_FULL_NAME
% &objref) {
JNIEnv *env =
getEnv
();
static
jclass cls = get%
CLASS_NAME
%
Class
();
jclass objcls = env->
GetObjectClass
(objref.
jthis
);
return
(
JNI_TRUE
== env->
IsAssignableFrom
(objcls,cls));
}
Back
|
FazBrowse Home
|
New Git URL