Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* adiosPyFunctions.cpp
*
* Created on: Mar 13, 2017
* Author: wfg
*/
#include <iostream>
#include "adiosPyFunctions.h"
namespace adios
{
std::vector<std::size_t> ListToVector( const boost::python::list& list )
{
const boost::python::ssize_t length = boost::python::len( list );
std::vector<std::size_t> vec;
vec.reserve( length );
for( unsigned int i=0; i<length;i++ )
vec.push_back( boost::python::extract<std::size_t>( list[i]) );
return vec;
}
boost::python::list VectorToList( const std::vector<std::size_t>& vec )
{
boost::python::list list;
for( auto vecElement : vec )
{
list.append( vecElement );
}
return list;
}
}