Pass a pointer to the other function/class and access it there.