Open Matthewacon opened 5 years ago
When defining an inner class, the first parameter for each constructor must be an instance pointer to the encapsulating class:
using namespace FakeJni; class Outer : public JObject { public: DEFINE_CLASS_NAME("com/example/Outer") class Inner : public JObject { public: DEFINE_CLASS_NAME("com/example/Outer$Inner") const Outer& outer; explicit Inner(Outer * const inst) : outer(*inst) {} }; }; BEGIN_NATIVE_DESCRIPTOR(Outer) {Constructor<Outer> {}} END_NATIVE_DESCRIPTOR BEGIN_NATIVE_DESCRIPTOR(Outer::Inner) {Constructor<Outer::Inner, Outer *> {}} END_NATIVE_DESCRIPTOR
For the purposes of JVM functionality compliance, all Outer::Inner instances will be constrained to an encapsulating instance of Outer.
Outer::Inner
Outer
As a nit-pick, is the class identifier not delimited by a $?
$
Yup, completely forgot about that :+1:
When defining an inner class, the first parameter for each constructor must be an instance pointer to the encapsulating class:
For the purposes of JVM functionality compliance, all
Outer::Inner
instances will be constrained to an encapsulating instance ofOuter
.