Skip to content

Commit a9fa70d

Browse files
committed
odb: fixes
Signed-off-by: osamahammad21 <[email protected]>
1 parent 89f9b84 commit a9fa70d

File tree

5 files changed

+6
-24
lines changed

5 files changed

+6
-24
lines changed

src/odb/src/codeGenerator/schema/chip/dbMarkerCategory.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
"name": "max_markers_",
2222
"type": "int",
2323
"default": "10000"
24-
},
25-
{
26-
"name":"block_",
27-
"type":"dbId<_dbBlock>",
28-
"flags":["no-set", "no-get"]
2924
}
3025
],
3126
"cpp_includes":["dbBlock.h"]

src/odb/src/db/dbBlock.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,11 +1024,6 @@ dbIStream& operator>>(dbIStream& stream, _dbBlock& block)
10241024
&& db->isLessThanSchema(db_schema_chip_marker_categories)) {
10251025
_dbChip* chip = db->chip_tbl_->getPtr(block._chip);
10261026
stream >> *chip->marker_categories_tbl_;
1027-
for (const auto& marker_category :
1028-
((dbChip*) chip)->getMarkerCategories()) {
1029-
chip->marker_categories_map_[marker_category->getName()]
1030-
= marker_category->getId();
1031-
}
10321027
dbHashTable<_dbMarkerCategory> tmp_hash;
10331028
stream >> tmp_hash;
10341029
}

src/odb/src/db/dbChip.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ dbIStream& operator>>(dbIStream& stream, _dbChip& obj)
245245
for (const auto& chip_region : chip->getChipRegions()) {
246246
obj.chip_region_map_[chip_region->getName()] = chip_region->getId();
247247
}
248+
for (const auto& marker_category : ((dbChip*) &obj)->getMarkerCategories()) {
249+
obj.marker_categories_map_[marker_category->getName()]
250+
= marker_category->getId();
251+
}
248252
// User Code End >>
249253
return stream;
250254
}

src/odb/src/db/dbMarkerCategory.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ bool _dbMarkerCategory::operator==(const _dbMarkerCategory& rhs) const
4040
if (max_markers_ != rhs.max_markers_) {
4141
return false;
4242
}
43-
if (block_ != rhs.block_) {
44-
return false;
45-
}
4643
if (*marker_tbl_ != *rhs.marker_tbl_) {
4744
return false;
4845
}
@@ -84,7 +81,6 @@ dbIStream& operator>>(dbIStream& stream, _dbMarkerCategory& obj)
8481
stream >> obj.description_;
8582
stream >> obj.source_;
8683
stream >> obj.max_markers_;
87-
stream >> obj.block_;
8884
stream >> *obj.marker_tbl_;
8985
stream >> *obj.categories_tbl_;
9086
stream >> obj.categories_hash_;
@@ -98,7 +94,6 @@ dbOStream& operator<<(dbOStream& stream, const _dbMarkerCategory& obj)
9894
stream << obj.description_;
9995
stream << obj.source_;
10096
stream << obj.max_markers_;
101-
stream << obj.block_;
10297
stream << *obj.marker_tbl_;
10398
stream << *obj.categories_tbl_;
10499
stream << obj.categories_hash_;
@@ -150,14 +145,11 @@ bool _dbMarkerCategory::isTopCategory() const
150145

151146
_dbBlock* _dbMarkerCategory::getBlock() const
152147
{
153-
if (!block_.isValid()) {
154-
return nullptr;
155-
}
156148
dbMarkerCategory* category = (dbMarkerCategory*) this;
157149
_dbMarkerCategory* top_category
158150
= (_dbMarkerCategory*) category->getTopCategory();
159-
_dbChip* chip = (_dbChip*) top_category->getOwner();
160-
return (_dbBlock*) chip->_block_tbl->getPtr(block_);
151+
dbChip* chip = (dbChip*) top_category->getOwner();
152+
return (_dbBlock*) chip->getBlock();
161153
}
162154

163155
bool _dbMarkerCategory::hasMaxMarkerLimit() const
@@ -820,7 +812,6 @@ dbMarkerCategory* dbMarkerCategory::create(dbBlock* block, const char* name)
820812
if (category == nullptr) {
821813
return nullptr;
822814
}
823-
((_dbMarkerCategory*) category)->block_ = block->getImpl()->getId();
824815
for (auto cb : ((_dbBlock*) block)->_callbacks) {
825816
cb->inDbMarkerCategoryCreate(category);
826817
}
@@ -867,7 +858,6 @@ dbMarkerCategory* dbMarkerCategory::create(dbMarkerCategory* category,
867858
_dbMarkerCategory* _category = parent->categories_tbl_->create();
868859

869860
_category->_name = safe_strdup(name);
870-
_category->block_ = parent->block_;
871861

872862
parent->categories_hash_.insert(_category);
873863

src/odb/src/db/dbMarkerCategory.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class dbOStream;
2323
class _dbDatabase;
2424
class _dbMarker;
2525
class _dbMarkerCategory;
26-
class _dbBlock;
2726
// User Code Begin Classes
2827
class _dbBlock;
2928
// User Code End Classes
@@ -60,7 +59,6 @@ class _dbMarkerCategory : public _dbObject
6059
std::string description_;
6160
std::string source_;
6261
int max_markers_;
63-
dbId<_dbBlock> block_;
6462
dbTable<_dbMarker>* marker_tbl_;
6563
dbTable<_dbMarkerCategory>* categories_tbl_;
6664
dbHashTable<_dbMarkerCategory> categories_hash_;

0 commit comments

Comments
 (0)