added code generator for template class method