{
template<class ...Ts>
-class PY2CPP_EXPORT Result;
+class Result;
/*! class Result is used by pyResult function for syntax sugar purpose.
* You can write this:
* std::cerr << py2cpp::getLastPyError();
**/
template<>
-class PY2CPP_EXPORT Result<>
+class Result<>
{
public:
void operator=(PyObject * po)
};
template<class T>
-class PY2CPP_EXPORT Result<T>
+class Result<T>
{
public:
Result() = delete;
};
template<class ...Ts>
-class PY2CPP_EXPORT Result
+class Result
{
public:
Result() = delete;
};
template<class ...Ts>
-PY2CPP_EXPORT Result<Ts...> pyResult(Ts&... args)
+Result<Ts...> pyResult(Ts&... args)
{
return Result<Ts...>(args...);
}
}
template<class ...Ts>
-PY2CPP_EXPORT PyObject * toPy(const std::tuple<Ts...>& vars )
+PyObject * toPy(const std::tuple<Ts...>& vars )
{
PyObject * result = PyTuple_New(sizeof...(Ts));
addInPyTuple<0, Ts... >(result, vars);
// std containers
template <class T>
-PY2CPP_EXPORT PyObject * toPy(const std::vector<T>& values)
+PyObject * toPy(const std::vector<T>& values)
{
PyObject * result = PyList_New(values.size());
for(std::size_t i = 0; i < values.size(); ++i)
}
template <class T>
-PY2CPP_EXPORT PyObject * toPy(const std::list<T>& values)
+PyObject * toPy(const std::list<T>& values)
{
PyObject * result = PyList_New(values.size());
std::size_t i = 0;
}
template <class K, class V>
-PY2CPP_EXPORT PyObject * toPy(const std::map<K, V>& values)
+PyObject * toPy(const std::map<K, V>& values)
{
PyObject * result = PyDict_New();
for(const auto& it: values)
}
template<class ...Ts>
-PY2CPP_EXPORT ConversionCheck fromPy(PyObject * obj, std::tuple<Ts&...>& vars)
+ConversionCheck fromPy(PyObject * obj, std::tuple<Ts&...>& vars)
{
ConversionCheck check;
if(obj)
}
template <class T>
-PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::vector<T>& result)
+ConversionCheck fromPy( PyObject *obj, std::vector<T>& result)
{
ConversionCheck check;
if(PyList_Check(obj))
}
template <class T>
-PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::list<T>& result)
+ConversionCheck fromPy( PyObject *obj, std::list<T>& result)
{
ConversionCheck check;
if(PyList_Check(obj))
}
template <class K, class V>
-PY2CPP_EXPORT ConversionCheck fromPy( PyObject *obj, std::map<K, V>& result)
+ConversionCheck fromPy( PyObject *obj, std::map<K, V>& result)
{
ConversionCheck check;
if(PyDict_Check(obj))
// PyPtr
template<class T>
-PY2CPP_EXPORT T fromPyPtr( const PyPtr& py)
+T fromPyPtr( const PyPtr& py)
{
T result;
fromPy(py.get(), result);
}
template<class T>
-PY2CPP_EXPORT ConversionCheck fromPyPtr( const PyPtr& py, T& var)
+ConversionCheck fromPyPtr( const PyPtr& py, T& var)
{
return fromPy(py.get(), var);
}
template<class T>
-PY2CPP_EXPORT PY2CPP_EXPORT PyPtr toPyPtr(const T& v)
+PyPtr toPyPtr(const T& v)
{
return PyPtr(toPy(v));
}
template<class T>
-PY2CPP_EXPORT T fromPy( PyObject *po)
+T fromPy( PyObject *po)
{
T result;
ConversionCheck check;