diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /devtools/swigwin-1.3.34/Lib/ruby/std_multiset.i | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'devtools/swigwin-1.3.34/Lib/ruby/std_multiset.i')
| -rw-r--r-- | devtools/swigwin-1.3.34/Lib/ruby/std_multiset.i | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/devtools/swigwin-1.3.34/Lib/ruby/std_multiset.i b/devtools/swigwin-1.3.34/Lib/ruby/std_multiset.i new file mode 100644 index 0000000..01aca0a --- /dev/null +++ b/devtools/swigwin-1.3.34/Lib/ruby/std_multiset.i @@ -0,0 +1,53 @@ +/* + Multisets +*/ + +%include <std_set.i> + +%fragment("StdMultisetTraits","header",fragment="StdSequenceTraits") +%{ + namespace swig { + template <class RubySeq, class T> + inline void + assign(const RubySeq& rubyseq, std::multiset<T>* seq) { +#ifdef SWIG_STD_NOINSERT_TEMPLATE_STL + typedef typename RubySeq::value_type value_type; + typename RubySeq::const_iterator it = rubyseq.begin(); + for (;it != rubyseq.end(); ++it) { + seq->insert(seq->end(),(value_type)(*it)); + } +#else + seq->insert(rubyseq.begin(), rubyseq.end()); +#endif + } + + template <class T> + struct traits_asptr<std::multiset<T> > { + static int asptr(VALUE obj, std::multiset<T> **m) { + return traits_asptr_stdseq<std::multiset<T> >::asptr(obj, m); + } + }; + + template <class T> + struct traits_from<std::multiset<T> > { + static VALUE from(const std::multiset<T>& vec) { + return traits_from_stdseq<std::multiset<T> >::from(vec); + } + }; + } +%} + +#define %swig_multiset_methods(Set...) %swig_set_methods(Set) + + + +%rename("delete") std::multiset::__delete__; +%rename("reject!") std::multiset::reject_bang; +%rename("map!") std::multiset::map_bang; +%rename("empty?") std::multiset::empty; +%rename("include?" ) std::multiset::__contains__ const; +%rename("has_key?" ) std::multiset::has_key const; + +%alias std::multiset::push "<<"; + +%include <std/std_multiset.i> |