Skip to content

Commit ba38116

Browse files
committed
core: fix usage of shorten namespace bp
1 parent f694eb3 commit ba38116

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

include/eigenpy/std-vector.hpp

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bool from_python_list(PyObject *obj_ptr, T *) {
5353

5454
template <typename vector_type, bool NoProxy>
5555
struct build_list {
56-
static ::boost::python::list run(vector_type &vec, const bool deep_copy) {
56+
static bp::list run(vector_type &vec, const bool deep_copy) {
5757
if (deep_copy) return build_list<vector_type, true>::run(vec, true);
5858

5959
bp::list bp_list;
@@ -66,7 +66,7 @@ struct build_list {
6666

6767
template <typename vector_type>
6868
struct build_list<vector_type, true> {
69-
static ::boost::python::list run(vector_type &vec, const bool) {
69+
static bp::list run(vector_type &vec, const bool) {
7070
typedef bp::iterator<vector_type> iterator;
7171
return bp::list(iterator()(vec));
7272
}
@@ -77,8 +77,7 @@ struct build_list<vector_type, true> {
7777
/// them.
7878
template <typename Container>
7979
struct overload_base_get_item_for_std_vector
80-
: public boost::python::def_visitor<
81-
overload_base_get_item_for_std_vector<Container>> {
80+
: public bp::def_visitor<overload_base_get_item_for_std_vector<Container>> {
8281
typedef typename Container::value_type value_type;
8382
typedef typename Container::value_type data_type;
8483
typedef size_t index_type;
@@ -92,8 +91,8 @@ struct overload_base_get_item_for_std_vector
9291
}
9392

9493
private:
95-
static boost::python::object base_get_item_int(
96-
boost::python::back_reference<Container &> container, PyObject *i_) {
94+
static bp::object base_get_item_int(bp::back_reference<Container &> container,
95+
PyObject *i_) {
9796
index_type idx = convert_index(container.get(), i_);
9897
typename Container::iterator i = container.get().begin();
9998
std::advance(i, idx);
@@ -108,9 +107,8 @@ struct overload_base_get_item_for_std_vector
108107
return bp::object(bp::handle<>(convert(*i)));
109108
}
110109

111-
static boost::python::object base_get_item_slice(
112-
boost::python::back_reference<Container &> container,
113-
boost::python::slice slice) {
110+
static bp::object base_get_item_slice(
111+
bp::back_reference<Container &> container, bp::slice slice) {
114112
bp::list out;
115113
try {
116114
auto rng =
@@ -225,7 +223,7 @@ struct extract_to_eigen_ref
225223
extract_to_eigen_ref(api::object const &o) : base(o.ptr()) {}
226224
};
227225

228-
/// \brief Specialization of the boost::python::extract struct for references to
226+
/// \brief Specialization of the bp::extract struct for references to
229227
/// Eigen matrix objects.
230228
template <typename Scalar, int Rows, int Cols, int Options, int MaxRows,
231229
int MaxCols>
@@ -366,9 +364,8 @@ struct StdContainerFromPythonList {
366364

367365
/// \brief Allocate the std::vector and fill it with the element contained in
368366
/// the list
369-
static void construct(
370-
PyObject *obj_ptr,
371-
boost::python::converter::rvalue_from_python_stage1_data *memory) {
367+
static void construct(PyObject *obj_ptr,
368+
bp::converter::rvalue_from_python_stage1_data *memory) {
372369
// Extract the list
373370
bp::object bp_obj(bp::handle<>(bp::borrowed(obj_ptr)));
374371
bp::list bp_list(bp_obj);
@@ -389,12 +386,11 @@ struct StdContainerFromPythonList {
389386
}
390387

391388
static void register_converter() {
392-
::boost::python::converter::registry::push_back(
393-
&convertible, &construct, ::boost::python::type_id<vector_type>());
389+
bp::converter::registry::push_back(&convertible, &construct,
390+
bp::type_id<vector_type>());
394391
}
395392

396-
static ::boost::python::list tolist(vector_type &self,
397-
const bool deep_copy = false) {
393+
static bp::list tolist(vector_type &self, const bool deep_copy = false) {
398394
return details::build_list<vector_type, NoProxy>::run(self, deep_copy);
399395
}
400396
};
@@ -428,7 +424,7 @@ struct contains_algo<T, false> {
428424

429425
template <class Container, bool NoProxy>
430426
struct contains_vector_derived_policies
431-
: public ::boost::python::vector_indexing_suite<
427+
: public bp::vector_indexing_suite<
432428
Container, NoProxy,
433429
contains_vector_derived_policies<Container, NoProxy>> {
434430
typedef typename Container::value_type key_type;
@@ -445,7 +441,7 @@ struct contains_vector_derived_policies
445441
///
446442
template <typename Container, bool NoProxy, typename CoVisitor>
447443
struct ExposeStdMethodToStdVector
448-
: public boost::python::def_visitor<
444+
: public bp::def_visitor<
449445
ExposeStdMethodToStdVector<Container, NoProxy, CoVisitor>> {
450446
typedef StdContainerFromPythonList<Container, NoProxy>
451447
FromPythonListConverter;
@@ -533,7 +529,7 @@ struct StdVectorPythonVisitor {
533529
cl.def(IdVisitor<vector_type>());
534530

535531
// Standard vector indexing definition
536-
boost::python::vector_indexing_suite<
532+
bp::vector_indexing_suite<
537533
vector_type, NoProxy,
538534
internal::contains_vector_derived_policies<vector_type, NoProxy>>
539535
vector_indexing;

0 commit comments

Comments
 (0)