cpp: downcast added several options:

enum in every object -> fastest
virtual getKind() on every object: twice as slow as enum
vtable: fast and small but can only handle 1 abstraction layer