Skip to content
Snippets Groups Projects
MethodPy.h 1.21 KiB
Newer Older
 * Distributed under the OSI-approved Apache License, Version 2.0.  See
 * accompanying file Copyright.txt for details.
 *
 * MethodPy.h
 *
 *  Created on: Mar 14, 2017
 *      Author: wfg
 */

#ifndef METHODPY_H_
#define METHODPY_H_

#ifdef HAVE_BOOSTPYTHON
#include "adios2/boost/python.hpp"
#endif

#ifdef HAVE_PYBIND11
#include "adios2/pybind11/cast.h"
#include "adios2/pybind11/pybind11.h"
#include "adios2/core/Method.h"
#ifdef HAVE_BOOSTPYTHON
using pyObject = boost::python::object;
using pyTuple = boost::python::tuple;
using pyDict = boost::python::dict;
#endif

#ifdef HAVE_PYBIND11
using pyObject = pybind11::object;
using pyTuple = pybind11::tuple;
using pyDict = pybind11::dict;
#endif

class MethodPy : public Method
{

public:
    MethodPy(const std::string type, const bool debugMode);
#ifdef HAVE_BOOSTPYTHON
    static pyObject SetParametersPy(pyTuple args, pyDict kwargs);
    static pyObject AddTransportPy(pyTuple args, pyDict kwargs);
#ifdef HAVE_PYBIND11
    void SetParametersPyBind11(pybind11::kwargs kwargs);
    void AddTransportPyBind11(const std::string type, pybind11::kwargs kwargs);
    void PrintAll() const;