public void writeSlimeDecoder(Writer w, CNode node, String parent, boolean root) throws IOException {
        String tmpName = getTypeName(node, false);
        String typeName = root ? getInternalClassName(node) : tmpName;
        String indent = "    ";
        if (root) {
            w.write(""
                    + typeName + "::" + typeName + "(const ::config::ConfigDataBuffer & __buffer)\n"
                    + "{\n");
            w.write(indent + "const vespalib::Slime & __slime(__buffer.slimeObject());\n");
            w.write(indent + "vespalib::slime::Inspector & __croot = __slime.get();\n");
            w.write(indent + "vespalib::slime::Inspector & __inspector = __croot[\"configPayload\"];\n");
        } else {
            w.write(""
                    + parent + typeName + "(const vespalib::slime::Inspector & __inspector)\n"
                    + "{\n");
        }

        for (CNode child : node.getChildren()) {
            String childName = getIdentifier(child.getName());
            String childType = getTypeName(child, false);
            String inspectorLine = "__inspector[\"" + child.getName() + "\"][\"value\"]";
            if (child.isArray) {
                w.write(indent + "for (size_t __i = 0; __i < " + inspectorLine + ".children(); __i++) {\n");
                w.write(indent + "    " + childName + ".push_back(");
                writeSlimeChild(w, child, childType, inspectorLine);
                w.write(");\n");
                w.write(indent + "}\n");
            } else if (child.isMap) {
                w.write(indent + "for (size_t __i = 0; __i < " + inspectorLine + ".children(); __i++) {\n");
                w.write(indent + "    " + childName + "[" + inspectorLine + "[__i][\"key\"].asString().make_string()] = ");
                writeSlimeChild(w, child, childType, inspectorLine);
                w.write(";\n");
                w.write(indent + "}\n");
            } else {
                w.write(indent + childName + " = ");
                if (child instanceof LeafCNode.EnumLeaf) {
                    String repType = slimeTypeMap.get("enum");
                    w.write("get" + childType + "(" + inspectorLine + ".as" + repType + "().make_string())");
                } else if (child instanceof LeafCNode) {
                    String type = ((LeafCNode) child).getType();
                    String repType = slimeTypeMap.get(type);
                    if ("String".equals(repType)) {
                        w.write("" + inspectorLine + ".as" + repType + "().make_string()");
                    } else {
                        w.write("" + inspectorLine + ".as" + repType + "()");
                    }
                } else {
                    w.write(childType + "(" + inspectorLine + ")");
                }
                w.write(";\n");
            }
        }
        w.write("}\n\n");
    }
\n");
        do {
            String current;
            // Extract first line to write
            int newLine = comment.indexOf('\n');
            if (newLine == -1) {
                current = comment;
                comment = "";
            } else {
                current = comment.substring(0, newLine);
                comment = comment.substring(newLine + 1);
            }
            // If line too long, cut it in two
            if (current.length() > maxLineLen) {
                int spaceIndex = current.lastIndexOf(' ', maxLineLen);
                if (spaceIndex >= maxLineLen - 15) {
                    comment = current.substring(spaceIndex + 1)
                              + "\n" + comment;
                    current = current.substring(0, spaceIndex);
                } else {
                    comment = current.substring(maxLineLen) + "\n" + comment;
                    current = current.substring(0, maxLineLen) + "-";
                }
            }
            w.write(indent + (javadoc ? " * " : "// ") + current + "\n");
        } while (comment.length() > 0);
        if (javadoc) w.write(indent + "
configgen/src/main/java/com/yahoo/config/codegen/CppClassBuilder.java