Observer Design Pattern in C++