You might want to read this article about callbacks in C/C++.
Note that SystemVerilog does not have function pointers, but you can use a handle to a class with a method and call the method. Callbacks is a methodology that was developed before objected-oriented programming became popular. We prefer that you use virtual methods to achieve the same functionality in most cases, as it has less performance overhead.