obj doen't need to set_index, otherwise have issue on following example
p0 = ports[0] (make a copy of ports and set index to 0)
p1 = ports[1] (make a copy of ports and set index to 1)
when access ports again, the index of ports will be 1 instead of -1
reinterpret_cast<ion::Port*>(obj)->set_index(index);obj doen't need to set_index, otherwise have issue on following example p0 = ports[0] (make a copy of ports and set index to 0) p1 = ports[1] (make a copy of ports and set index to 1) when access ports again, the index of ports will be 1 instead of -1