Skip to content

Commit

Permalink
Put static constexpr in class dbNetwork.
Browse files Browse the repository at this point in the history
Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Jun 9, 2024
1 parent c655c47 commit b29477a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 14 additions & 0 deletions src/dbSta/include/db_sta/dbNetwork.hh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ class dbNetwork : public ConcreteNetwork
public:
dbNetwork();
~dbNetwork() override;

// unique addresses for the db objects
static constexpr unsigned DBITERM_ID = 0x0;
static constexpr unsigned DBBTERM_ID = 0x1;
static constexpr unsigned DBINST_ID = 0x2;
static constexpr unsigned DBNET_ID = 0x3;
static constexpr unsigned DBMODITERM_ID = 0x4;
static constexpr unsigned DBMODBTERM_ID = 0x5;
static constexpr unsigned DBMODINST_ID = 0x6;
static constexpr unsigned DBMODNET_ID = 0x7;
static constexpr unsigned DBMODULE_ID = 0x8;
// Number of lower bits used
static constexpr unsigned DBIDTAG_WIDTH = 0x4;

void init(dbDatabase* db, Logger* logger);
void setBlock(dbBlock* block);
void clear() override;
Expand Down
12 changes: 0 additions & 12 deletions src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ char* tmpStringCopy(const char* str)
// lower 4 bits used to encode type
//

static constexpr unsigned DBITERM_ID = 0x0;
static constexpr unsigned DBBTERM_ID = 0x1;
static constexpr unsigned DBINST_ID = 0x2;
static constexpr unsigned DBNET_ID = 0x3;
static constexpr unsigned DBMODITERM_ID = 0x4;
static constexpr unsigned DBMODBTERM_ID = 0x5;
static constexpr unsigned DBMODINST_ID = 0x6;
static constexpr unsigned DBMODNET_ID = 0x7;
static constexpr unsigned DBMODULE_ID = 0x8;
// Number of lower bits used
static constexpr unsigned DBIDTAG_WIDTH = 0x4;

ObjectId dbNetwork::getDbNwkObjectId(dbObjectType typ, ObjectId db_id) const
{
if (db_id > (std::numeric_limits<ObjectId>::max() >> DBIDTAG_WIDTH)) {
Expand Down

0 comments on commit b29477a

Please sign in to comment.