Scarab  2.8.1
Project 8 C++ Utility Library
Classes | Macros | Functions | Variables
test_virtual_functions.cpp File Reference
#include "pybind11_tests.h"
#include "constructor_stats.h"
#include <pybind11/functional.h>
#include <thread>
Include dependency graph for test_virtual_functions.cpp:

Go to the source code of this file.

Classes

class  ExampleVirt
 
class  PyExampleVirt
 
class  NonCopyable
 
class  Movable
 
class  NCVirt
 
class  NCVirtTrampoline
 
struct  Base
 
struct  DispatchIssue
 
class  A_Repeat
 
class  B_Repeat
 
class  C_Repeat
 
class  D_Repeat
 
class  A_Tpl
 
class  B_Tpl
 
class  C_Tpl
 
class  D_Tpl
 
class  PyA_Repeat
 
class  PyB_Repeat
 
class  PyC_Repeat
 
class  PyD_Repeat
 
class  PyA_Tpl< Base >
 
class  PyB_Tpl< Base >
 

Macros

#define A_METHODS
 
#define B_METHODS
 
#define C_METHODS
 
#define D_METHODS
 

Functions

static void test_gil ()
 
static void test_gil_from_thread ()
 
void initialize_inherited_virtuals (py::module &m)
 
void test_submodule_virtual_functions (py::module &)
 

Variables

test_initializer virtual_functions ("virtual_functions", test_submodule_virtual_functions)
 

Macro Definition Documentation

◆ A_METHODS

#define A_METHODS
Value:
public: \
virtual int unlucky_number() = 0; \
virtual std::string say_something(unsigned times) { \
std::string s = ""; \
for (unsigned i = 0; i < times; ++i) \
s += "hi"; \
return s; \
} \
std::string say_everything() { \
return say_something(1) + " " + std::to_string(unlucky_number()); \
}
auto to_string(T &&value) -> decltype(std::forward< T >(value))
Convert an object to a string (directly forward if this can become a string)
Definition: CLI11.hpp:1028

Definition at line 329 of file test_virtual_functions.cpp.

◆ B_METHODS

#define B_METHODS
Value:
public: \
int unlucky_number() override { return 13; } \
std::string say_something(unsigned times) override { \
return "B says hi " + std::to_string(times) + " times"; \
} \
virtual double lucky_number() { return 7.0; }
auto to_string(T &&value) -> decltype(std::forward< T >(value))
Convert an object to a string (directly forward if this can become a string)
Definition: CLI11.hpp:1028

Definition at line 345 of file test_virtual_functions.cpp.

◆ C_METHODS

#define C_METHODS
Value:
public: \
int unlucky_number() override { return 4444; } \
double lucky_number() override { return 888; }

Definition at line 355 of file test_virtual_functions.cpp.

◆ D_METHODS

#define D_METHODS

Definition at line 362 of file test_virtual_functions.cpp.

Function Documentation

◆ initialize_inherited_virtuals()

void initialize_inherited_virtuals ( py::module m)

Definition at line 443 of file test_virtual_functions.cpp.

◆ test_gil()

static void test_gil ( )
static

Definition at line 162 of file test_virtual_functions.cpp.

◆ test_gil_from_thread()

static void test_gil_from_thread ( )
static

Definition at line 176 of file test_virtual_functions.cpp.

◆ test_submodule_virtual_functions()

void test_submodule_virtual_functions ( py::module m)

Definition at line 188 of file test_virtual_functions.cpp.

Variable Documentation

◆ virtual_functions

test_initializer virtual_functions("virtual_functions", test_submodule_virtual_functions)