Cleaned up a namespace mess (db::Net was duplicated in NetTracer and db itself) - renamed to db::NetTracerNet, but better solution would be to rename db to something else in the plugin.

This commit is contained in:
Matthias Koefferlein 2019-01-05 22:39:52 +01:00
parent 15b79c9ddb
commit cbca1fb530
5 changed files with 34 additions and 34 deletions

View File

@ -338,13 +338,13 @@ NetTracerSymbolInfo::parse (tl::Extractor &ex)
// ----------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------
// Net implementation // Net implementation
Net::Net () NetTracerNet::NetTracerNet ()
: m_dbu (0.001), m_incomplete (true), m_trace_path (false) : m_dbu (0.001), m_incomplete (true), m_trace_path (false)
{ {
// .. nothing yet .. // .. nothing yet ..
} }
Net::Net (const NetTracer &tracer, const db::ICplxTrans &trans, const db::Layout &layout, db::cell_index_type cell_index, const std::string &layout_filename, const std::string &layout_name, const NetTracerData &data) NetTracerNet::NetTracerNet (const NetTracer &tracer, const db::ICplxTrans &trans, const db::Layout &layout, db::cell_index_type cell_index, const std::string &layout_filename, const std::string &layout_name, const NetTracerData &data)
: m_name (tracer.name ()), m_incomplete (tracer.incomplete ()), m_trace_path (false) : m_name (tracer.name ()), m_incomplete (tracer.incomplete ()), m_trace_path (false)
{ {
m_dbu = layout.dbu (); m_dbu = layout.dbu ();
@ -406,7 +406,7 @@ Net::Net (const NetTracer &tracer, const db::ICplxTrans &trans, const db::Layout
} }
std::vector<unsigned int> std::vector<unsigned int>
Net::export_net (db::Layout &layout, db::Cell &export_cell) NetTracerNet::export_net (db::Layout &layout, db::Cell &export_cell)
{ {
std::vector<unsigned int> new_layers; std::vector<unsigned int> new_layers;
std::map<unsigned int, unsigned int> layer_map; std::map<unsigned int, unsigned int> layer_map;
@ -446,7 +446,7 @@ Net::export_net (db::Layout &layout, db::Cell &export_cell)
} }
const std::string & const std::string &
Net::cell_name (db::cell_index_type cell_index) const NetTracerNet::cell_name (db::cell_index_type cell_index) const
{ {
std::map <unsigned int, std::string>::const_iterator cn = m_cell_names.find (cell_index); std::map <unsigned int, std::string>::const_iterator cn = m_cell_names.find (cell_index);
if (cn != m_cell_names.end ()) { if (cn != m_cell_names.end ()) {
@ -458,7 +458,7 @@ Net::cell_name (db::cell_index_type cell_index) const
} }
db::LayerProperties db::LayerProperties
Net::representative_layer_for (unsigned int log_layer) const NetTracerNet::representative_layer_for (unsigned int log_layer) const
{ {
std::map <unsigned int, std::pair <db::LayerProperties, db::LayerProperties> >::const_iterator l = m_layers.find (log_layer); std::map <unsigned int, std::pair <db::LayerProperties, db::LayerProperties> >::const_iterator l = m_layers.find (log_layer);
if (l != m_layers.end ()) { if (l != m_layers.end ()) {
@ -469,7 +469,7 @@ Net::representative_layer_for (unsigned int log_layer) const
} }
db::LayerProperties db::LayerProperties
Net::layer_for (unsigned int log_layer) const NetTracerNet::layer_for (unsigned int log_layer) const
{ {
std::map <unsigned int, std::pair <db::LayerProperties, db::LayerProperties> >::const_iterator l = m_layers.find (log_layer); std::map <unsigned int, std::pair <db::LayerProperties, db::LayerProperties> >::const_iterator l = m_layers.find (log_layer);
if (l != m_layers.end ()) { if (l != m_layers.end ()) {
@ -480,7 +480,7 @@ Net::layer_for (unsigned int log_layer) const
} }
void void
Net::define_layer (unsigned int l, const db::LayerProperties &lp, const db::LayerProperties &lp_representative) NetTracerNet::define_layer (unsigned int l, const db::LayerProperties &lp, const db::LayerProperties &lp_representative)
{ {
m_layers.insert (std::make_pair (l, std::make_pair (lp, lp_representative))); m_layers.insert (std::make_pair (l, std::make_pair (lp, lp_representative)));
} }

View File

@ -157,7 +157,7 @@ private:
std::string m_expression; std::string m_expression;
}; };
class DB_PLUGIN_PUBLIC Net class DB_PLUGIN_PUBLIC NetTracerNet
{ {
public: public:
typedef std::vector <db::NetTracerShape>::const_iterator iterator; typedef std::vector <db::NetTracerShape>::const_iterator iterator;
@ -165,12 +165,12 @@ public:
/** /**
* @brief Default constructor * @brief Default constructor
*/ */
Net (); NetTracerNet ();
/** /**
* @brief Constructor * @brief Constructor
*/ */
Net (const db::NetTracer &tracer, const db::ICplxTrans &trans, const db::Layout &layout, db::cell_index_type cell_index, const std::string &layout_filename, const std::string &layout_name, const db::NetTracerData &data); NetTracerNet (const db::NetTracer &tracer, const db::ICplxTrans &trans, const db::Layout &layout, db::cell_index_type cell_index, const std::string &layout_filename, const std::string &layout_name, const db::NetTracerData &data);
/** /**
* @brief Iterate the shapes (begin) * @brief Iterate the shapes (begin)

View File

@ -103,7 +103,7 @@ NetTracerDialog::~NetTracerDialog ()
void void
NetTracerDialog::clear_nets () NetTracerDialog::clear_nets ()
{ {
for (std::vector <db::Net *>::iterator n = mp_nets.begin (); n != mp_nets.end (); ++n) { for (std::vector <db::NetTracerNet *>::iterator n = mp_nets.begin (); n != mp_nets.end (); ++n) {
delete *n; delete *n;
} }
mp_nets.clear (); mp_nets.clear ();
@ -178,7 +178,7 @@ NetTracerDialog::mouse_click_event (const db::DPoint &p, unsigned int buttons, b
stop_search_box = db::DBox (m_mouse_first_point, m_mouse_first_point).enlarged (db::DVector (l, l)); stop_search_box = db::DBox (m_mouse_first_point, m_mouse_first_point).enlarged (db::DVector (l, l));
} }
db::Net *net = do_trace (start_search_box, stop_search_box, trace_path); db::NetTracerNet *net = do_trace (start_search_box, stop_search_box, trace_path);
if (net) { if (net) {
// create a new net taking the shapes from the tracer // create a new net taking the shapes from the tracer
@ -220,7 +220,7 @@ NetTracerDialog::redo_trace_clicked ()
{ {
BEGIN_PROTECTED BEGIN_PROTECTED
std::set <db::Net *> selected_nets; std::set <db::NetTracerNet *> selected_nets;
QList<QListWidgetItem *> selected_items = net_list->selectedItems (); QList<QListWidgetItem *> selected_items = net_list->selectedItems ();
for (QList<QListWidgetItem *>::const_iterator item = selected_items.begin (); item != selected_items.end (); ++item) { for (QList<QListWidgetItem *>::const_iterator item = selected_items.begin (); item != selected_items.end (); ++item) {
@ -230,18 +230,18 @@ BEGIN_PROTECTED
} }
} }
std::vector <db::Net *> nets; std::vector <db::NetTracerNet *> nets;
nets.swap (mp_nets); nets.swap (mp_nets);
m_net_index = 1; m_net_index = 1;
std::vector <size_t> new_selection; std::vector <size_t> new_selection;
for (std::vector <db::Net *>::const_iterator n = nets.begin (); n != nets.end (); ++n) { for (std::vector <db::NetTracerNet *>::const_iterator n = nets.begin (); n != nets.end (); ++n) {
try { try {
db::Net *net = do_trace ((*n)->start_search_box (), (*n)->stop_search_box (), (*n)->trace_path_flag ()); db::NetTracerNet *net = do_trace ((*n)->start_search_box (), (*n)->stop_search_box (), (*n)->trace_path_flag ());
if (net) { if (net) {
// create a new net taking the shapes from the tracer // create a new net taking the shapes from the tracer
@ -281,7 +281,7 @@ BEGIN_PROTECTED
END_PROTECTED END_PROTECTED
} }
db::Net * db::NetTracerNet *
NetTracerDialog::do_trace (const db::DBox &start_search_box, const db::DBox &stop_search_box, bool trace_path) NetTracerDialog::do_trace (const db::DBox &start_search_box, const db::DBox &stop_search_box, bool trace_path)
{ {
unsigned int start_layer = 0; unsigned int start_layer = 0;
@ -401,7 +401,7 @@ NetTracerDialog::do_trace (const db::DBox &start_search_box, const db::DBox &sto
} else { } else {
// create a new net taking the shapes from the tracer // create a new net taking the shapes from the tracer
db::Net *net = new db::Net (net_tracer, db::ICplxTrans (cv.context_trans ()), cv->layout (), cv.cell_index (), cv->filename (), cv->name (), tracer_data); db::NetTracerNet *net = new db::NetTracerNet (net_tracer, db::ICplxTrans (cv.context_trans ()), cv->layout (), cv.cell_index (), cv->filename (), cv->name (), tracer_data);
net->set_start_search_box (start_search_box); net->set_start_search_box (start_search_box);
net->set_stop_search_box (stop_search_box); net->set_stop_search_box (stop_search_box);
net->set_trace_path_flag (trace_path); net->set_trace_path_flag (trace_path);
@ -712,7 +712,7 @@ NetTracerDialog::update_info ()
std::map<unsigned int, db::coord_traits<db::Coord>::perimeter_type> statinfo_perimeter; std::map<unsigned int, db::coord_traits<db::Coord>::perimeter_type> statinfo_perimeter;
size_t tot_shapes = 0; size_t tot_shapes = 0;
for (db::Net::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end (); ++net_shape) { for (db::NetTracerNet::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end (); ++net_shape) {
if (tot_shapes++ >= max_shapes) { if (tot_shapes++ >= max_shapes) {
incomplete = true; incomplete = true;
@ -917,7 +917,7 @@ NetTracerDialog::update_info ()
bool incomplete = false; bool incomplete = false;
std::set<std::string> labels; std::set<std::string> labels;
for (db::Net::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end (); ++net_shape) { for (db::NetTracerNet::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end (); ++net_shape) {
if (net_shape->shape ().is_text ()) { if (net_shape->shape ().is_text ()) {
@ -962,7 +962,7 @@ NetTracerDialog::update_info ()
incomplete = false; incomplete = false;
std::set<std::string> cells; std::set<std::string> cells;
for (db::Net::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end (); ++net_shape) { for (db::NetTracerNet::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end (); ++net_shape) {
if (cells.size () >= max_cells) { if (cells.size () >= max_cells) {
incomplete = true; incomplete = true;
@ -1238,7 +1238,7 @@ BEGIN_PROTECTED
w.start_element ("net"); w.start_element ("net");
const db::Net *net = mp_nets[item_index]; const db::NetTracerNet *net = mp_nets[item_index];
w.start_element ("name"); w.start_element ("name");
w.cdata (net->name ()); w.cdata (net->name ());
@ -1262,7 +1262,7 @@ BEGIN_PROTECTED
w.start_element ("shapes"); w.start_element ("shapes");
for (db::Net::iterator net_shape = net->begin (); net_shape != net->end (); ++net_shape) { for (db::NetTracerNet::iterator net_shape = net->begin (); net_shape != net->end (); ++net_shape) {
w.start_element ("element"); w.start_element ("element");
@ -1443,7 +1443,7 @@ NetTracerDialog::adjust_view ()
db::DBox cv_bbox; db::DBox cv_bbox;
// Create markers for the shapes // Create markers for the shapes
for (db::Net::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end (); ++net_shape) { for (db::NetTracerNet::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end (); ++net_shape) {
// Find the actual layer by looking up the layer properties .. // Find the actual layer by looking up the layer properties ..
std::map <unsigned int, unsigned int>::const_iterator ll = llmap.find (net_shape->layer ()); std::map <unsigned int, unsigned int>::const_iterator ll = llmap.find (net_shape->layer ());
@ -1534,7 +1534,7 @@ NetTracerDialog::update_highlights ()
QColor net_color = mp_nets [item_index]->color (); QColor net_color = mp_nets [item_index]->color ();
// Create markers for the shapes // Create markers for the shapes
for (db::Net::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end () && n_marker < m_max_marker_count; ++net_shape) { for (db::NetTracerNet::iterator net_shape = mp_nets [item_index]->begin (); net_shape != mp_nets [item_index]->end () && n_marker < m_max_marker_count; ++net_shape) {
// Find the actual layer by looking up the layer properties .. // Find the actual layer by looking up the layer properties ..
std::map <unsigned int, unsigned int>::const_iterator ll = llmap.find (net_shape->layer ()); std::map <unsigned int, unsigned int>::const_iterator ll = llmap.find (net_shape->layer ());

View File

@ -38,7 +38,7 @@
namespace db namespace db
{ {
class Net; class NetTracerNet;
} }
namespace lay namespace lay
@ -82,7 +82,7 @@ protected slots:
void redo_trace_clicked (); void redo_trace_clicked ();
private: private:
std::vector <db::Net *> mp_nets; std::vector <db::NetTracerNet *> mp_nets;
std::vector <lay::ShapeMarker *> mp_markers; std::vector <lay::ShapeMarker *> mp_markers;
unsigned int m_cv_index; unsigned int m_cv_index;
int m_net_index; int m_net_index;
@ -113,7 +113,7 @@ private:
void update_info (); void update_info ();
void layer_list_changed (int index); void layer_list_changed (int index);
void release_mouse (); void release_mouse ();
db::Net *do_trace (const db::DBox &start_search_box, const db::DBox &stop_search_box, bool trace_path); db::NetTracerNet *do_trace (const db::DBox &start_search_box, const db::DBox &stop_search_box, bool trace_path);
}; };
} }

View File

@ -76,18 +76,18 @@ static db::NetTracerShape find_shape (const db::Layout &layout, const db::Cell &
} }
#endif #endif
static db::Net trace (db::NetTracer &tracer, const db::Layout &layout, const db::Cell &cell, const db::NetTracerTechnologyComponent &tc, unsigned int l_start, const db::Point &p_start) static db::NetTracerNet trace (db::NetTracer &tracer, const db::Layout &layout, const db::Cell &cell, const db::NetTracerTechnologyComponent &tc, unsigned int l_start, const db::Point &p_start)
{ {
db::NetTracerData tracer_data = tc.get_tracer_data (layout); db::NetTracerData tracer_data = tc.get_tracer_data (layout);
tracer.trace (layout, cell, p_start, l_start, tracer_data); tracer.trace (layout, cell, p_start, l_start, tracer_data);
return db::Net (tracer, db::ICplxTrans (), layout, cell.cell_index (), std::string (), std::string (), tracer_data); return db::NetTracerNet (tracer, db::ICplxTrans (), layout, cell.cell_index (), std::string (), std::string (), tracer_data);
} }
static db::Net trace (db::NetTracer &tracer, const db::Layout &layout, const db::Cell &cell, const db::NetTracerTechnologyComponent &tc, unsigned int l_start, const db::Point &p_start, unsigned int l_stop, const db::Point &p_stop) static db::NetTracerNet trace (db::NetTracer &tracer, const db::Layout &layout, const db::Cell &cell, const db::NetTracerTechnologyComponent &tc, unsigned int l_start, const db::Point &p_start, unsigned int l_stop, const db::Point &p_stop)
{ {
db::NetTracerData tracer_data = tc.get_tracer_data (layout); db::NetTracerData tracer_data = tc.get_tracer_data (layout);
tracer.trace (layout, cell, p_start, l_start, p_stop, l_stop, tracer_data); tracer.trace (layout, cell, p_start, l_start, p_stop, l_stop, tracer_data);
return db::Net (tracer, db::ICplxTrans (), layout, cell.cell_index (), std::string (), std::string (), tracer_data); return db::NetTracerNet (tracer, db::ICplxTrans (), layout, cell.cell_index (), std::string (), std::string (), tracer_data);
} }
void run_test (tl::TestBase *_this, const std::string &file, const db::NetTracerTechnologyComponent &tc, const db::LayerProperties &lp_start, const db::Point &p_start, const std::string &file_au, const char *net_name = 0) void run_test (tl::TestBase *_this, const std::string &file, const db::NetTracerTechnologyComponent &tc, const db::LayerProperties &lp_start, const db::Point &p_start, const std::string &file_au, const char *net_name = 0)
@ -107,7 +107,7 @@ void run_test (tl::TestBase *_this, const std::string &file, const db::NetTracer
const db::Cell &cell = layout_org.cell (*layout_org.begin_top_down ()); const db::Cell &cell = layout_org.cell (*layout_org.begin_top_down ());
db::NetTracer tracer; db::NetTracer tracer;
db::Net net = trace (tracer, layout_org, cell, tc, layer_for (layout_org, lp_start), p_start); db::NetTracerNet net = trace (tracer, layout_org, cell, tc, layer_for (layout_org, lp_start), p_start);
if (net_name) { if (net_name) {
EXPECT_EQ (net.name (), std::string (net_name)); EXPECT_EQ (net.name (), std::string (net_name));
@ -141,7 +141,7 @@ void run_test2 (tl::TestBase *_this, const std::string &file, const db::NetTrace
const db::Cell &cell = layout_org.cell (*layout_org.begin_top_down ()); const db::Cell &cell = layout_org.cell (*layout_org.begin_top_down ());
db::NetTracer tracer; db::NetTracer tracer;
db::Net net = trace (tracer, layout_org, cell, tc, layer_for (layout_org, lp_start), p_start, layer_for (layout_org, lp_stop), p_stop); db::NetTracerNet net = trace (tracer, layout_org, cell, tc, layer_for (layout_org, lp_start), p_start, layer_for (layout_org, lp_stop), p_stop);
if (net_name) { if (net_name) {
EXPECT_EQ (net.name (), std::string (net_name)); EXPECT_EQ (net.name (), std::string (net_name));