ESyS-Particle  2.3.4
Util.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 
14 #ifndef ESYS_LSM_BPUUTIL_H
15 #define ESYS_LSM_BPUUTIL_H
16 
17 #include <boost/python.hpp>
18 
19 namespace esys
20 {
21  namespace lsm
22  {
23  namespace bpu
24  {
25  inline boost::python::object iter(const boost::python::object &pyOb)
26  {
27  return pyOb.attr("__iter__")();
28  }
29 
30  inline int len(const boost::python::object &pyOb)
31  {
32  return boost::python::extract<int>(pyOb.attr("__len__")());
33  }
34  }
35  }
36 }
37 
38 #endif
esys::lsm::bpu::len
int len(const boost::python::object &pyOb)
Definition: Util.h:30
esys
Definition: CheckPointable.cpp:17
esys::lsm::bpu::iter
boost::python::object iter(const boost::python::object &pyOb)
Definition: Util.h:25