A simple c++ observer pattern