Use inheritance for addrmap This is a simply C++-ification of the basics of addrmap: it uses virtual methods rather than a table of function pointers, and it changes the concrete implementations to be subclasses.