scilab: support of std::deque

This commit is contained in:
Simon Marchetto 2014-03-11 18:34:14 +01:00
commit 8701e6f843
5 changed files with 64 additions and 8 deletions

View file

@ -1 +1,31 @@
%include <std/_std_deque.i>
/*
*
* C++ type : STL deque
* Scilab type : matrix (for vectors of primitive types) or list (for sets of all other types : pointers...)
*
*/
%fragment("StdDequeTraits","header",fragment="StdSequenceTraits")
%{
namespace swig {
template <class T>
struct traits_asptr<std::deque<T> > {
static int asptr(const SwigSciObject &obj, std::deque<T> **deq) {
return traits_asptr_stdseq<std::deque<T> >::asptr(obj, deq);
}
};
template <class T>
struct traits_from<std::deque<T> > {
static SwigSciObject from(const std::deque<T>& deq) {
return traits_from_stdseq<std::deque<T> >::from(deq);
}
};
}
%}
#define %swig_deque_methods(Type...) %swig_sequence_methods(Type)
#define %swig_deque_methods_val(Type...) %swig_sequence_methods_val(Type);
%include <std/std_deque.i>

View file

@ -2,5 +2,6 @@
%include std_common.i
%include std_string.i
%include std_vector.i
%include std_set.i
%include std_deque.i
%include std_list.i
%include std_set.i