ESyS-Particle  2.3
Util.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2014 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.opensource.org/licenses/osl-3.0.php //
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
boost::python::object iter(const boost::python::object &pyOb)
Definition: Util.h:25
Definition: CheckPointable.cpp:16
int len(const boost::python::object &pyOb)
Definition: Util.h:30