Refactored simple content and child-handling into mixin classes.
[shibboleth/cpp-xmltooling.git] / xmltooling / exceptions.h
index 3ed1d6d..990c012 100644 (file)
@@ -72,7 +72,7 @@
  * @param name      the exception class name
  * @param ns        the exception class C++ namespace
  */
-#define REGISTER_EXCEPTION_FACTORY(name,ns) XMLToolingException::registerFactory(#ns".."#name,name##Factory)
+#define REGISTER_EXCEPTION_FACTORY(name,ns) XMLToolingException::registerFactory(#ns"::"#name,name##Factory)
 
 #if defined (_MSC_VER)
     #pragma warning( push )
@@ -329,6 +329,13 @@ namespace xmltooling {
             m_factoryMap.erase(exceptionClass);
         }
 
+        /**
+         * Unregisters all factories.
+         */
+        static void deregisterFactories() {
+            m_factoryMap.clear();
+        }
+
     private:
         typedef std::map<std::string,ExceptionFactory*> ExceptionFactoryMap;
         static ExceptionFactoryMap m_factoryMap;