Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v9 / share / swig / 1.3.26 / java / enumtypeunsafe.swg
CommitLineData
920dae64
AT
1/* -----------------------------------------------------------------------------
2 * Include this file in order for C/C++ enums to be wrapped by integers values.
3 * Each enum has an equivalent class named after the enum and the enum items are
4 * wrapped by constant integers within this class. The enum items are not
5 * typesafe as they are all integers.
6 * ----------------------------------------------------------------------------- */
7
8// const enum SWIGTYPE & typemaps
9%typemap(jni) const enum SWIGTYPE & "jint"
10%typemap(jtype) const enum SWIGTYPE & "int"
11%typemap(jstype) const enum SWIGTYPE & "int"
12
13%typemap(in) const enum SWIGTYPE & ($*1_ltype temp)
14%{ temp = ($*1_ltype)$input;
15 $1 = &temp; %}
16%typemap(out) const enum SWIGTYPE & %{ $result = (jint)*$1; %}
17
18%typemap(directorout,warning=SWIG_WARN_TYPEMAP_THREAD_UNSAFE) const enum SWIGTYPE &
19%{ static $*1_ltype temp = ($*1_ltype)$input;
20 $1 = &temp; %}
21%typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1_name;"
22%typemap(javadirectorin) const enum SWIGTYPE & "$jniinput"
23%typemap(javadirectorout) const enum SWIGTYPE & "$javacall"
24
25%typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & ""
26
27%typemap(throws) const enum SWIGTYPE & %{
28 (void)$1;
29 SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown");
30%}
31
32%typemap(javain) const enum SWIGTYPE & "$javainput"
33%typemap(javaout) const enum SWIGTYPE & {
34 return $jnicall;
35 }
36
37
38// enum SWIGTYPE typemaps
39%typemap(jni) enum SWIGTYPE "jint"
40%typemap(jtype) enum SWIGTYPE "int"
41%typemap(jstype) enum SWIGTYPE "int"
42
43%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %}
44%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %}
45
46%typemap(directorout) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %}
47%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;"
48%typemap(javadirectorin) enum SWIGTYPE "$jniinput"
49%typemap(javadirectorout) enum SWIGTYPE "$javacall"
50
51%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE ""
52
53%typemap(throws) enum SWIGTYPE %{
54 (void)$1;
55 SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown");
56%}
57
58%typemap(javain) enum SWIGTYPE "$javainput"
59%typemap(javaout) enum SWIGTYPE {
60 return $jnicall;
61 }
62
63// '$static' will be replaced with either 'static' or nothing depending on whether the enum is an inner Java class or not
64%typemap(javaclassmodifiers) enum SWIGTYPE "public final $static class"
65%typemap(javabase) enum SWIGTYPE ""
66%typemap(javacode) enum SWIGTYPE ""
67%typemap(javaimports) enum SWIGTYPE ""
68%typemap(javainterfaces) enum SWIGTYPE ""
69%typemap(javabody) enum SWIGTYPE ""
70
71%javaenum(typeunsafe);
72