Skip to content

Add PointerWrapper type#140

Open
goto1134 wants to merge 2 commits intojnr:masterfrom
goto1134:pointer-wrapper
Open

Add PointerWrapper type#140
goto1134 wants to merge 2 commits intojnr:masterfrom
goto1134:pointer-wrapper

Conversation

@goto1134
Copy link
Copy Markdown
Contributor

@goto1134 goto1134 commented Aug 30, 2017

You can extend PointerWrapper for typesafe pointer. Example:

public interface TestLib {
      CustomPointer ptr_malloc(@size_t int size);
      void ptr_free(CustomPointer ptr);

      class CustomPointer extends PointerWrapper {
          private CustomPointer(Pointer pointer) {
              super(pointer);
          }
      }
  }
}

You can extend PointerWrapper for typesafe pointer. Example:
 public interface TestLib {
      CustomPointer ptr_malloc(@size_t int size);
      void ptr_free(CustomPointer ptr);

      class CustomPointer extends PointerWrapper {
          private CustomPointer(Pointer pointer) {
              super(pointer);
          }
      }
  }
 }

(cherry picked from commit 98ca7da)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant