Skip to content

Commit 5001bc0

Browse files
committed
odb: add custom end to itr template
Signed-off-by: LucasYuki <[email protected]>
1 parent 8cbbffe commit 5001bc0

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/odb/src/codeGenerator/schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"orderReversed": "true",
4848
"flags":["private"],
4949
"sequential": 0,
50+
"customEnd": "true",
5051
"includes": ["dbModule.h", "dbBusPort.h"]
5152
},
5253
{

src/odb/src/codeGenerator/templates/itr.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,14 @@ uint {{itr.name}}::begin(dbObject* parent) const
6262
//User Code End begin
6363
}
6464

65-
uint {{itr.name}}::end(dbObject* /* unused: parent */) const
65+
uint {{itr.name}}::end(dbObject* {{ "parent" if itr.customEnd else "/* unused: parent */" }}) const
6666
{
67+
{%if itr.customEnd %}
68+
//User Code Begin end
69+
//User Code End end
70+
{% else %}
6771
return 0;
72+
{% endif %}
6873
}
6974

7075
uint {{itr.name}}::next(uint id, ...) const

src/odb/src/db/dbModuleBusPortModBTermItr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ uint dbModuleBusPortModBTermItr::begin(dbObject* parent) const
6262

6363
uint dbModuleBusPortModBTermItr::end(dbObject* parent) const
6464
{
65-
// User Code Begin begin
65+
// User Code Begin end
6666
_dbBusPort* _busport = (_dbBusPort*) parent;
6767
return next(_busport->last_);
68-
// User Code End begin
68+
// User Code End end
6969
}
7070

7171
uint dbModuleBusPortModBTermItr::next(uint id, ...) const

0 commit comments

Comments
 (0)