mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-09-08 04:31:14 +02:00
Adding optional to differentiate between empty sets and unset attributes
Signed-off-by: Ethan Mahintorabi <[email protected]>
This commit is contained in:
@@ -275,10 +275,13 @@ ConcreteCell::setAttribute(const std::string &key,
|
||||
attribute_map_.insert(key, value);
|
||||
}
|
||||
|
||||
std::string
|
||||
std::optional<std::string>
|
||||
ConcreteCell::getAttribute(const std::string &key) const
|
||||
{
|
||||
return attribute_map_.findKey(key);
|
||||
if (attribute_map_.hasKey(key)) {
|
||||
return attribute_map_.findKey(key);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
ConcretePort *
|
||||
|
||||
@@ -606,7 +606,7 @@ ConcreteNetwork::filename(const Cell *cell)
|
||||
return ccell->filename();
|
||||
}
|
||||
|
||||
std::string
|
||||
std::optional<std::string>
|
||||
ConcreteNetwork::getAttribute(const Cell *cell,
|
||||
const std::string &key) const
|
||||
{
|
||||
@@ -938,7 +938,7 @@ ConcreteNetwork::id(const Instance *instance) const
|
||||
return inst->id();
|
||||
}
|
||||
|
||||
std::string
|
||||
std::optional<std::string>
|
||||
ConcreteNetwork::getAttribute(const Instance *inst,
|
||||
const std::string &key) const
|
||||
{
|
||||
@@ -1689,10 +1689,13 @@ ConcreteInstance::setAttribute(const std::string &key,
|
||||
attribute_map_.insert(key, value);
|
||||
}
|
||||
|
||||
std::string
|
||||
std::optional<std::string>
|
||||
ConcreteInstance::getAttribute(const std::string &key) const
|
||||
{
|
||||
return attribute_map_.findKey(key);
|
||||
if (attribute_map_.hasKey(key)) {
|
||||
return attribute_map_.findKey(key);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -122,7 +122,7 @@ NetworkNameAdapter::id(const Cell *cell) const
|
||||
return network_->id(cell);
|
||||
}
|
||||
|
||||
std::string
|
||||
std::optional<std::string>
|
||||
NetworkNameAdapter::getAttribute(const Cell *cell,
|
||||
const std::string &key) const
|
||||
{
|
||||
@@ -334,7 +334,7 @@ NetworkNameAdapter::cell(const Instance *instance) const
|
||||
return network_->cell(instance);
|
||||
}
|
||||
|
||||
std::string
|
||||
std::optional<std::string>
|
||||
NetworkNameAdapter::getAttribute(const Instance *inst,
|
||||
const std::string &key) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user