Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/share/swig4.0/ruby/ |
Upload File : |
/* std::array */ %fragment("StdArrayTraits","header",fragment="StdSequenceTraits") %{ namespace swig { template <class T, size_t N> struct traits_asptr<std::array<T, N> > { static int asptr(VALUE obj, std::array<T, N> **vec) { return traits_asptr_stdseq<std::array<T, N> >::asptr(obj, vec); } }; template <class T, size_t N> struct traits_from<std::array<T, N> > { static VALUE from(const std::array<T, N>& vec) { return traits_from_stdseq<std::array<T, N> >::from(vec); } }; template <class RubySeq, class T, size_t N> inline void assign(const RubySeq& rubyseq, std::array<T, N>* seq) { if (rubyseq.size() < seq->size()) throw std::invalid_argument("std::array cannot be expanded in size"); else if (rubyseq.size() > seq->size()) throw std::invalid_argument("std::array cannot be reduced in size"); std::copy(rubyseq.begin(), rubyseq.end(), seq->begin()); } template <class T, size_t N> inline void resize(std::array<T, N> *seq, typename std::array<T, N>::size_type n, typename std::array<T, N>::value_type x) { throw std::invalid_argument("std::array is a fixed size container and does not support resizing"); } // Only limited slicing is supported as std::array is fixed in size template <class T, size_t N, class Difference> inline std::array<T, N>* getslice(const std::array<T, N>* self, Difference i, Difference j) { typedef std::array<T, N> Sequence; typename Sequence::size_type size = self->size(); typename Sequence::size_type ii = swig::check_index(i, size, (i == size && j == size)); typename Sequence::size_type jj = swig::slice_index(j, size); if (ii == 0 && jj == size) { Sequence *sequence = new Sequence(); std::copy(self->begin(), self->end(), sequence->begin()); return sequence; } else { throw std::invalid_argument("std::array object only supports getting a slice that is the size of the array"); } } template <class T, size_t N, class Difference, class InputSeq> inline void setslice(std::array<T, N>* self, Difference i, Difference j, const InputSeq& v) { typedef std::array<T, N> Sequence; typename Sequence::size_type size = self->size(); typename Sequence::size_type ii = swig::check_index(i, size, true); typename Sequence::size_type jj = swig::slice_index(j, size); if (ii == 0 && jj == size) { std::copy(v.begin(), v.end(), self->begin()); } else { throw std::invalid_argument("std::array object only supports setting a slice that is the size of the array"); } } template <class T, size_t N, class Difference> inline void delslice(std::array<T, N>* self, Difference i, Difference j) { throw std::invalid_argument("std::array object does not support item deletion"); } } %} %define %swig_array_methods(Type...) %swig_sequence_methods_non_resizable(Type) %enddef %define %swig_array_methods_val(Type...) %swig_sequence_methods_non_resizable_val(Type); %enddef %mixin std::array "Enumerable"; %ignore std::array::push_back; %ignore std::array::pop_back; %rename("delete") std::array::__delete__; %rename("reject!") std::array::reject_bang; %rename("map!") std::array::map_bang; %rename("empty?") std::array::empty; %rename("include?" ) std::array::__contains__ const; %rename("has_key?" ) std::array::has_key const; %include <std/std_array.i>