From 95bab10a0ef46b189a0965216c13349ec1bcaa6a Mon Sep 17 00:00:00 2001 From: Romain Bouqueau Date: Sun, 1 May 2016 22:16:39 +0200 Subject: [PATCH] several improvements but nested output min creation in constructors are not ok yet --- src/lib_modules/core/output.hpp | 4 ++-- src/lib_modules/utils/helper.hpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib_modules/core/output.hpp b/src/lib_modules/core/output.hpp index c50d89fb..4de714aa 100644 --- a/src/lib_modules/core/output.hpp +++ b/src/lib_modules/core/output.hpp @@ -80,7 +80,6 @@ class IOutputCap { return safe_cast(p); } -private: virtual size_t getAllocatorSize() const = 0; virtual void addOutputInternal(IOutput *p) = 0; }; @@ -97,7 +96,7 @@ class OutputCap : public virtual IOutputCap { return outputs[i].get(); } -private: +protected: virtual size_t getAllocatorSize() const override { assert(allocatorSize > 0); return allocatorSize; @@ -106,6 +105,7 @@ class OutputCap : public virtual IOutputCap { outputs.push_back(uptr(p)); } +private: std::vector> outputs; const size_t allocatorSize; }; diff --git a/src/lib_modules/utils/helper.hpp b/src/lib_modules/utils/helper.hpp index daa66cf6..dadd3300 100644 --- a/src/lib_modules/utils/helper.hpp +++ b/src/lib_modules/utils/helper.hpp @@ -8,11 +8,11 @@ namespace Modules { -/* this default factory creates output pins with the default output - create nother one for other uses such as low latency */ +/* this default factory creates output pins with the default output - create another one for other uses such as low latency */ template -struct ModuleDefault : public InstanceType, public OutputCap { +struct ModuleDefault : public virtual OutputCap, public virtual InstanceType { template - ModuleDefault(size_t allocatorSize, Args&&... args) : InstanceType(std::forward(args)...), OutputCap(allocatorSize) {} + ModuleDefault(size_t allocatorSize, Args&&... args) : OutputCap(allocatorSize), InstanceType(std::forward(args)...) {} }; template