scilab: support of container of float

This commit is contained in:
Simon Marchetto 2014-04-11 16:30:34 +02:00
commit eba82b02f5
3 changed files with 15 additions and 12 deletions

View file

@ -83,7 +83,7 @@ namespace std {
}
%}
%define instantiate_containers_templates(TYPE...)
%define %instantiate_containers_templates(TYPE...)
namespace std
{
%template(TYPE ## _vector) std::vector<TYPE>;
@ -94,7 +94,7 @@ namespace std
}
%enddef
%define instantiate_containers_functions(TYPE...)
%define %instantiate_containers_functions(TYPE...)
namespace std
{
%template(ret_ ## TYPE ## _vector) ret_container<TYPE, std::vector<TYPE> >;
@ -115,14 +115,14 @@ namespace std
}
%enddef
instantiate_containers_templates(int);
instantiate_containers_templates(double);
instantiate_containers_templates(bool);
instantiate_containers_templates(string);
instantiate_containers_templates(ClassAPtr);
%define %instantiate_containers_templates_and_functions(TYPE...)
%instantiate_containers_templates(TYPE);
%instantiate_containers_functions(TYPE);
%enddef
instantiate_containers_functions(int);
instantiate_containers_functions(double);
instantiate_containers_functions(bool);
instantiate_containers_functions(string);
instantiate_containers_functions(ClassAPtr);
%instantiate_containers_templates_and_functions(int);
%instantiate_containers_templates_and_functions(double);
%instantiate_containers_templates_and_functions(float);
%instantiate_containers_templates_and_functions(bool);
%instantiate_containers_templates_and_functions(string);
%instantiate_containers_templates_and_functions(ClassAPtr);

View file

@ -89,6 +89,7 @@ endfunction
function testContainer(container)
testContainerType(container, "int", 1, 2, [1, 2], 3);
testContainerType(container, "double", 2., 3., [2., 3.], 5.);
testContainerType(container, "float", 2., 3., [2., 3.], 5.);
testContainerType(container, "string", "a", "b", ["a", "b"], "ab");
testContainerType(container, "bool", %F, %T, [%F, %T], %T);
testContainerPtr("vector", 1, 3, 4);

View file

@ -26,6 +26,7 @@
%include <scisequencepointer.swg>
%include <scisequenceint.swg>
%include <scisequencedouble.swg>
%include <scisequencefloat.swg>
%include <scisequencestring.swg>
%include <scisequencebool.swg>
@ -188,6 +189,7 @@ namespace swig {
%add_traits_sequence(int, int);
%add_traits_sequence(double, double);
%add_traits_sequence(float, float);
%add_traits_sequence(std::string, char*);
%add_traits_sequence(bool, int);