From 272b34c1a4639cd0f909bfb52d30339c93b0c42b Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Fri, 6 Jun 2014 22:00:39 +0200 Subject: Implemented WarningCapacitor as a counterpart to ErrorCapacitor * in difference to ErrorCapacitor this class doesn't throw an exception on "discharge" but returns the gathered warnings * adapted FunctionTransform and frontend error handling to include warnings * added static "try_create" method to TransformationFacade ** wraps construction error handling ** custom logic may be embedded using the std::function argument *** this was implemented to prevent unneccessary code duplication for handling both construction and generation errors * adapted FunctionTransform to return warning as "warning" nodes in the result tree ** added functional lambda expression factory method "handleErrors" *** returns a error handling lambda expression for a given ResultNodeFacade * implemented WarningGuard class in frontend executable ** guarantees warnings to be printed to std::cerr independent of any exceptions --- src/support/error/error_capacitor.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/support/error/error_capacitor.h') diff --git a/src/support/error/error_capacitor.h b/src/support/error/error_capacitor.h index 6017cb4..1c225e9 100644 --- a/src/support/error/error_capacitor.h +++ b/src/support/error/error_capacitor.h @@ -7,7 +7,7 @@ namespace InputXSLT { -class ErrorCapacitor : public ErrorMultiplexer::Receiver { +class ErrorCapacitor : public ErrorMultiplexer::receiver { public: class exception; @@ -15,17 +15,15 @@ class ErrorCapacitor : public ErrorMultiplexer::Receiver { typedef std::unique_ptr error_cache_ptr; ErrorCapacitor(ErrorMultiplexer*); - ~ErrorCapacitor(); void discharge(); virtual void receive( - const ErrorMultiplexer::ErrorType, + const ErrorMultiplexer::error_type, const std::string& ); private: - ErrorMultiplexer* const multiplexer_; error_cache_ptr error_cache_; }; @@ -34,7 +32,7 @@ class ErrorCapacitor::exception { public: exception(error_cache_ptr); - const error_cache* getCachedErrors() const; + const error_cache& operator*() const; private: error_cache_ptr error_cache_; -- cgit v1.2.3