moveit2
The MoveIt Motion Planning Framework for ROS 2.
Public Member Functions | List of all members
moveit::py_bindings_tools::GILReleaser Class Reference

RAII Helper to release the Global Interpreter Lock (GIL) More...

#include <gil_releaser.h>

Public Member Functions

 GILReleaser () noexcept
 Release the GIL on construction
More...
 
 ~GILReleaser () noexcept
 Reacquire the GIL on destruction
More...
 
 GILReleaser (const GILReleaser &)=delete
 
 GILReleaser (GILReleaser &&other) noexcept
 
GILReleaseroperator= (const GILReleaser &)=delete
 
GILReleaseroperator= (GILReleaser &&other) noexcept
 
void swap (GILReleaser &other) noexcept
 

Detailed Description

RAII Helper to release the Global Interpreter Lock (GIL)

Use this helper class to release the GIL before doing long computations or blocking calls. Note that without the GIL Python-related functions must not be called. So, before releasing the GIL all boost::python variables have to be converted to e.g. std::vector<std::string>. Before converting the result back to e.g. a moveit::py_bindings_tools::ByteString instance, the GIL has to be reacquired.

Definition at line 54 of file gil_releaser.h.

Constructor & Destructor Documentation

◆ GILReleaser() [1/3]

moveit::py_bindings_tools::GILReleaser::GILReleaser ( )
inlinenoexcept

Release the GIL on construction

Definition at line 60 of file gil_releaser.h.

◆ ~GILReleaser()

moveit::py_bindings_tools::GILReleaser::~GILReleaser ( )
inlinenoexcept

Reacquire the GIL on destruction

Definition at line 65 of file gil_releaser.h.

◆ GILReleaser() [2/3]

moveit::py_bindings_tools::GILReleaser::GILReleaser ( const GILReleaser )
delete

◆ GILReleaser() [3/3]

moveit::py_bindings_tools::GILReleaser::GILReleaser ( GILReleaser &&  other)
inlinenoexcept

Definition at line 75 of file gil_releaser.h.

Member Function Documentation

◆ operator=() [1/2]

GILReleaser& moveit::py_bindings_tools::GILReleaser::operator= ( const GILReleaser )
delete

◆ operator=() [2/2]

GILReleaser& moveit::py_bindings_tools::GILReleaser::operator= ( GILReleaser &&  other)
inlinenoexcept

Definition at line 82 of file gil_releaser.h.

Here is the call graph for this function:

◆ swap()

void moveit::py_bindings_tools::GILReleaser::swap ( GILReleaser other)
inlinenoexcept

Definition at line 89 of file gil_releaser.h.

Here is the caller graph for this function:

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