[asterisk-scf-commits] asterisk-scf/release/slice-plugins.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Jul 13 10:37:11 CDT 2011
branch "master" has been updated
via e32f1e961eff27cb30a6b40761379d3884077522 (commit)
from 5a2010bc3a7008c761346f1cc3c6cc4f0bb65594 (commit)
Summary of changes:
src/SliceVisitorPattern.cpp | 3 +++
test/visitor-test.ice | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit e32f1e961eff27cb30a6b40761379d3884077522
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Wed Jul 13 10:35:56 2011 -0500
Support infinite inheritance of 'visitability'.
When processing a class that inherits from a visitable class, in addition to
telling the visitor class about the subject class, mark the subject class itself
as visitable as well, so any classes that derive from it will also be
visitable.
diff --git a/src/SliceVisitorPattern.cpp b/src/SliceVisitorPattern.cpp
index 9a20d39..256a436 100644
--- a/src/SliceVisitorPattern.cpp
+++ b/src/SliceVisitorPattern.cpp
@@ -262,6 +262,9 @@ VisitorPatternVisitor::visitClassDefStart(const ClassDefPtr& p)
gop->setOverride(true);
gop->createParamDecl("visitor", baseVisitor->declaration(), false);
}
+ // Remember this class as a visitable base, so that any classes that extend
+ // it will automatically be visitable as well.
+ _visitableBases[p->scoped()] = make_pair(baseVisitor, derivedVisitor);
return false;
}
diff --git a/test/visitor-test.ice b/test/visitor-test.ice
index adad11a..18dd1c2 100644
--- a/test/visitor-test.ice
+++ b/test/visitor-test.ice
@@ -22,4 +22,7 @@ module test {
class ItemB2 extends ItemBBase {
};
+
+ class ItemB1A extends ItemB1 {
+ };
};
-----------------------------------------------------------------------
--
asterisk-scf/release/slice-plugins.git
More information about the asterisk-scf-commits
mailing list