cxtream  0.5.1
C++17 data pipeline with Python bindings.
pyboost_is_registered.hpp
1 /****************************************************************************
2  * cxtream library
3  * Copyright (c) 2017, Cognexa Solutions s.r.o.
4  * Author(s) Filip Matzner
5  *
6  * This file is distributed under the MIT License.
7  * See the accompanying file LICENSE.txt for the complete license agreement.
8  ****************************************************************************/
9 
10 #ifndef CXTREAM_PYTHON_UTILITY_PYBOOST_IS_REGISTERED_HPP
11 #define CXTREAM_PYTHON_UTILITY_PYBOOST_IS_REGISTERED_HPP
12 
13 #include <boost/python.hpp>
14 
15 namespace cxtream::python::utility {
16 
21 template<typename T>
23 {
24  namespace py = boost::python;
25  py::type_info info = py::type_id<T>();
26  const py::converter::registration* reg = py::converter::registry::query(info);
27  return reg != nullptr && reg->m_to_python != nullptr;
28 }
29 
30 } // end namespace cxtream::python::utility
31 #endif
bool is_registered()
Check whether a converter for the given C++ class is registered in boost::python. ...