Access to cpp.Struct fields when wrapped as Dynamic (and in cppia?)

Open
#1,176 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
backend

Research direction

The issue names no files or tests. Start by locating the cpp.Struct-to-Dynamic conversion and the cppia handling for cpp.Struct; done means reflected field access such as d.foo works for wrapped Native structs, with cppia support clarified as part of the scope.

Written by the indexing model from the issue text.

Description

Let's say Native is a c++ struct with a float foo field.

final n:Native = allocNativeSomehow();
final s:cpp.Struct<Native> = n;
trace(n.foo); // works
final d:Dynamic = s;
trace(d.foo): // null

It would be nice to generate a Dynamic wrapper for each cpp.Struct with proper reflection support. And I assume it is possible (?) because the type information of Native is known by Haxe at compile time.

I also assume that would enable access to cpp.Struct from cppia as well?

Dominant language
C++
Stars
330
Forks
237
Avg merge
1d 3h
Merged PRs (30d)
20

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HaxeFoundation/hxcpp

All issues in HaxeFoundation/hxcpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.