Scarab  v2.9.0
Project 8 C++ Utility Library
cancelable_pybind.hh
Go to the documentation of this file.
1 #ifndef CANCELABLE_PYBIND_HH_
2 #define CANCELABLE_PYBIND_HH_
3 
4 #include "cancelable.hh"
5 
6 #include "pybind11/pybind11.h"
7 
8 namespace scarab_pybind
9 {
10  std::list< std::string > export_cancelable( pybind11::module& mod )
11  {
12  std::list< std::string> all_members;
13 
14  all_members.push_back( "Cancelable" );
16  .def( pybind11::init< >() )
17 
18  .def( "cancel", &scarab::cancelable::cancel )
19  .def( "reset_cancel", &scarab::cancelable::reset_cancel )
20  .def( "is_canceled", &scarab::cancelable::is_canceled )
21 
22  ;
23 
24  return all_members;
25  }
26 }
27 
28 #endif /* CANCELABLE_PYBIND_HH_ */
Wrapper for Python extension modules.
Definition: pybind11.h:789
bool is_canceled() const
check canceled state
Definition: cancelable.hh:62
void reset_cancel()
reset to non-canceled state
Definition: cancelable.hh:55
void cancel(int a_code=0)
asynchronous cancel function
Definition: cancelable.hh:48
std::list< std::string > export_cancelable(pybind11::module &mod)
bool typename Extra class_ & def(const char *name_, Func &&f, const Extra &... extra)
Definition: pybind11.h:1110