Added functions to get derived template class from interface and a macro to generate them.