Skip to content

better arrays #3

Open
Open

Description

@electronstudio

Javacpp accesses C arrays via pointers, e.g.
model.materials().position(1).maps().position(2)

This is weird for a Java programmer because it isn't just an accessor; it modifies the position field of the object, and is obviously highly unsafe. It would be better if we could convert the C arrays into Java arrays, or at least wrap a List interface around them.

Activity

  1. added
    enhancement
    help wanted
    on Apr 3, 2020
  2. MerujSargsyan commented on Oct 1, 2024

    @MerujSargsyan
    Contributor

    We could perhaps make a class like ArrayWrapper(Pointer p, int size) with methods such as get(index) and set(index) which will handle the requests carefully using the C style pointers, but the user would not need to be aware of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions