From 6ed086e157ccd3ff74348193cf459d32ce70dddf Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Mon, 4 Jul 2016 11:44:57 +0200
Subject: [PATCH] added asserts to make sure the implementation is matching the
 expected direction

---
 include/ScalarAccessor.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/ScalarAccessor.h b/include/ScalarAccessor.h
index 17c812f4..e4f2cff8 100644
--- a/include/ScalarAccessor.h
+++ b/include/ScalarAccessor.h
@@ -115,8 +115,12 @@ namespace ChimeraTK {
 
       void useProcessVariable(const boost::shared_ptr<ProcessVariable> &var) {
         impl = boost::dynamic_pointer_cast< ProcessScalar<UserType> >(var);
-        if(!impl) {
-          throw std::string("ProcessVariable of the wrong type provided, cannot be used as the implementation!"); // @todo TODO throw proper exception
+        assert(impl);
+        if(Accessor<UserType>::getDirection() == VariableDirection::consuming) {
+          assert(impl->isReceiver());
+        }
+        else {
+          assert(impl->isSender());
         }
       }
 
-- 
GitLab