HepMC3 event record library
Data Fields
function_record Struct Reference

Internal data structure which holds metadata about a bound function (signature, overloads, etc.) More...

#include <attr.h>

+ Collaboration diagram for function_record:

Data Fields

char * name = nullptr
 Function name. More...
 
char * doc = nullptr
 
char * signature = nullptr
 Human-readable version of the function signature. More...
 
std::vector< argument_recordargs
 List of registered keyword arguments. More...
 
handle(* impl )(function_call &) = nullptr
 Pointer to lambda function which converts arguments and performs the actual call. More...
 
void * data [3] = { }
 Storage for the wrapped function pointer and captured data, if any. More...
 
void(* free_data )(function_record *ptr) = nullptr
 Pointer to custom destructor for 'data' (if needed) More...
 
return_value_policy policy = return_value_policy::automatic
 Return value policy associated with this function. More...
 
bool is_constructor: 1
 True if name == 'init'. More...
 
bool is_new_style_constructor: 1
 True if this is a new-style __init__ defined in detail/init.h More...
 
bool is_stateless: 1
 True if this is a stateless function pointer. More...
 
bool is_operator: 1
 True if this is an operator (add), etc. More...
 
bool is_method: 1
 True if this is a method. More...
 
bool has_args: 1
 True if the function has a '*args' argument. More...
 
bool has_kwargs: 1
 True if the function has a '**kwargs' argument. More...
 
bool has_kw_only_args: 1
 True once a 'py::kw_only' is encountered (any following args are keyword-only) More...
 
bool prepend: 1
 True if this function is to be inserted at the beginning of the overload resolution chain. More...
 
std::uint16_t nargs
 Number of arguments (including py::args and/or py::kwargs, if present) More...
 
std::uint16_t nargs_kw_only = 0
 Number of trailing arguments (counted in nargs) that are keyword-only. More...
 
std::uint16_t nargs_pos_only = 0
 Number of leading arguments (counted in nargs) that are positional-only. More...
 
PyMethodDef * def = nullptr
 Python method object. More...
 
handle scope
 Python handle to the parent scope (a class or a module) More...
 
handle sibling
 Python handle to the sibling function representing an overload chain. More...
 
function_recordnext = nullptr
 Pointer to next overload. More...
 

Detailed Description

Internal data structure which holds metadata about a bound function (signature, overloads, etc.)

Definition at line 141 of file attr.h.

Field Documentation

std::vector<argument_record> args

List of registered keyword arguments.

Definition at line 157 of file attr.h.

void* data[3] = { }

Storage for the wrapped function pointer and captured data, if any.

Definition at line 163 of file attr.h.

PyMethodDef* def = nullptr

Python method object.

Definition at line 208 of file attr.h.

void(* free_data)(function_record *ptr) = nullptr

Pointer to custom destructor for 'data' (if needed)

Definition at line 166 of file attr.h.

bool has_args

True if the function has a '*args' argument.

Definition at line 187 of file attr.h.

bool has_kw_only_args

True once a 'py::kw_only' is encountered (any following args are keyword-only)

Definition at line 193 of file attr.h.

bool has_kwargs

True if the function has a '**kwargs' argument.

Definition at line 190 of file attr.h.

handle(* impl)(function_call &) = nullptr

Pointer to lambda function which converts arguments and performs the actual call.

Definition at line 160 of file attr.h.

bool is_constructor

True if name == 'init'.

Definition at line 172 of file attr.h.

bool is_method

True if this is a method.

Definition at line 184 of file attr.h.

True if this is a new-style __init__ defined in detail/init.h

Definition at line 175 of file attr.h.

True if this is an operator (add), etc.

Definition at line 181 of file attr.h.

bool is_stateless

True if this is a stateless function pointer.

Definition at line 178 of file attr.h.

char* name = nullptr

Function name.

Definition at line 148 of file attr.h.

std::uint16_t nargs

Number of arguments (including py::args and/or py::kwargs, if present)

Definition at line 199 of file attr.h.

std::uint16_t nargs_kw_only = 0

Number of trailing arguments (counted in nargs) that are keyword-only.

Definition at line 202 of file attr.h.

std::uint16_t nargs_pos_only = 0

Number of leading arguments (counted in nargs) that are positional-only.

Definition at line 205 of file attr.h.

function_record* next = nullptr

Pointer to next overload.

Definition at line 217 of file attr.h.

return_value_policy policy = return_value_policy::automatic

Return value policy associated with this function.

Definition at line 169 of file attr.h.

bool prepend

True if this function is to be inserted at the beginning of the overload resolution chain.

Definition at line 196 of file attr.h.

Python handle to the parent scope (a class or a module)

Definition at line 211 of file attr.h.

Python handle to the sibling function representing an overload chain.

Definition at line 214 of file attr.h.

char* signature = nullptr

Human-readable version of the function signature.

Definition at line 154 of file attr.h.


The documentation for this struct was generated from the following file: