1+ // SPDX-License-Identifier: BSD-3-Clause
2+ // Copyright (c) 2019-2025, The OpenROAD Authors
3+
4+ // Generator Code Begin Cpp
5+ #include " dbScanListScanInstItr.h"
6+
7+ #include " dbScanInst.h"
8+ #include " dbScanList.h"
9+ #include " dbTable.h"
10+ #include " dbTable.hpp"
11+
12+ namespace odb {
13+
14+ // //////////////////////////////////////////////////////////////////
15+ //
16+ // dbScanListScanInstItr - Methods
17+ //
18+ // //////////////////////////////////////////////////////////////////
19+
20+ bool dbScanListScanInstItr::reversible ()
21+ {
22+ return true ;
23+ }
24+
25+ bool dbScanListScanInstItr::orderReversed ()
26+ {
27+ return true ;
28+ }
29+
30+ void dbScanListScanInstItr::reverse (dbObject* parent)
31+ {
32+ // User Code Begin reverse
33+ _dbScanList* scan_list = (_dbScanList*) parent;
34+ uint current_id = scan_list->_first_scan_inst ;
35+ uint new_head = 0 ;
36+
37+ while (current_id != 0 ) {
38+ _dbScanInst* scan_inst = _scan_inst_tbl->getPtr (current_id);
39+ uint new_next = scan_inst->_prev_list_scan_inst ;
40+ scan_inst->_prev_list_scan_inst = scan_inst->_next_list_scan_inst ;
41+ scan_inst->_next_list_scan_inst = new_next;
42+ new_head = current_id;
43+ current_id = scan_inst->_prev_list_scan_inst ;
44+ }
45+
46+ scan_list->_first_scan_inst = new_head;
47+ // User Code End reverse
48+ }
49+
50+ uint dbScanListScanInstItr::sequential ()
51+ {
52+ return 0 ;
53+ }
54+
55+ uint dbScanListScanInstItr::size (dbObject* parent)
56+ {
57+ uint id;
58+ uint cnt = 0 ;
59+
60+ for (id = dbScanListScanInstItr::begin (parent);
61+ id != dbScanListScanInstItr::end (parent);
62+ id = dbScanListScanInstItr::next (id)) {
63+ ++cnt;
64+ }
65+
66+ return cnt;
67+ }
68+
69+ uint dbScanListScanInstItr::begin (dbObject* parent)
70+ {
71+ // User Code Begin begin
72+ _dbScanList* scan_list = (_dbScanList*) parent;
73+ return (uint) scan_list->_first_scan_inst ;
74+ // User Code End begin
75+ }
76+
77+ uint dbScanListScanInstItr::end (dbObject* /* unused: parent */ )
78+ {
79+ return 0 ;
80+ }
81+
82+ uint dbScanListScanInstItr::next (uint id, ...)
83+ {
84+ // User Code Begin next
85+ _dbScanInst* scan_inst = _scan_inst_tbl->getPtr (id);
86+ return (uint) scan_inst->_next_list_scan_inst ;
87+ // User Code End next
88+ }
89+
90+ dbObject* dbScanListScanInstItr::getObject (uint id, ...)
91+ {
92+ return _scan_inst_tbl->getPtr (id);
93+ }
94+ } // namespace odb
95+ // Generator Code End Cpp
0 commit comments