Hello,
I'm trying to use a piece of code that looks like this:
struct
Request {...}
struct Response {...}
std::future<std::unique_ptr< Response>> AsyncInfer(
const Request& request)
And I have two nested containers.
I've tried to write an adapter for std::future:
public class testWrapper implements InfoMapper {
static { Loader.checkVersion("org.bytedeco", "testWrapper"); }
@Override
public void map(InfoMap infoMap) {
infoMap.putFirst(new Info().enumerate(false))
.put(new Info("std::future").skip().annotations("@StdFuture"))
.put(new Info("std::unique_ptr<testWrapper::Response>").pointerTypes("@UniquePtr Response"))
;
}
@Documented @Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.PARAMETER})
@Adapter("FutureAdapter")
public @interface StdFuture {
String value() default "";
}
}
However the generator is giving me this error
In function '_jobject* Java_org_bytedeco testWrapper _ ... _AsyncInfer(JNIEnv*, jobject, jobject)':
/workspace/javacpp/javacpp-presets/
testWrapper /target/native/org/bytedeco/
testWrapper/linux-x86_64/jnitestWrapper.cpp:15590:159: error: no matching function for call to 'UniquePtrAdapter<Result>::UniquePtrAdapter(std::future<std::unique_ptr<Result> >)'
15590 | UniquePtrAdapter< Result > radapter(ptr->AsyncInfer(*(const Request*)ptr0));
|
Am I missing something with creating the adapter to @StdFuture? Is there an example I can follow?
Best,
Katherine