auto p = new Port(reinterpret_cast<Port>(obj));
p->set_index(index);
ptr = reinterpret_cast(p);
~~reinterpret_cast<ion::Port>(obj)->set_index(index);~~
obj doen't need to set_index, otherwise have issue on following example
p0 = ports[0]
p1 = ports[1]
when access ports again, the index of ports will be 0 instead of -1
auto p = new Port(reinterpret_cast<Port>(obj)); p->set_index(index); ptr = reinterpret_cast(p);
~~reinterpret_cast<ion::Port >(obj)->set_index(index);~~
obj doen't need to set_index, otherwise have issue on following example