private void generateDisplay(
        final StringBuilder sb,
        final String name,
        final List<Token> fields,
        final List<Token> groups,
        final List<Token> varData)
    {
        new Formatter(sb).format("\n" +
            "template<typename CharT, typename Traits>\n" +
            "friend std::basic_ostream<CharT, Traits> & operator << (\n" +
            "    std::basic_ostream<CharT, Traits> &builder, const %1$s &_writer)\n" +
            "{\n" +
            "    %1$s writer(\n" +
            "        _writer.m_buffer,\n" +
            "        _writer.m_offset,\n" +
            "        _writer.m_bufferLength,\n" +
            "        _writer.m_actingBlockLength,\n" +
            "        _writer.m_actingVersion);\n\n" +
            "    builder << '{';\n" +
            "    builder << R\"(\"Name\": \"%1$s\", )\";\n" +
            "    builder << R\"(\"sbeTemplateId\": )\";\n" +
            "    builder << writer.sbeTemplateId();\n" +
            "    builder << \", \";\n\n" +
            "%2$s" +
            "    builder << '}';\n\n" +
            "    return builder;\n" +
            "}\n",
            formatClassName(name),
            appendDisplay(fields, groups, varData, INDENT));
    }
\n");
        sb.append("     * The states in which a encoder/decoder/codec can live.\n");
        sb.append("     *\n");
        sb.append("     * <p>The state machine diagram below, encoded in the dot language, describes\n");
        sb.append("     * the valid state transitions according to the order in which fields may be\n");
        sb.append("     * accessed safely. Tools such as PlantUML and Graphviz can render it.\n");
        sb.append("     *\n");
        sb.append("     * <pre>{@code\n");
        fieldPrecedenceModel.generateGraph(sb, "     *   ");
        sb.append("     * }</pre>\n");
        sb.append("
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java