Added new rubycontainer_extended.swg file.
This file contains standard ruby algorithms but which place some restriction on the class inside the STL container. Fixed GC_VALUE so that it cannot be instantiated from the language manually. Fixed delete autodoc. Started documenting each portion of the SWIG templates/macros so it makes sense to people. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9773 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c361c83aea
commit
1c46a18c50
6 changed files with 212 additions and 45 deletions
|
|
@ -579,23 +579,6 @@ namespace swig
|
|||
%extend {
|
||||
|
||||
|
||||
// Implementing delete requires semantics that go beyond the
|
||||
// default requirements of STD containers.
|
||||
//
|
||||
// VALUE __delete__( Sequence::value_type e ) {
|
||||
// VALUE r = Qnil;
|
||||
// std::size_t len = $self->size();
|
||||
// std::remove_if( $self->begin(), $self->end(),
|
||||
// std::bind2nd( std::equal_to< Sequence::value_type >(),
|
||||
// e ) );
|
||||
//
|
||||
// if ( $self->size() != len )
|
||||
// r = swig::from< Sequence::value_type >( e );
|
||||
// else if ( rb_block_given_p() )
|
||||
// r = rb_yield(Qnil);
|
||||
// return r;
|
||||
// }
|
||||
|
||||
VALUE slice( difference_type i, difference_type j )
|
||||
{
|
||||
if ( j <= 0 ) return Qnil;
|
||||
|
|
@ -681,6 +664,12 @@ namespace swig
|
|||
return r;
|
||||
}
|
||||
|
||||
|
||||
VALUE __delete2__(const value_type& i) {
|
||||
VALUE r = Qnil;
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
%enddef
|
||||
|
||||
|
|
@ -1033,3 +1022,6 @@ namespace swig {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%include <rubycontainer_extended.swg>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue