Logo ROOT  
Reference Guide
capi.h
Go to the documentation of this file.
1#ifndef CPPYY_CAPI
2#define CPPYY_CAPI
3
4#include <stddef.h>
5#include <stdint.h>
6#include "precommondefs.h"
7
8#ifdef __cplusplus
9extern "C" {
10#endif // ifdef __cplusplus
11
12 typedef size_t cppyy_scope_t;
14 typedef void* cppyy_object_t;
15 typedef intptr_t cppyy_method_t;
16
17 typedef size_t cppyy_index_t;
18 typedef void* cppyy_funcaddr_t;
19
20 typedef unsigned long cppyy_exctype_t;
21
22 /* direct interpreter access ---------------------------------------------- */
24 int cppyy_compile(const char* code);
25
26 /* name to opaque C++ scope representation -------------------------------- */
28 char* cppyy_resolve_name(const char* cppitem_name);
30 char* cppyy_resolve_enum(const char* enum_type);
32 cppyy_scope_t cppyy_get_scope(const char* scope_name);
38 size_t cppyy_size_of_type(const char* type_name);
39
40 /* memory management ------------------------------------------------------ */
49
50 /* method/function dispatching -------------------------------------------- */
52 void cppyy_call_v(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
54 unsigned char cppyy_call_b(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
56 char cppyy_call_c(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
58 short cppyy_call_h(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
60 int cppyy_call_i(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
62 long cppyy_call_l(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
64 long long cppyy_call_ll(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
66 float cppyy_call_f(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
68 double cppyy_call_d(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
70 long double cppyy_call_ld(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
72 double cppyy_call_nld(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
73
75 void* cppyy_call_r(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
77 char* cppyy_call_s(cppyy_method_t method, cppyy_object_t self, int nargs, void* args, size_t* length);
79 cppyy_object_t cppyy_constructor(cppyy_method_t method, cppyy_type_t klass, int nargs, void* args);
83 cppyy_object_t cppyy_call_o(cppyy_method_t method, cppyy_object_t self, int nargs, void* args, cppyy_type_t result_type);
84
87
88 /* handling of function argument buffer ----------------------------------- */
90 void* cppyy_allocate_function_args(int nargs);
92 void cppyy_deallocate_function_args(void* args);
97
98 /* scope reflection information ------------------------------------------- */
102 int cppyy_is_template(const char* template_name);
106 int cppyy_is_enum(const char* type_name);
107
109 const char** cppyy_get_all_cpp_names(cppyy_scope_t scope, size_t* count);
110
111 /* namespace reflection information --------------------------------------- */
114
115 /* class reflection information ------------------------------------------- */
129 char* cppyy_base_name(cppyy_type_t type, int base_index);
131 int cppyy_is_subtype(cppyy_type_t derived, cppyy_type_t base);
135 int cppyy_smartptr_info(const char* name, cppyy_type_t* raw, cppyy_method_t* deref);
137 void cppyy_add_smartptr_type(const char* type_name);
138
139 /* calculate offsets between declared and actual type, up-cast: direction > 0; down-cast: direction < 0 */
141 ptrdiff_t cppyy_base_offset(cppyy_type_t derived, cppyy_type_t base, cppyy_object_t address, int direction);
142
143 /* method/function reflection information --------------------------------- */
148
151
165 char* cppyy_method_arg_name(cppyy_method_t,int arg_index);
167 char* cppyy_method_arg_type(cppyy_method_t, int arg_index);
169 char* cppyy_method_arg_default(cppyy_method_t, int arg_index);
171 char* cppyy_method_signature(cppyy_method_t, int show_formalargs);
173 char* cppyy_method_signature_max(cppyy_method_t, int show_formalargs, int maxargs);
175 char* cppyy_method_prototype(cppyy_scope_t scope, cppyy_method_t, int show_formalargs);
178
184 int cppyy_exists_method_template(cppyy_scope_t scope, const char* name);
188 cppyy_method_t cppyy_get_method_template(cppyy_scope_t scope, const char* name, const char* proto);
189
192 cppyy_scope_t scope, cppyy_scope_t lc, cppyy_scope_t rc, const char* op);
193
194 /* method properties ------------------------------------------------------ */
203
204 /* data member reflection information ------------------------------------- */
208 char* cppyy_datamember_name(cppyy_scope_t scope, int datamember_index);
210 char* cppyy_datamember_type(cppyy_scope_t scope, int datamember_index);
212 intptr_t cppyy_datamember_offset(cppyy_scope_t scope, int datamember_index);
214 int cppyy_datamember_index(cppyy_scope_t scope, const char* name);
215
216 /* data member properties ------------------------------------------------- */
218 int cppyy_is_publicdata(cppyy_type_t type, cppyy_index_t datamember_index);
220 int cppyy_is_staticdata(cppyy_type_t type, cppyy_index_t datamember_index);
226 int cppyy_get_dimension_size(cppyy_scope_t scope, cppyy_index_t idata, int dimension);
227
228 /* misc helpers ----------------------------------------------------------- */
230 long long cppyy_strtoll(const char* str);
232 unsigned long long cppyy_strtoull(const char* str);
234 void cppyy_free(void* ptr);
235
237 cppyy_object_t cppyy_charp2stdstring(const char* str, size_t sz);
239 const char* cppyy_stdstring2charp(cppyy_object_t ptr, size_t* lsz);
242
244 double cppyy_longdouble2double(void*);
246 void cppyy_double2longdouble(double, void*);
247
251 void cppyy_vectorbool_setitem(cppyy_object_t ptr, int idx, int value);
252
253#ifdef __cplusplus
254}
255#endif // ifdef __cplusplus
256
257#endif // ifndef CPPYY_CAPI
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition: TGX11.cxx:110
int cppyy_is_staticdata(cppyy_type_t type, cppyy_index_t datamember_index)
int cppyy_vectorbool_getitem(cppyy_object_t ptr, int idx)
int cppyy_has_virtual_destructor(cppyy_type_t type)
int cppyy_is_const_method(cppyy_method_t)
void * cppyy_call_r(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
cppyy_object_t cppyy_constructor(cppyy_method_t method, cppyy_type_t klass, int nargs, void *args)
size_t cppyy_function_arg_typeoffset()
int cppyy_exists_method_template(cppyy_scope_t scope, const char *name)
int cppyy_get_num_templated_methods(cppyy_scope_t scope)
size_t cppyy_scope_t
Definition: capi.h:12
char * cppyy_resolve_enum(const char *enum_type)
cppyy_object_t cppyy_charp2stdstring(const char *str, size_t sz)
cppyy_scope_t cppyy_type_t
Definition: capi.h:13
int cppyy_is_enum_data(cppyy_scope_t scope, cppyy_index_t idata)
char * cppyy_scoped_final_name(cppyy_type_t type)
char * cppyy_call_s(cppyy_method_t method, cppyy_object_t self, int nargs, void *args, size_t *length)
int cppyy_num_bases(cppyy_type_t type)
cppyy_method_t cppyy_get_method_template(cppyy_scope_t scope, const char *name, const char *proto)
int cppyy_is_smartptr(cppyy_type_t type)
long long cppyy_strtoll(const char *str)
int cppyy_is_subtype(cppyy_type_t derived, cppyy_type_t base)
char * cppyy_method_mangled_name(cppyy_method_t)
char * cppyy_method_full_name(cppyy_method_t)
char * cppyy_method_signature(cppyy_method_t, int show_formalargs)
char * cppyy_method_name(cppyy_method_t)
double cppyy_call_nld(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
void cppyy_free(void *ptr)
int cppyy_smartptr_info(const char *name, cppyy_type_t *raw, cppyy_method_t *deref)
unsigned long long cppyy_strtoull(const char *str)
cppyy_object_t cppyy_stdstring2stdstring(cppyy_object_t ptr)
char * cppyy_base_name(cppyy_type_t type, int base_index)
int cppyy_num_bases_longest_branch(cppyy_type_t type)
int cppyy_method_num_args(cppyy_method_t)
char * cppyy_method_signature_max(cppyy_method_t, int show_formalargs, int maxargs)
int cppyy_is_publicdata(cppyy_type_t type, cppyy_index_t datamember_index)
void cppyy_destructor(cppyy_type_t type, cppyy_object_t self)
intptr_t cppyy_datamember_offset(cppyy_scope_t scope, int datamember_index)
char * cppyy_datamember_type(cppyy_scope_t scope, int datamember_index)
char cppyy_call_c(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
ptrdiff_t cppyy_base_offset(cppyy_type_t derived, cppyy_type_t base, cppyy_object_t address, int direction)
long double cppyy_call_ld(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
int cppyy_is_const_data(cppyy_scope_t scope, cppyy_index_t idata)
const char ** cppyy_get_all_cpp_names(cppyy_scope_t scope, size_t *count)
void cppyy_call_v(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
cppyy_index_t * cppyy_method_indices_from_name(cppyy_scope_t scope, const char *name)
int cppyy_is_abstract(cppyy_type_t type)
int cppyy_call_i(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
char * cppyy_method_prototype(cppyy_scope_t scope, cppyy_method_t, int show_formalargs)
unsigned char cppyy_call_b(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
int cppyy_is_template(const char *template_name)
cppyy_type_t cppyy_actual_class(cppyy_type_t klass, cppyy_object_t obj)
intptr_t cppyy_method_t
Definition: capi.h:15
char * cppyy_final_name(cppyy_type_t type)
char * cppyy_get_templated_method_name(cppyy_scope_t scope, cppyy_index_t imeth)
double cppyy_longdouble2double(void *)
size_t cppyy_index_t
Definition: capi.h:17
char * cppyy_method_arg_type(cppyy_method_t, int arg_index)
long cppyy_call_l(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
void cppyy_deallocate_function_args(void *args)
int cppyy_method_is_template(cppyy_scope_t scope, cppyy_index_t idx)
void * cppyy_object_t
Definition: capi.h:14
int cppyy_is_destructor(cppyy_method_t)
void cppyy_destruct(cppyy_type_t type, cppyy_object_t self)
int cppyy_is_enum(const char *type_name)
size_t cppyy_size_of_type(const char *type_name)
cppyy_object_t cppyy_allocate(cppyy_type_t type)
char * cppyy_datamember_name(cppyy_scope_t scope, int datamember_index)
char * cppyy_method_result_type(cppyy_method_t)
cppyy_object_t cppyy_construct(cppyy_type_t type)
int cppyy_is_namespace(cppyy_scope_t scope)
unsigned long cppyy_exctype_t
Definition: capi.h:20
cppyy_object_t cppyy_call_o(cppyy_method_t method, cppyy_object_t self, int nargs, void *args, cppyy_type_t result_type)
long long cppyy_call_ll(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
cppyy_scope_t cppyy_get_scope(const char *scope_name)
void cppyy_vectorbool_setitem(cppyy_object_t ptr, int idx, int value)
cppyy_index_t * cppyy_get_using_namespaces(cppyy_scope_t scope)
void cppyy_add_smartptr_type(const char *type_name)
void * cppyy_allocate_function_args(int nargs)
int cppyy_method_req_args(cppyy_method_t)
float cppyy_call_f(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
short cppyy_call_h(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
int cppyy_is_constructor(cppyy_method_t)
char * cppyy_method_arg_name(cppyy_method_t, int arg_index)
int cppyy_get_dimension_size(cppyy_scope_t scope, cppyy_index_t idata, int dimension)
double cppyy_call_d(cppyy_method_t method, cppyy_object_t self, int nargs, void *args)
int cppyy_num_methods(cppyy_scope_t scope)
void cppyy_double2longdouble(double, void *)
char * cppyy_resolve_name(const char *cppitem_name)
cppyy_method_t cppyy_get_method(cppyy_scope_t scope, cppyy_index_t idx)
size_t cppyy_function_arg_sizeof()
int cppyy_num_datamembers(cppyy_scope_t scope)
size_t cppyy_size_of_klass(cppyy_type_t klass)
int cppyy_datamember_index(cppyy_scope_t scope, const char *name)
cppyy_index_t cppyy_get_global_operator(cppyy_scope_t scope, cppyy_scope_t lc, cppyy_scope_t rc, const char *op)
void cppyy_deallocate(cppyy_type_t type, cppyy_object_t self)
const char * cppyy_stdstring2charp(cppyy_object_t ptr, size_t *lsz)
int cppyy_compile(const char *code)
void * cppyy_funcaddr_t
Definition: capi.h:18
int cppyy_is_staticmethod(cppyy_method_t)
cppyy_funcaddr_t cppyy_function_address(cppyy_method_t method)
int cppyy_is_publicmethod(cppyy_method_t)
char * cppyy_method_arg_default(cppyy_method_t, int arg_index)
int cppyy_has_complex_hierarchy(cppyy_type_t type)
const char * proto
Definition: civetweb.c:17502
#define RPY_EXPORTED
Definition: precommondefs.h:67