Commit 630c6556 authored by Joseph Pallamidessi's avatar Joseph Pallamidessi

Update serialization of sub-structure

parent 4e37c830
...@@ -264,7 +264,12 @@ void CSymbol::print(FILE *fp) ...@@ -264,7 +264,12 @@ void CSymbol::print(FILE *fp)
{ {
fprintf(fpOutputFile,"\tfor(int EASEA_Ndx=0; EASEA_Ndx<%d; EASEA_Ndx++)\n", fprintf(fpOutputFile,"\tfor(int EASEA_Ndx=0; EASEA_Ndx<%d; EASEA_Ndx++)\n",
pSym->Object->nSize/pSym->Object->pType->nSize); pSym->Object->nSize/pSym->Object->pType->nSize);
fprintf(fpOutputFile,"\t\tEASEA_Line << this->%s[EASEA_Ndx] <<\" \";\n", pSym->Object->sName); fprintf(fpOutputFile,"\t\tEASEA_Line << this->%s[EASEA_Ndx].serializer() <<\" \";\n", pSym->Object->sName);
}
// it's a simple struct/class
else if(pSym->Object->ObjectType==oObject)
{
fprintf(fpOutputFile,"\t\tEASEA_Line << this->%s.serializer() <<\" \";\n", pSym->Object->sName);
} }
else else
{ {
...@@ -306,6 +311,7 @@ void CSymbol::print(FILE *fp) ...@@ -306,6 +311,7 @@ void CSymbol::print(FILE *fp)
{ {
if(pSym->Object->pType->ObjectType==oUserClass) if(pSym->Object->pType->ObjectType==oUserClass)
{ {
/* it's an array of pointer */
if (pSym->Object->ObjectType==oArrayPointer) if (pSym->Object->ObjectType==oArrayPointer)
{ {
fprintf(fp,"\tfor(int EASEA_Ndx=0; EASEA_Ndx<%d; EASEA_Ndx++){\n", fprintf(fp,"\tfor(int EASEA_Ndx=0; EASEA_Ndx<%d; EASEA_Ndx++){\n",
...@@ -321,6 +327,19 @@ void CSymbol::print(FILE *fp) ...@@ -321,6 +327,19 @@ void CSymbol::print(FILE *fp)
fprintf(fpOutputFile,"\t\t}"); fprintf(fpOutputFile,"\t\t}");
fprintf(fpOutputFile,"\t}"); fprintf(fpOutputFile,"\t}");
} }
/* it's a classical array*/
else if(pSym->Object->ObjectType==oArray)
{
fprintf(fpOutputFile,"\tfor(int EASEA_Ndx=0; EASEA_Ndx<%d; EASEA_Ndx++)\n",
pSym->Object->nSize/pSym->Object->pType->nSize);
fprintf(fpOutputFile,"\t\tthis->%s[EASEA_Ndx].deserializer(&EASEA_Line) ;\n", pSym->Object->sName);
}
/* it's a simple struct/class */
else if(pSym->Object->ObjectType==oObject)
{
fprintf(fpOutputFile,"\t\tthis->%s.deserializer(EASEA_Line);\n", pSym->Object->sName);
}
/*it's a pointer*/
else else
{ {
fprintf(fpOutputFile,"\t(*EASEA_Line) >> line;\n"); fprintf(fpOutputFile,"\t(*EASEA_Line) >> line;\n");
...@@ -577,6 +596,7 @@ void CSymbol::serializeIndividual(FILE *fp, char* sCompleteName) ...@@ -577,6 +596,7 @@ void CSymbol::serializeIndividual(FILE *fp, char* sCompleteName)
pSym->Object->nSize/pSym->Object->pType->nSize); pSym->Object->nSize/pSym->Object->pType->nSize);
fprintf(fpOutputFile,"\t\tEASEA_Line << this->%s[EASEA_Ndx].serializer() <<\" \";\n", pSym->Object->sName); fprintf(fpOutputFile,"\t\tEASEA_Line << this->%s[EASEA_Ndx].serializer() <<\" \";\n", pSym->Object->sName);
} }
// it's a simple struct/class
else if(pSym->Object->ObjectType==oObject) else if(pSym->Object->ObjectType==oObject)
{ {
fprintf(fpOutputFile,"\tEASEA_Line << \"\\a \";\n"); fprintf(fpOutputFile,"\tEASEA_Line << \"\\a \";\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment