PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/trunk/Lib/python/std_vector.i

#
Swig | 27 lines | 20 code | 4 blank | 3 comment | 0 complexity | ceaf5271782d5054a038ede12f8e23fa MD5 | raw file
 1/*
 2  Vectors
 3*/
 4
 5%fragment("StdVectorTraits","header",fragment="StdSequenceTraits")
 6%{
 7  namespace swig {
 8    template <class T>
 9    struct traits_asptr<std::vector<T> >  {
10      static int asptr(PyObject *obj, std::vector<T> **vec) {
11	return traits_asptr_stdseq<std::vector<T> >::asptr(obj, vec);
12      }
13    };
14    
15    template <class T>
16    struct traits_from<std::vector<T> > {
17      static PyObject *from(const std::vector<T>& vec) {
18	return traits_from_stdseq<std::vector<T> >::from(vec);
19      }
20    };
21  }
22%}
23
24#define %swig_vector_methods(Type...) %swig_sequence_methods(Type)
25#define %swig_vector_methods_val(Type...) %swig_sequence_methods_val(Type);
26
27%include <std/std_vector.i>