FD.io VPP  v16.06
Vector Packet Processing
vppjni_env.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vppjni_class
 
struct  jenv_field
 

Macros

#define VPPJNI_CLASS_SYMBOL(name)   vppjni_class_##name
 
#define VPPJNI_CLASS_INIT(name)   vppjni_class_##name##_init
 
#define BIND_JAPI_CLASS(name, sig)
 
#define VPPJNI_FIELD_SYMBOL(cls, name)   vppjni_field_##cls##_##name
 
#define VPPJNI_FIELD_INIT(cls, name)   vppjni_field_##cls##_##name##_init
 
#define BIND_JAPI_FIELD(cls, field, sig)
 
#define BIND_JAPI_BOOL_FIELD(cls, field)
 
#define BIND_JAPI_BYTE_FIELD(cls, field)
 
#define BIND_JAPI_INT_FIELD(cls, field)
 
#define BIND_JAPI_OBJ_FIELD(cls, field, sig)
 
#define BIND_JAPI_STRING_FIELD(cls, field)   BIND_JAPI_OBJ_FIELD(cls, field, "Ljava/lang/String;")
 

Typedefs

typedef struct vppjni_class vppjni_class_t
 
typedef struct jenv_field vppjni_field_t
 

Functions

jobject vppjni_new_object (JNIEnv *env, const vppjni_class_t *ptr, va_list ap)
 
void vppjni_register_class (vppjni_class_t *ptr)
 
void vppjni_register_field (vppjni_field_t *ptr)
 
int vppjni_init (JNIEnv *env)
 
void vppjni_uninit (JNIEnv *env)
 

Macro Definition Documentation

#define BIND_JAPI_BOOL_FIELD (   cls,
  field 
)
Value:
BIND_JAPI_FIELD(cls, field, "Z"); \
static void set_##cls##_##field(JNIEnv *env, jobject obj, jboolean value) \
{ \
(*env)->SetBooleanField(env, obj, VPPJNI_FIELD_SYMBOL(cls, field).jfield, value); \
}
#define VPPJNI_FIELD_SYMBOL(cls, name)
Definition: vppjni_env.h:74
#define BIND_JAPI_FIELD(cls, field, sig)
Definition: vppjni_env.h:76

Definition at line 86 of file vppjni_env.h.

#define BIND_JAPI_BYTE_FIELD (   cls,
  field 
)
Value:
BIND_JAPI_FIELD(cls, field, "B"); \
static void set_##cls##_##field(JNIEnv *env, jobject obj, jbyte value) \
{ \
(*env)->SetByteField(env, obj, VPPJNI_FIELD_SYMBOL(cls, field).jfield, value); \
}
#define VPPJNI_FIELD_SYMBOL(cls, name)
Definition: vppjni_env.h:74
#define BIND_JAPI_FIELD(cls, field, sig)
Definition: vppjni_env.h:76

Definition at line 92 of file vppjni_env.h.

#define BIND_JAPI_CLASS (   name,
  sig 
)
Value:
static void VPPJNI_CLASS_INIT(name)(void) __attribute__((__constructor__)); \
static void VPPJNI_CLASS_INIT(name)() \
{ \
VPPJNI_CLASS_SYMBOL(name).fqcn = "org/openvpp/vppjapi/" #name; \
VPPJNI_CLASS_SYMBOL(name).init_sig = sig; \
} \
static __attribute__((unused)) jobject name##Array(JNIEnv *env, jsize length) \
{ \
return (*env)->NewObjectArray(env, length, VPPJNI_CLASS_SYMBOL(name).jclass, NULL); \
} \
static jobject name##Object(JNIEnv *env, ...) \
{ \
va_list ap; \
va_start(ap, env); \
jobject obj = vppjni_new_object(env, &VPPJNI_CLASS_SYMBOL(name), ap); \
va_end(ap); \
return obj; \
}
#define VPPJNI_CLASS_INIT(name)
Definition: vppjni_env.h:51
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
void vppjni_register_class(vppjni_class_t *ptr)
Definition: vppjni_env.c:24
#define VPPJNI_CLASS_SYMBOL(name)
Definition: vppjni_env.h:50

Definition at line 52 of file vppjni_env.h.

#define BIND_JAPI_FIELD (   cls,
  field,
  sig 
)
Value:
static vppjni_field_t VPPJNI_FIELD_SYMBOL(cls, field); \
static void VPPJNI_FIELD_INIT(cls, field)(void) __attribute__((__constructor__)); \
static void VPPJNI_FIELD_INIT(cls, field)() \
{ \
VPPJNI_FIELD_SYMBOL(cls, field).name = #field; \
VPPJNI_FIELD_SYMBOL(cls, field).type = sig; \
VPPJNI_FIELD_SYMBOL(cls, field).clsref = &VPPJNI_CLASS_SYMBOL(cls); \
}
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
#define VPPJNI_FIELD_SYMBOL(cls, name)
Definition: vppjni_env.h:74
void vppjni_register_field(vppjni_field_t *ptr)
Definition: vppjni_env.c:33
#define VPPJNI_CLASS_SYMBOL(name)
Definition: vppjni_env.h:50
#define VPPJNI_FIELD_INIT(cls, name)
Definition: vppjni_env.h:75

Definition at line 76 of file vppjni_env.h.

#define BIND_JAPI_INT_FIELD (   cls,
  field 
)
Value:
BIND_JAPI_FIELD(cls, field, "I"); \
static void set_##cls##_##field(JNIEnv *env, jobject obj, jint value) \
{ \
(*env)->SetIntField(env, obj, VPPJNI_FIELD_SYMBOL(cls, field).jfield, value); \
}
#define VPPJNI_FIELD_SYMBOL(cls, name)
Definition: vppjni_env.h:74
#define BIND_JAPI_FIELD(cls, field, sig)
Definition: vppjni_env.h:76

Definition at line 98 of file vppjni_env.h.

#define BIND_JAPI_OBJ_FIELD (   cls,
  field,
  sig 
)
Value:
BIND_JAPI_FIELD(cls, field, sig); \
static void set_##cls##_##field(JNIEnv *env, jobject obj, jobject value) \
{ \
(*env)->SetObjectField(env, obj, VPPJNI_FIELD_SYMBOL(cls, field).jfield, value); \
}
#define VPPJNI_FIELD_SYMBOL(cls, name)
Definition: vppjni_env.h:74
#define BIND_JAPI_FIELD(cls, field, sig)
Definition: vppjni_env.h:76

Definition at line 104 of file vppjni_env.h.

#define BIND_JAPI_STRING_FIELD (   cls,
  field 
)    BIND_JAPI_OBJ_FIELD(cls, field, "Ljava/lang/String;")

Definition at line 110 of file vppjni_env.h.

#define VPPJNI_CLASS_INIT (   name)    vppjni_class_##name##_init

Definition at line 51 of file vppjni_env.h.

#define VPPJNI_CLASS_SYMBOL (   name)    vppjni_class_##name

Definition at line 50 of file vppjni_env.h.

#define VPPJNI_FIELD_INIT (   cls,
  name 
)    vppjni_field_##cls##_##name##_init

Definition at line 75 of file vppjni_env.h.

#define VPPJNI_FIELD_SYMBOL (   cls,
  name 
)    vppjni_field_##cls##_##name

Definition at line 74 of file vppjni_env.h.

Typedef Documentation

typedef struct vppjni_class vppjni_class_t
typedef struct jenv_field vppjni_field_t

Function Documentation

int vppjni_init ( JNIEnv *  env)

Definition at line 51 of file vppjni_env.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

jobject vppjni_new_object ( JNIEnv *  env,
const vppjni_class_t ptr,
va_list  ap 
)

Definition at line 41 of file vppjni_env.c.

void vppjni_register_class ( vppjni_class_t ptr)

Definition at line 24 of file vppjni_env.c.

void vppjni_register_field ( vppjni_field_t ptr)

Definition at line 33 of file vppjni_env.c.

void vppjni_uninit ( JNIEnv *  env)

Definition at line 94 of file vppjni_env.c.

+ Here is the caller graph for this function: