46 #ifndef _MIRA_TOOLBOXES_PYTHON_PYTHONVECTORWITHOUTCONTAINS_H_ 47 #define _MIRA_TOOLBOXES_PYTHON_PYTHONVECTORWITHOUTCONTAINS_H_ 51 #include <boost/python/suite/indexing/vector_indexing_suite.hpp> 53 namespace mira {
namespace python {
58 template <
class Container,
bool NoProxy,
class DerivedPolicies>
61 template <
class Container,
bool NoProxy>
64 NoProxy, final_vector_derived_policies<Container, NoProxy> > {};
77 public boost::python::vector_indexing_suite<Container, NoProxy, DerivedPolicies> {
81 typedef boost::python::vector_indexing_suite<Container, NoProxy, DerivedPolicies> Base;
86 contains(Container& container,
typename Base::key_type
const& key)
88 PyErr_SetString(PyExc_NotImplementedError,
"contains is not supported by this type");
89 boost::python::throw_error_already_set();
96 template<typename Type, typename Allocator = typename std::vector<Type>::allocator_type>
99 static void expose(
const std::string& name)
101 using namespace boost::python;
102 typedef std::vector<Type, Allocator> VectorType;
104 class_<VectorType>(name.c_str())
Definition: PythonVectorWithoutContains.h:62
static bool contains(Container &container, typename Base::key_type const &key)
Definition: PythonVectorWithoutContains.h:86
#define MIRA_PYTHONCONNECTOR_NAMED_TYPE_FOOTER(type, name)
Definition: PythonVectorWithoutContains.h:97
Python wrapper for MIRA units.
static void expose(const std::string &name)
Definition: PythonVectorWithoutContains.h:99
Definition: PythonVectorWithoutContains.h:59