Training c++/ Event driven class