From 6f333965a9f933d54c1151d6c47392c02d55e3e4 Mon Sep 17 00:00:00 2001 From: dellaert Date: Wed, 12 Nov 2014 02:46:49 +0100 Subject: [PATCH] Massive edit: new Qualified type groups namespaces with name, eliminates a lot of clutter. --- wrap/TypeAttributesTable.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wrap/TypeAttributesTable.cpp b/wrap/TypeAttributesTable.cpp index 449b88aab..16055fca1 100644 --- a/wrap/TypeAttributesTable.cpp +++ b/wrap/TypeAttributesTable.cpp @@ -46,13 +46,17 @@ namespace wrap { void TypeAttributesTable::checkValidity(const vector& classes) const { BOOST_FOREACH(const Class& cls, classes) { // Check that class is virtual if it has a parent - if(!cls.qualifiedParent.empty() && !cls.isVirtual) - throw AttributeError(cls.qualifiedName("::"), "Has a base class so needs to be declared virtual, change to 'virtual class "+cls.name+" ...'"); + if (!cls.qualifiedParent.empty() && !cls.isVirtual) + throw AttributeError(cls.qualifiedName("::"), + "Has a base class so needs to be declared virtual, change to 'virtual class " + + cls.name + " ...'"); // Check that parent is virtual as well - if(!cls.qualifiedParent.empty() && !at(wrap::qualifiedName("::", cls.qualifiedParent)).isVirtual) - throw AttributeError(wrap::qualifiedName("::", cls.qualifiedParent), - "Is the base class of " + cls.qualifiedName("::") + ", so needs to be declared virtual"); + Qualified parent = cls.qualifiedParent; + if (!parent.empty() && !at(parent.qualifiedName("::")).isVirtual) + throw AttributeError(parent.qualifiedName("::"), + "Is the base class of " + cls.qualifiedName("::") + + ", so needs to be declared virtual"); } } -} \ No newline at end of file +}