Public Member Functions | Private Attributes | List of all members
scoped_interpreter Class Reference

#include <embed.h>

Public Member Functions

scoped_interpreteroperator= (const scoped_interpreter &)=delete
 
scoped_interpreteroperator= (scoped_interpreter &&)=delete
 
 scoped_interpreter (bool init_signal_handlers=true, int argc=0, const char *const *argv=nullptr, bool add_program_dir_to_path=true)
 
 scoped_interpreter (const scoped_interpreter &)=delete
 
 scoped_interpreter (scoped_interpreter &&other) noexcept
 
 ~scoped_interpreter ()
 

Private Attributes

bool is_valid = true
 

Detailed Description

\rst Scope guard version of initialize_interpreter and finalize_interpreter. This a move-only guard and only a single instance can exist.

See initialize_interpreter for a discussion of its constructor arguments.

.. code-block:: cpp

#include <pybind11/embed.h>

int main() {
    py::scoped_interpreter guard{};
    py::print(Hello, World!);
} // <-- interpreter shutdown

\endrst

Definition at line 280 of file embed.h.

Constructor & Destructor Documentation

◆ scoped_interpreter() [1/3]

scoped_interpreter::scoped_interpreter ( bool  init_signal_handlers = true,
int  argc = 0,
const char *const *  argv = nullptr,
bool  add_program_dir_to_path = true 
)
inlineexplicit

Definition at line 282 of file embed.h.

◆ scoped_interpreter() [2/3]

scoped_interpreter::scoped_interpreter ( const scoped_interpreter )
delete

◆ scoped_interpreter() [3/3]

scoped_interpreter::scoped_interpreter ( scoped_interpreter &&  other)
inlinenoexcept

Definition at line 299 of file embed.h.

◆ ~scoped_interpreter()

scoped_interpreter::~scoped_interpreter ( )
inline

Definition at line 303 of file embed.h.

Member Function Documentation

◆ operator=() [1/2]

scoped_interpreter& scoped_interpreter::operator= ( const scoped_interpreter )
delete

◆ operator=() [2/2]

scoped_interpreter& scoped_interpreter::operator= ( scoped_interpreter &&  )
delete

Member Data Documentation

◆ is_valid

bool scoped_interpreter::is_valid = true
private

Definition at line 310 of file embed.h.


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


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:18:48