cppyabm  1.0.17
An agent-based library to integrate C++ and Python
Classes | Typedefs | Functions
attr.h File Reference
#include "cast.h"

Go to the source code of this file.

Classes

struct  is_method
 Annotation for methods. More...
 
struct  is_operator
 Annotation for operators. More...
 
struct  is_final
 Annotation for classes that cannot be subclassed. More...
 
struct  scope
 Annotation for parent scope. More...
 
struct  doc
 Annotation for documentation. More...
 
struct  name
 Annotation for function names. More...
 
struct  sibling
 Annotation indicating that a function is an overload associated with a given "sibling". More...
 
struct  base< T >
 Annotation indicating that a class derives from another given type. More...
 
struct  keep_alive< Nurse, Patient >
 Keep patient alive while nurse lives. More...
 
struct  multiple_inheritance
 Annotation indicating that a class is involved in a multiple inheritance relationship. More...
 
struct  dynamic_attr
 Annotation which enables dynamic attributes, i.e. adds __dict__ to a class. More...
 
struct  buffer_protocol
 Annotation which enables the buffer protocol for a type. More...
 
struct  metaclass
 Annotation which requests that a special metaclass is created for a type. More...
 
struct  module_local
 Annotation that marks a class as local to the module: More...
 
struct  arithmetic
 Annotation to mark enums as an arithmetic type. More...
 
struct  prepend
 Mark a function for addition at the beginning of the existing overload chain instead of the end. More...
 
struct  call_guard<>
 
struct  call_guard< T >
 
struct  call_guard< T, Ts... >
 
struct  call_guard< T, Ts... >::type
 
struct  argument_record
 Internal data structure which holds metadata about a keyword argument. More...
 
struct  function_record
 Internal data structure which holds metadata about a bound function (signature, overloads, etc.) More...
 
struct  type_record
 Special data structure which (temporarily) holds metadata about a bound class. More...
 
struct  is_new_style_constructor
 Tag for a new-style __init__ defined in detail/init.h More...
 
struct  process_attribute_default< T >
 
struct  process_attribute< name >
 Process an attribute specifying the function's name. More...
 
struct  process_attribute< doc >
 Process an attribute specifying the function's docstring. More...
 
struct  process_attribute< const char * >
 Process an attribute specifying the function's docstring (provided as a C-style string) More...
 
struct  process_attribute< char * >
 
struct  process_attribute< return_value_policy >
 Process an attribute indicating the function's return value policy. More...
 
struct  process_attribute< sibling >
 Process an attribute which indicates that this is an overloaded function associated with a given sibling. More...
 
struct  process_attribute< is_method >
 Process an attribute which indicates that this function is a method. More...
 
struct  process_attribute< scope >
 Process an attribute which indicates the parent scope of a method. More...
 
struct  process_attribute< is_operator >
 Process an attribute which indicates that this function is an operator. More...
 
struct  process_attribute< is_new_style_constructor >
 
struct  process_attribute< arg >
 Process a keyword argument attribute (without a default value) More...
 
struct  process_attribute< arg_v >
 Process a keyword argument attribute (with a default value) More...
 
struct  process_attribute< kw_only >
 Process a keyword-only-arguments-follow pseudo argument. More...
 
struct  process_attribute< pos_only >
 Process a positional-only-argument maker. More...
 
struct  process_attribute< T, enable_if_t< is_pyobject< T >::value > >
 Process a parent class attribute. Single inheritance only (class_ itself already guarantees that) More...
 
struct  process_attribute< base< T > >
 Process a parent class attribute (deprecated, does not support multiple inheritance) More...
 
struct  process_attribute< multiple_inheritance >
 Process a multiple inheritance attribute. More...
 
struct  process_attribute< dynamic_attr >
 
struct  process_attribute< is_final >
 
struct  process_attribute< buffer_protocol >
 
struct  process_attribute< metaclass >
 
struct  process_attribute< module_local >
 
struct  process_attribute< prepend >
 Process a 'prepend' attribute, putting this at the beginning of the overload chain. More...
 
struct  process_attribute< arithmetic >
 Process an 'arithmetic' attribute for enums (does nothing here) More...
 
struct  process_attribute< call_guard< Ts... > >
 
struct  process_attribute< keep_alive< Nurse, Patient > >
 
struct  process_attributes< Args >
 Recursively iterate over variadic template arguments. More...
 

Typedefs

template<typename T >
using is_call_guard = is_instantiation< call_guard, T >
 
template<typename... Extra>
using extract_guard_t = typename exactly_one_t< is_call_guard, call_guard<>, Extra... >::type
 Extract the type from the first call_guard in Extras... (or void_type if none found) More...
 

Functions

void keep_alive_impl (size_t Nurse, size_t Patient, function_call &call, handle ret)
 
void process_kw_only_arg (const arg &a, function_record *r)
 
template<typename... Extra, size_t named = constexpr_sum(std::is_base_of<arg, Extra>::value...), size_t self = constexpr_sum(std::is_same<is_method, Extra>::value...)>
constexpr bool expected_num_args (size_t nargs, bool has_args, bool has_kwargs)
 Check the number of named arguments at compile time. More...
 

Typedef Documentation

◆ extract_guard_t

template<typename... Extra>
using extract_guard_t = typename exactly_one_t<is_call_guard, call_guard<>, Extra...>::type

Extract the type from the first call_guard in Extras... (or void_type if none found)

Definition at line 540 of file attr.h.

◆ is_call_guard

template<typename T >
using is_call_guard = is_instantiation<call_guard, T>

Definition at line 536 of file attr.h.

Function Documentation

◆ expected_num_args()

template<typename... Extra, size_t named = constexpr_sum(std::is_base_of<arg, Extra>::value...), size_t self = constexpr_sum(std::is_same<is_method, Extra>::value...)>
constexpr bool expected_num_args ( size_t  nargs,
bool  has_args,
bool  has_kwargs 
)
constexpr

Check the number of named arguments at compile time.

Definition at line 546 of file attr.h.

◆ keep_alive_impl()

void keep_alive_impl ( size_t  Nurse,
size_t  Patient,
function_call call,
handle  ret 
)
inline

Definition at line 1846 of file pybind11.h.

◆ process_kw_only_arg()

void process_kw_only_arg ( const arg a,
function_record r 
)
inline

Definition at line 379 of file attr.h.