my .h file like this:class ClassA: public std::unordered_multimap
i add Info Like this: infoMap.put(new Info("std::unordered_multimap
Please start by reading this page: https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes
Please start by reading this page: https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes
@saudet
yes,i hava saw this page.
as the below content:
Providing properties for each platform
Including multiple header files
Ignoring attributes and macros
Defining macros and controlling their blocks
Mapping macros to fields or methods
Skipping lines from header files
Specifying names to use in Java
Mapping a declaration to custom code
Redefining the code of a macro
Writing additional code in a helper class
Creating instances of C++ templates
Defining wrappers for basic C++ containers
Using adapters for C++ container types
Dealing with abstract classes and virtual methods
as i know,this page tell us how to map variable or method from c++ to java;
but my case is different,it is a class extends c++ containers, i don't know how to write my java configuration file.
please tell me how to do it.thanks!
Try this:
https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes#defining-wrappers-for-basic-c-containers
@saudet
yes,i have tried it.
infoMap.put(new Info("basic/containers").cppTypes("std::array", "std::bitset", "std::deque", "std::list", "std::map", "std::queue", "std::set", "std::stack", "std::vector", "std::valarray", "std::pair", "std::forward_list""std::priority_queue","std::unordered_map","std::unordered_multimap", "std::unordered_set"));
infoMap.put(new Info("std::unordered_multimap
as i know,std::unordered_multimap
but get error as below:
[ERROR] std::unordered_multimap
below is my .h file info :
class ClassA: public std::unordered_multimap
@saudet
What confuses me is,according to my configuration file,std::unordered_multimap
You'll need to remove spaces in the template parameters. The parser isn't too robust in that sense:
https://github.com/bytedeco/javacpp/wiki/Mapping-Recipes#creating-instances-of-c-templates
@saudet
i have removed whitespaces between template arguments as below:
infoMap.put(new Info("std::unordered_multimap
but also get error as below:
[ERROR] std::unordered_multimap
You'll need to put the template parameters inside < ... >
@saudet
sorry,i just omitted the '<' and '>'.
in fact,i have removed whitespaces between template arguments as below:
infoMap.put(new Info("std::unordered_multimap
and get error as below:
[ERROR] std::unordered_multimap
also generate the std::unordered_multimap
Well, you probably made a typo somewhere. It works with std::map right? If
you want me to debug your code, you'll need to give it to me...
@saudet
it also works with std::unordered_multimap in case of mapping variable.
.h file as below
class A : public std::unordered_multimap
it contains line breaks,Will this affect?
if i want you to help me debug my code,i need to give you java configuration file,are there other files needed?
A simple header file that should work but doesn't work is probably the only thing I need to check this. Thanks
@saudet
header_file.zip
line 71,72
Well, VariableValue isn't defined, but if I give it a C++ class like this:
class VariableValue {
};
Then this works just fine:
infoMap.put(new Info("basic/containers").cppTypes("std::unordered_multimap"));
infoMap.put(new Info("std::unordered_multimap<std::string,modsecurity::VariableValue*,modsecurity::MyHash,modsecurity::MyEqual>").pointerTypes("MyMap").define());
@saudet
wow,it's ok!thank you very much!