def METHOD_NAME(elements, outputfile=None, inttype='len_t', realtype='real_t'):
    """
    Generate a C++ file containing the given ADAS data.
    """
    ds = ""
    ss = "const {0} adas_rate_n = {1};\nstruct adas_rate adas_rate_table[{1}] = {{\n".format(inttype, len(elements))
    sd = None
    # Write data
    for elname, ratedata in elements.items():
        Z = ratedata['Z']
        A = ratedata['A']
        if sd is not None: sd += "},\n"
        else: sd = ""
        sd += "\t{{\"{0}\",{0}_Z,{0}_A".format(elname)
        ds += "/* {} */\n".format(elname)
        ds += "const {0} {1}_Z = {2};\n".format(inttype, elname, Z)
        ds += "const {0} {1}_A = {2};\n".format(inttype, elname, A)
        # acd, ccd, scd, plt, prb
        for dt, data in ratedata.items():
            if dt in ['A', 'Z']: continue
            nn = len(data['n'])
            nT = len(data['T'])
            ds += "const {0} {1}_{2}_nn = {3};\nconst {0} {1}_{2}_nT = {4};\n".format(inttype, elname, dt, nn, nT)
            ds += "const {0} {1}_{2}_n[{3}] = {{".format(realtype, elname, dt, nn)
            ds += ','.join(['{:.5f}'.format(x) for x in data['n']])
            ds += "};\n"
            ds += "const {0} {1}_{2}_T[{3}] = {{".format(realtype, elname, dt, nT)
            ds += ','.join(['{:.5f}'.format(x) for x in data['T']])
            ds += "};\n"
            ds += "const {0} {1}_{2}_coeff[{3}] = {{".format(realtype, elname, dt, Z*nn*nT)
            ds += ','.join(['{:.5f}'.format(x) for x in data['data'].flatten()])
            ds += "};\n\n"
            sd += ",{0}_{1}_nn,{0}_{1}_nT,{0}_{1}_n,{0}_{1}_T,{0}_{1}_coeff".format(elname, dt)
    sd += "}\n};\n"
    filecontents  = "/* This file was auto-generated by 'get_adas.py' on {} */\n\n".format(datetime.datetime.now().isoformat(sep=' ', timespec='seconds'))
    filecontents += "#include \"DREAM/adasdata.h\"\n\n"
    filecontents += ds + ss + sd
    if outputfile is not None:
        # Create directory if it doesn't already exists
        pathlib.Path(outputfile).parent.mkdir(parents=True, exist_ok=True)
        # Write C++ file
        with open(outputfile, 'w') as f:
            f.write(filecontents)
    return filecontents