WIP: introduced expanded net name

This commit is contained in:
Matthias Koefferlein
2018-12-27 10:43:25 +01:00
parent 639b0026d3
commit 8b2902c31b
6 changed files with 37 additions and 12 deletions
@@ -405,20 +405,9 @@ private:
hier_clusters_type m_net_clusters;
};
// @@@ TODO: move this somewhere else
static std::string net_name (const db::Net *net)
{
if (! net) {
return "(null)";
} else if (net->name ().empty ()) {
if (net->cluster_id () > std::numeric_limits<size_t>::max () / 2) {
return "$I" + tl::to_string ((std::numeric_limits<size_t>::max () - net->cluster_id ()) + 1);
} else {
return "$" + tl::to_string (net->cluster_id ());
}
} else {
return net->name ();
}
return net ? net->expanded_name () : "(null)";
}
static std::string device_name (const db::Device &device)