Manually adding new fields in DB Object
Manually adding new fields in DB Object#
For exampleadd_pitchDiag
in objectDbTechLayer
.
*Modifications in these steps need to be done inside user regions, delimited like the below, to avoid being rewritten by the code generator
// User Code Begin <something>...// User Code End <something>
Action | File | Source Code | |
---|---|---|---|
1 | Add Fields at the .h file | dbTechLayer.h | In the class_dbTechLayer :int _pitchDiag; |
2 | Increase the current rev number by one | dbDatabase.h | constuintdb_schema_minor=52; |
3 | Define a keyword for the new db rev number | dbDatabase.h | constuintdb_schema_add_pitchDiag=52; |
4* | Stream in new fields Conditionally upon Schema number | dbTechLayer.cpp | In the methoddbIStream& operator>> :if(obj.getDatabase()->isSchema(db_schema_add_pitchDiag)){stream>>obj._pitchDiag;} |
5* | Stream out new fields Conditionally upon Schema number | dbTechLayer.cpp | In the methoddbOStream& operator<< :if(obj.getDatabase()->isSchema(db_schema_add_pitchDiag)){stream<<obj._pitchDiag;} |
6* | Diff new fields | dbTechLayer.cpp | In the methodvoid _dbTechLayer::differences :DIFF_FIELD(_pitchDiag); |
7* | Diff Out new fields | dbTechLayer.cpp | In the methodvoid _dbTechLayer::out :DIFF_OUT_FIELD(_pitchDiag); |
8* | Created access APIs to the fields | dbTechLayer.cpp | intdbTechLayer::getPitchDiag(){...}voiddbTechLayer::setPitchDiag(intpitch){...} |
9* | Add new APIs | include/db.h | In the classdbTechLayer intgetPitchDiag();voidsetPitchDiag(intpitch); |