Manually adding new fields in DB Object#
For example add_pitchDiag in object DbTechLayer.
*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 |
const uint32_t db_schema_minor = 52;
|
| 3 | Define a keyword for the new db rev number | dbDatabase.h |
const uint32_t db_schema_add_pitchDiag = 52;
|
| 4* | Stream in new fields Conditionally upon Schema number | dbTechLayer.cpp |
In the method dbIStream& 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 method dbOStream& operator<<:
if (obj.getDatabase()->isSchema(db_schema_add_pitchDiag)) {
stream << obj._pitchDiag;
}
|
| 6* | Diff new fields | dbTechLayer.cpp |
In the method void _dbTechLayer::differences:
DIFF_FIELD(_pitchDiag);
|
| 7* | Diff Out new fields | dbTechLayer.cpp |
In the method void _dbTechLayer::out:
DIFF_OUT_FIELD(_pitchDiag);
|
| 8* | Created access APIs to the fields | dbTechLayer.cpp |
int dbTechLayer::getPitchDiag() {...}
void dbTechLayer::setPitchDiag( int pitch ) {...}
|
| 9* | Add new APIs | include/db.h |
In the class dbTechLayer
int getPitchDiag();
void setPitchDiag( int pitch );
|