aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx/elements.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsd/cxx/elements.hxx')
-rw-r--r--xsd/cxx/elements.hxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/xsd/cxx/elements.hxx b/xsd/cxx/elements.hxx
index b0a38d1..f9fa619 100644
--- a/xsd/cxx/elements.hxx
+++ b/xsd/cxx/elements.hxx
@@ -438,6 +438,21 @@ namespace CXX
return 0;
}
+ // Sources traverser that goes into each schema only once.
+ //
+ struct Sources: Traversal::Sources
+ {
+ virtual void
+ traverse (SemanticGraph::Sources& s)
+ {
+ if (schemas_.insert (&s.schema ()).second)
+ Traversal::Sources::traverse (s);
+ }
+
+ private:
+ Cult::Containers::Set<SemanticGraph::Schema*> schemas_;
+ };
+
// Usual namespace mapping.
//
struct Namespace: Traversal::Namespace
@@ -476,7 +491,6 @@ namespace CXX
ScopeTracker* st_;
};
-
//
//
template <typename X>