Loading...
Searching...
No Matches
pyutils.h File Reference

Basic utilities for Python API. More...

Go to the source code of this file.

Classes

struct  ledger::python::map_value_type_converter< MapType >
 
struct  ledger::python::object_from_python< T, TfromPy >
 
struct  ledger::python::register_optional_to_python< T >::optional_from_python
 
struct  ledger::python::register_optional_to_python< T >::optional_to_python
 
struct  ledger::python::PairToTupleConverter< T1, T2 >
 
struct  ledger::python::register_optional_to_python< T >
 
struct  ledger::python::register_python_conversion< T, TtoPy, TfromPy >
 

Namespaces

namespace  boost
 
namespace  boost::python
 
namespace  ledger
 
namespace  ledger::python
 

Macros

#define BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T, expr)
 
#define BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T, expr, pytype)
 
#define BOOST_PYTHON_TO_PYTHON_BY_VALUE(T, expr, pytype)
 

Functions

template<typename T >
PyObjectledger::python::str_to_py_unicode (const T &str)
 

Detailed Description

Basic utilities for Python API.

Author
John Wiegley

Definition in file pyutils.h.

Macro Definition Documentation

◆ BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE

#define BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE ( T,
expr )
Value:
namespace converter \
{ \
template <> struct arg_to_python< T > \
: handle<> \
{ \
arg_to_python(T const& x) \
: boost::python::handle<>(expr) {} \
}; \
}

Definition at line 182 of file pyutils.h.

◆ BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE

#define BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE ( T,
expr,
pytype )
Value:
template <> struct to_python_value<T&> \
: detail::builtin_to_python \
{ \
inline PyObject* operator()(T const& x) const \
{ \
return (expr); \
} \
inline PyTypeObject const* get_pytype() const \
{ \
return (pytype); \
} \
}; \
template <> struct to_python_value<T const&> \
: detail::builtin_to_python \
{ \
inline PyObject* operator()(T const& x) const \
{ \
return (expr); \
} \
inline PyTypeObject const* get_pytype() const \
{ \
return (pytype); \
} \
};

Definition at line 156 of file pyutils.h.

◆ BOOST_PYTHON_TO_PYTHON_BY_VALUE

#define BOOST_PYTHON_TO_PYTHON_BY_VALUE ( T,
expr,
pytype )
Value:
BOOST_PYTHON_ARG_TO_PYTHON_BY_VALUE(T,expr)
#define BOOST_PYTHON_RETURN_TO_PYTHON_BY_VALUE(T, expr, pytype)
Definition pyutils.h:156

Definition at line 194 of file pyutils.h.