PageRenderTime 37ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Lib/ruby/std_list.i

#
Swig | 41 lines | 29 code | 9 blank | 3 comment | 0 complexity | 80c382011093523c7b76bf6154246197 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /*
  2. Lists
  3. */
  4. %fragment("StdListTraits","header",fragment="StdSequenceTraits")
  5. %{
  6. namespace swig {
  7. template <class T >
  8. struct traits_asptr<std::list<T> > {
  9. static int asptr(VALUE obj, std::list<T> **lis) {
  10. return traits_asptr_stdseq<std::list<T> >::asptr(obj, lis);
  11. }
  12. };
  13. template <class T>
  14. struct traits_from<std::list<T> > {
  15. static VALUE from(const std::list<T> & vec) {
  16. return traits_from_stdseq<std::list<T> >::from(vec);
  17. }
  18. };
  19. }
  20. %}
  21. %ignore std::list::push_back;
  22. %ignore std::list::pop_back;
  23. #define %swig_list_methods(Type...) %swig_sequence_methods(Type)
  24. #define %swig_list_methods_val(Type...) %swig_sequence_methods_val(Type);
  25. %rename("delete") std::list::__delete__;
  26. %rename("reject!") std::list::reject_bang;
  27. %rename("map!") std::list::map_bang;
  28. %rename("empty?") std::list::empty;
  29. %rename("include?" ) std::list::__contains__ const;
  30. %rename("has_key?" ) std::list::has_key const;
  31. %alias std::list::push "<<";
  32. %include <std/std_list.i>