added code generator for templated class