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
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* EnginePy.tcc
*
* Created on: Jun 8, 2017
* Author: William F Godoy godoywf@ornl.gov
*/
#ifndef ADIOS2_BINDINGS_PYTHON_SOURCE_ENGINEPY_INL_
#define ADIOS2_BINDINGS_PYTHON_SOURCE_ENGINEPY_INL_
#ifndef ADIOS2_BINDINGS_PYTHON_SOURCE_ENGINEPY_H_
#error "Inline file should only be included from it's header, never on it's own"
#endif
#include "adiosPyFunctions.h"
namespace adios
{
template <class T>
void EnginePy::DefineVariableInIO(VariablePy &variable)
{
auto &var = m_IO.DefineVariable<T>(
variable.m_Name, PyListToDims(variable.m_Shape),
PyListToDims(variable.m_Start), PyListToDims(variable.m_Count),
variable.m_IsConstantDims);
variable.m_VariableBase = &var;
variable.m_IsDefined = true;
}
template <class T>
void EnginePy::WriteInIO(VariablePy &variable, const pyArray &array)
{
m_Engine->Write(*dynamic_cast<Variable<T> *>(variable.m_VariableBase),
reinterpret_cast<const T *>(array.data()));
}
} // end namespace adios
#endif /* BINDINGS_PYTHON_SOURCE_ENGINEPY_TCC_ */