From d06f5088a152f3bb228050f8fe25673332ce66fd Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 20 Apr 2019 13:09:49 +0200 Subject: [PATCH] Move macro definition out of class --- include/AutomatableModel.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index f5215676e..a92bd5191 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -60,6 +60,11 @@ modelname.setValue( (float) val ); \ } +// use this to make subclasses visitable +#define MODEL_IS_VISITABLE \ + void accept(ModelVisitor& v) override { v.visit(*this); } \ + void accept(ConstModelVisitor& v) const override { v.visit(*this); } + class ControllerConnection; @@ -85,10 +90,6 @@ public: // Implement those by using the MODEL_IS_VISITABLE macro virtual void accept(ModelVisitor& v) = 0; virtual void accept(ConstModelVisitor& v) const = 0; - // use this to make subclasses visitable -#define MODEL_IS_VISITABLE \ - void accept(ModelVisitor& v) override { v.visit(*this); } \ - void accept(ConstModelVisitor& v) const override { v.visit(*this); } public: //! Return this class casted to Target, or nullptr if impossible