Comments (10)
JavaCPP needs a FunctionPointer peer class
from javacpp.
Sure. The problem, if I understood well, is the @SharedPtr
annotation not taken into account by the Generator when generating the peer class.
from javacpp.
Right, so where is that FunctionPointer class?
from javacpp.
@Properties(inherit = presets.P.class)
public class S_F extends FunctionPointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public S_F(Pointer p) { super(p); }
protected S_F() { allocate(); }
private native void allocate();
public native @SharedPtr S call();
}
That's the class automatically generated by the parser from the C++ code above.
from javacpp.
You'll need to add at least a @Cast
to that...
from javacpp.
public native @Cast({"", "std::shared_ptr<S>"}) @SharedPtr S call();
seems to work. Thanks.
Do we close this issue or keep it open in case there is something to fix to avoid this @Cast
?
from javacpp.
We need to specify the type somehow. As I've mentioned somewhere before, think of @Cast
as if it were named @As
instead.
from javacpp.
@SharedPtr
already means that the function returns a shared_ptr
of S
. For a normal function, that calls a native function of the object pointed by the Pointer
instead of the native function directly pointed by the Pointer
, we don't need the @Cast
.
from javacpp.
No, it doesn't, for example, see issue #717
from javacpp.
In #717 the @Cast
is to disambiguate between 2 overloads of unique_ptr.operator=
. The @Cast
doesn't change the type of the field.
from javacpp.
Related Issues (20)
- retain and release method of DeallocatorReference HOT 5
- NativeDeallocator do not release memory problem HOT 11
- JavaFXFrameConverter.java:[47,12] cannot find symbol symbol: class Image HOT 2
- Warning with "JavaCPP_createStringFromUTF16" method on Mac clang 15
- The current 1.5.10-SNAPSHOT builds are broken and point to missing artifacts HOT 5
- JavaCPP can't link dll file HOT 1
- Open CV 4.8.0 integration HOT 2
- Parser mapping HOT 12
- 'jni.h' file not found HOT 6
- windows Cannot run program "cl" HOT 1
- std::unique_ptr fields HOT 4
- Optional pair HOT 2
- ParserException for valid c++ code HOT 1
- LNK2001: Unresolved external, issue with namespace? HOT 7
- infinite recursion when calling virtualized inherited function HOT 4
- Mapping Template Constraints, Parser Error HOT 5
- Parser cannot compile because of QT HOT 4
- Template class with template functions HOT 15
- Inadequate Error Handling HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javacpp.