void MemberClass::ExportDataCode(FILE *outfile, char *recordName) { for (PointerList<Datum>::Walker walk(&m_datumList); walk.IsValid(); walk.Next()) { Datum *dat = walk.GetObj(); if(dat->m_maxSize <= 0) { switch(dat->m_type) { case DATUM_RECORD: fprintf(outfile, "const %sRecord *%sRecord::%s::Get%s() const\n", dat->m_subType, recordName, m_name, dat->m_name); fprintf(outfile, "{\n"); fprintf(outfile, " return g_the%sDB->Get(m_%s);\n", dat->m_subType, dat->m_name); fprintf(outfile, "}\n\n"); break; case DATUM_BIT_PAIR: if(dat->m_bitPairDatum->m_type == DATUM_RECORD) { fprintf(outfile, "const %sRecord *%sRecord::%s::Get%sPtr() const\n", dat->m_bitPairDatum->m_subType, recordName, m_name, dat->m_name); fprintf(outfile, "{\n"); fprintf(outfile, " return g_the%sDB->Get(m_%s);\n", dat->m_bitPairDatum->m_subType, dat->m_bitPairDatum->m_name); fprintf(outfile, "}\n\n"); } break; default: break; } } else { switch(dat->m_type) { case DATUM_RECORD: fprintf(outfile, "sint32 %sRecord::%s::Get%sIndex(sint32 index) const\n", recordName, m_name, dat->m_name); fprintf(outfile, "{\n"); dat->ExportRangeCheck(outfile); fprintf(outfile, " return m_%s[index];\n", dat->m_name); fprintf(outfile, "}\n\n"); fprintf(outfile, "const %sRecord * %sRecord::%s::Get%s(sint32 index) const\n", dat->m_subType, recordName, m_name, dat->m_name); fprintf(outfile, "{\n"); dat->ExportRangeCheck(outfile); fprintf(outfile, " return g_the%sDB->Get(m_%s[index]);\n", dat->m_subType, dat->m_name); fprintf(outfile, "}\n\n"); break; case DATUM_STRUCT: fprintf(outfile, "const %sRecord::%s * %sRecord::%s::Get%s(sint32 index) const\n", recordName, dat->m_subType, recordName, m_name, dat->m_name); fprintf(outfile, "{\n"); dat->ExportRangeCheck(outfile); fprintf(outfile, " return &m_%s[index];\n", dat->m_name); fprintf(outfile, "}\n\n"); break; default: Assert(false); break; } } } }