TestRecord::TestRecord(){ push(boolField,"boolField"); push(charField,"charField"); push(shortField,"shortField"); push(intField,"intField"); push(longField,"longField"); push(bigintField,"bigintField"); push(floatField,"floatField"); push(doubleField,"doubleField"); push(stringField,"stringField"); push(dateField,"dateField",BoaDateTime::DateTime); }
void MyStruct::ReadWrite( QDataStream & strm, bool modeWrite ){if (modeWrite) strm >> intPoleMyStruct; strm >> qstringPoleMyStruct ; // здесь еще 100 полей else strm << intPoleMyStruct; strm << qstringPoleMyStruct ; // здесь еще 100 полей ...}
C++ (Qt)void MyStruct::ReadWrite( QDataStream & strm, int mode ){ ReadWrite(strm, &intPoleMyStruct, mode); ReadWrite(strm, &qstringPoleMyStruct, mode); // здесь еще 100 полей }
push(boolField); push(charField); push(shortField);...
TestRecord rec;char ch = rec.charField;rec.shortField = 123;