-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add
UniquePtrAdapter
and corresponding @UniquePtr
annotation t…
…o support `unique_ptr` containers (issue bytedeco/javacpp-presets#266)
- Loading branch information
Showing
7 changed files
with
119 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/org/bytedeco/javacpp/annotation/UniquePtr.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.bytedeco.javacpp.annotation; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
import org.bytedeco.javacpp.Pointer; | ||
import org.bytedeco.javacpp.tools.Generator; | ||
|
||
/** | ||
* A shorthand for {@code @Adapter("UniquePtrAdapter<type>")}. | ||
* We also need to define the {@code UNIQUE_PTR_NAMESPACE} macro | ||
* to something like {@code boost::movelib} or {@code std}. | ||
* | ||
* @see Adapter | ||
* @see Generator | ||
* | ||
* @author Samuel Audet | ||
*/ | ||
@Documented @Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD, ElementType.PARAMETER}) | ||
@Adapter("UniquePtrAdapter") | ||
public @interface UniquePtr { | ||
/** The template type of {@code UniquePtrAdapter}. If not specified, it is | ||
* inferred from the value type of the {@link Pointer} or Java array. */ | ||
String value() default ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters