add std_map
fix compact mode git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11731 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9b318c45bc
commit
b279cd3dde
5 changed files with 36 additions and 27 deletions
|
|
@ -50,7 +50,7 @@ SWIG_InitializeModule(0);
|
|||
%typemap(scheck) SWIGTYPE[ANY]
|
||||
%{
|
||||
# assert(length($input) > $1_dim0)
|
||||
assert(all(sapply($input, class) == "$R_class"))
|
||||
assert(all(sapply($input, class) == "$R_class"));
|
||||
%}
|
||||
|
||||
%typemap(out) void "";
|
||||
|
|
@ -122,14 +122,14 @@ SWIG_InitializeModule(0);
|
|||
/* Handling vector case to avoid warnings,
|
||||
although we just use the first one. */
|
||||
%typemap(scheck) unsigned int %{
|
||||
assert(length($input) == 1 && $input >= 0, "All values must be non-negative")
|
||||
assert(length($input) == 1 && $input >= 0, "All values must be non-negative");
|
||||
%}
|
||||
|
||||
|
||||
%typemap(scheck) int, long %{
|
||||
if(length($input) > 1) {
|
||||
warning("using only the first element of $input")
|
||||
}
|
||||
warning("using only the first element of $input");
|
||||
};
|
||||
%}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@
|
|||
%typemap(scoercein) std::string, std::string *, std::string &
|
||||
%{ $input = as($input, "character"); %}
|
||||
%typemap(scoercein) enum SWIGTYPE
|
||||
%{ $input = enumToInteger($input, "$R_class") %}
|
||||
%{ $input = enumToInteger($input, "$R_class"); %}
|
||||
%typemap(scoercein) enum SWIGTYPE &
|
||||
%{ $input = enumToInteger($input, "$R_class") %}
|
||||
%{ $input = enumToInteger($input, "$R_class"); %}
|
||||
%typemap(scoercein) enum SWIGTYPE *
|
||||
%{ $input = enumToInteger($input, "$R_class") %}
|
||||
%{ $input = enumToInteger($input, "$R_class"); %}
|
||||
|
||||
|
||||
%typemap(scoercein) SWIGTYPE, SWIGTYPE *, SWIGTYPE &
|
||||
|
|
@ -84,14 +84,14 @@
|
|||
%typemap(scoercein) SWIGTYPE[ANY]
|
||||
%{
|
||||
if(is.list($input))
|
||||
assert(all(sapply($input, class) == "$R_class"))
|
||||
assert(all(sapply($input, class) == "$R_class"));
|
||||
%}
|
||||
|
||||
|
||||
/* **************************************************************** */
|
||||
|
||||
%typemap(scoercein) bool, bool *, bool &
|
||||
"$input = as.logical($input) ";
|
||||
"$input = as.logical($input);";
|
||||
%typemap(scoercein) int,
|
||||
int *,
|
||||
int &,
|
||||
|
|
|
|||
5
Lib/r/std_map.i
Normal file
5
Lib/r/std_map.i
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%fragment("StdMapTraits","header")
|
||||
%{
|
||||
%}
|
||||
|
||||
%include <std/std_map.i>
|
||||
|
|
@ -1 +1,5 @@
|
|||
%include<std/std_pair.i>
|
||||
%fragment("StdPairTraits","header")
|
||||
%{
|
||||
%}
|
||||
|
||||
%include<std/std_pair.i>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue