Scarab  2.8.1
Project 8 C++ Utility Library
Public Member Functions | Public Attributes | List of all members
function_record Struct Reference

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

#include <attr.h>

Public Member Functions

 function_record ()
 

Public Attributes

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 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 is_method: 1
 True if this is a method. More...
 
std::uint16_t nargs
 Number of arguments (including py::args and/or py::kwargs, if present) 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 134 of file attr.h.

Constructor & Destructor Documentation

◆ function_record()

function_record ( )
inline

Definition at line 135 of file attr.h.

Member Data Documentation

◆ args

std::vector<argument_record> args

List of registered keyword arguments.

Definition at line 149 of file attr.h.

◆ data

void* data[3] = { }

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

Definition at line 155 of file attr.h.

◆ def

PyMethodDef* def = nullptr

Python method object.

Definition at line 188 of file attr.h.

◆ doc

char* doc = nullptr

Definition at line 143 of file attr.h.

◆ free_data

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

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

Definition at line 158 of file attr.h.

◆ has_args

bool has_args

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

Definition at line 176 of file attr.h.

◆ has_kwargs

bool has_kwargs

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

Definition at line 179 of file attr.h.

◆ impl

handle(* impl) (function_call &) = nullptr

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

Definition at line 152 of file attr.h.

◆ is_constructor

bool is_constructor

True if name == 'init'.

Definition at line 164 of file attr.h.

◆ is_method

bool is_method

True if this is a method.

Definition at line 182 of file attr.h.

◆ is_new_style_constructor

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

Definition at line 167 of file attr.h.

◆ is_operator

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

Definition at line 173 of file attr.h.

◆ is_stateless

bool is_stateless

True if this is a stateless function pointer.

Definition at line 170 of file attr.h.

◆ name

char* name = nullptr

Function name.

Definition at line 140 of file attr.h.

◆ nargs

std::uint16_t nargs

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

Definition at line 185 of file attr.h.

◆ next

function_record* next = nullptr

Pointer to next overload.

Definition at line 197 of file attr.h.

◆ policy

Return value policy associated with this function.

Definition at line 161 of file attr.h.

◆ scope

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

Definition at line 191 of file attr.h.

◆ sibling

Python handle to the sibling function representing an overload chain.

Definition at line 194 of file attr.h.

◆ signature

char* signature = nullptr

Human-readable version of the function signature.

Definition at line 146 of file attr.h.


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