-// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
throw INTERP_KERNEL::Exception("convertFromPyObjVectorOfObj : not a list nor a tuple");
}
+//convertFromVectorAutoObjToPyObj<MEDCoupling::MEDCouplingUMesh>(inpv,SWIGTYPE_p_MEDCoupling__MEDCouplingUMesh)
+template<class T>
+static PyObject *convertFromVectorAutoObjToPyObj(std::vector< MCAuto<T> >& inpVector, swig_type_info *ty)
+{
+ std::size_t sz(inpVector.size());
+ PyObject *ret = PyList_New(sz);
+ for(std::size_t i=0;i<sz;++i)
+ PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(inpVector[i].retn()),ty, SWIG_POINTER_OWN | 0 ));
+ return ret;
+}
+
/*!
* if python int -> cpp int sw=1
* if python list[int] -> cpp vector<int> sw=2
{
vsType[i]=convertPyObjectToStr(o);
}
- catch(INTERP_KERNEL::Exception& e)
+ catch(INTERP_KERNEL::Exception& )
{
std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not a string ! only tuples of strings accepted !";
throw INTERP_KERNEL::Exception(oss.str().c_str());
{
vsType[i]=convertPyObjectToStr(o);
}
- catch(INTERP_KERNEL::Exception& e)
+ catch(INTERP_KERNEL::Exception& )
{
std::ostringstream oss; oss << "List as been detected but element #" << i << " is not a string ! only tuples of strings accepted !";
throw INTERP_KERNEL::Exception(oss.str().c_str());